Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wlcore/wl18xx : add time sync event handling

Added support for a new time sync event
the event data contains the WiLink TSF value.
To trigger the event, a HW modification is required,
so as a supporting firmware binary.

Signed-off-by: Yaniv Machani <yanivma@ti.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Machani, Yaniv and committed by
Kalle Valo
6d5c8987 100a0083

+23 -6
+13
drivers/net/wireless/ti/wl18xx/event.c
··· 112 112 return 0; 113 113 } 114 114 115 + static void wlcore_event_time_sync(struct wl1271 *wl, u16 tsf_msb, u16 tsf_lsb) 116 + { 117 + u32 clock; 118 + /* convert the MSB+LSB to a u32 TSF value */ 119 + clock = (tsf_msb << 16) | tsf_lsb; 120 + wl1271_info("TIME_SYNC_EVENT_ID: clock %u", clock); 121 + } 122 + 115 123 int wl18xx_process_mailbox_events(struct wl1271 *wl) 116 124 { 117 125 struct wl18xx_event_mailbox *mbox = wl->mbox; ··· 135 127 if (wl->scan_wlvif) 136 128 wl18xx_scan_completed(wl, wl->scan_wlvif); 137 129 } 130 + 131 + if (vector & TIME_SYNC_EVENT_ID) 132 + wlcore_event_time_sync(wl, 133 + mbox->time_sync_tsf_msb, 134 + mbox->time_sync_tsf_lsb); 138 135 139 136 if (vector & RADAR_DETECTED_EVENT_ID) { 140 137 wl1271_info("radar event: channel %d type %s",
+8 -4
drivers/net/wireless/ti/wl18xx/event.h
··· 38 38 REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(18), 39 39 DFS_CHANNELS_CONFIG_COMPLETE_EVENT = BIT(19), 40 40 PERIODIC_SCAN_REPORT_EVENT_ID = BIT(20), 41 - SMART_CONFIG_SYNC_EVENT_ID = BIT(22), 42 - SMART_CONFIG_DECODE_EVENT_ID = BIT(23), 41 + SMART_CONFIG_SYNC_EVENT_ID = BIT(22), 42 + SMART_CONFIG_DECODE_EVENT_ID = BIT(23), 43 + TIME_SYNC_EVENT_ID = BIT(24), 43 44 }; 44 45 45 46 enum wl18xx_radar_types { ··· 96 95 /* smart config sync channel */ 97 96 u8 sc_sync_channel; 98 97 u8 sc_sync_band; 99 - u8 padding2[2]; 100 98 99 + /* time sync msb*/ 100 + u16 time_sync_tsf_msb; 101 101 /* radar detect */ 102 102 u8 radar_channel; 103 103 u8 radar_type; 104 104 105 - u8 padding3[2]; 105 + /* time sync lsb*/ 106 + u16 time_sync_tsf_lsb; 107 + 106 108 } __packed; 107 109 108 110 int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
+2 -2
drivers/net/wireless/ti/wl18xx/main.c
··· 1026 1026 CHANNEL_SWITCH_COMPLETE_EVENT_ID | 1027 1027 DFS_CHANNELS_CONFIG_COMPLETE_EVENT | 1028 1028 SMART_CONFIG_SYNC_EVENT_ID | 1029 - SMART_CONFIG_DECODE_EVENT_ID; 1030 - ; 1029 + SMART_CONFIG_DECODE_EVENT_ID | 1030 + TIME_SYNC_EVENT_ID; 1031 1031 1032 1032 wl->ap_event_mask = MAX_TX_FAILURE_EVENT_ID; 1033 1033