From 6edc119ed3b5e860535d49852f8cc8e5be95538d Mon Sep 17 00:00:00 2001 From: Bruno Herrera Date: Thu, 9 Jun 2016 21:46:46 -0300 Subject: wlcore: sdio: Fix crash on wlcore_probe_of when failing to parse/map irq pdev_data pointer is being freed with kfree but the pointer is not dynamic allocated. Signed-off-by: Bruno Herrera Signed-off-by: Kalle Valo --- drivers/net/wireless/ti/wlcore/sdio.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/net/wireless/ti') diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c index c172da56b550..5839acbbc782 100644 --- a/drivers/net/wireless/ti/wlcore/sdio.c +++ b/drivers/net/wireless/ti/wlcore/sdio.c @@ -241,7 +241,6 @@ static int wlcore_probe_of(struct device *dev, int *irq, *irq = irq_of_parse_and_map(np, 0); if (!*irq) { dev_err(dev, "No irq in platform data\n"); - kfree(pdev_data); return -EINVAL; } -- cgit v1.2.3 From 535633a5ba4ea2504fa6c33176633becf0e59339 Mon Sep 17 00:00:00 2001 From: Guy Mishol Date: Sun, 19 Jun 2016 17:08:58 +0300 Subject: wlcore: reconfigure sta rates on authorization Since stations can now be added before association (NL80211_FEATURE_FULL_AP_CLIENT_STATE support), no supported rates are set when the station is added to the fw, resulting in fw recovery. Fix it by first configuring the AP basic rates as the station configured rates (when the station is first added to the driver), and after the station was authorized re-configure it, now with the actual supported rates. Signed-off-by: Guy Mishol Signed-off-by: Kalle Valo --- drivers/net/wireless/ti/wlcore/cmd.c | 7 +++++++ drivers/net/wireless/ti/wlcore/main.c | 5 +++++ 2 files changed, 12 insertions(+) (limited to 'drivers/net/wireless/ti') diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c index 33153565ad62..5f360cecbb0b 100644 --- a/drivers/net/wireless/ti/wlcore/cmd.c +++ b/drivers/net/wireless/ti/wlcore/cmd.c @@ -1566,6 +1566,13 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif, cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates, wlvif->band)); + if (!cmd->supported_rates) { + wl1271_debug(DEBUG_CMD, + "peer has no supported rates yet, configuring basic rates: 0x%x", + wlvif->basic_rate_set); + cmd->supported_rates = cpu_to_le32(wlvif->basic_rate_set); + } + wl1271_debug(DEBUG_CMD, "new peer rates=0x%x queues=0x%x", cmd->supported_rates, sta->uapsd_queues); diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 10fd24c28ece..a53033deb3d0 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -5091,6 +5091,11 @@ static int wl12xx_update_sta_state(struct wl1271 *wl, if (ret < 0) return ret; + /* reconfigure rates */ + ret = wl12xx_cmd_add_peer(wl, wlvif, sta, wl_sta->hlid); + if (ret < 0) + return ret; + ret = wl1271_acx_set_ht_capabilities(wl, &sta->ht_cap, true, wl_sta->hlid); if (ret) -- cgit v1.2.3 From 585dfe813fa56683a90350eeb173d98da8b6be5c Mon Sep 17 00:00:00 2001 From: "Machani, Yaniv" Date: Mon, 27 Jun 2016 16:37:14 +0300 Subject: wlcore: time sync : add support for 64 bit clock Changed the configuration to support 64bit instead of 32bit this in order to offload the driver from handling a wraparound. Signed-off-by: Yaniv Machani Signed-off-by: Kalle Valo --- drivers/net/wireless/ti/wl18xx/event.c | 26 +++++++++++++++++--------- drivers/net/wireless/ti/wl18xx/event.h | 19 +++++++++++++------ 2 files changed, 30 insertions(+), 15 deletions(-) (limited to 'drivers/net/wireless/ti') diff --git a/drivers/net/wireless/ti/wl18xx/event.c b/drivers/net/wireless/ti/wl18xx/event.c index ef811848d141..2c5df43b8ed9 100644 --- a/drivers/net/wireless/ti/wl18xx/event.c +++ b/drivers/net/wireless/ti/wl18xx/event.c @@ -112,12 +112,18 @@ static int wlcore_smart_config_decode_event(struct wl1271 *wl, return 0; } -static void wlcore_event_time_sync(struct wl1271 *wl, u16 tsf_msb, u16 tsf_lsb) +static void wlcore_event_time_sync(struct wl1271 *wl, + u16 tsf_high_msb, u16 tsf_high_lsb, + u16 tsf_low_msb, u16 tsf_low_lsb) { - u32 clock; - /* convert the MSB+LSB to a u32 TSF value */ - clock = (tsf_msb << 16) | tsf_lsb; - wl1271_info("TIME_SYNC_EVENT_ID: clock %u", clock); + u32 clock_low; + u32 clock_high; + + clock_high = (tsf_high_msb << 16) | tsf_high_lsb; + clock_low = (tsf_low_msb << 16) | tsf_low_lsb; + + wl1271_info("TIME_SYNC_EVENT_ID: clock_high %u, clock low %u", + clock_high, clock_low); } int wl18xx_process_mailbox_events(struct wl1271 *wl) @@ -138,8 +144,10 @@ int wl18xx_process_mailbox_events(struct wl1271 *wl) if (vector & TIME_SYNC_EVENT_ID) wlcore_event_time_sync(wl, - mbox->time_sync_tsf_msb, - mbox->time_sync_tsf_lsb); + mbox->time_sync_tsf_high_msb, + mbox->time_sync_tsf_high_lsb, + mbox->time_sync_tsf_low_msb, + mbox->time_sync_tsf_low_lsb); if (vector & RADAR_DETECTED_EVENT_ID) { wl1271_info("radar event: channel %d type %s", @@ -187,11 +195,11 @@ int wl18xx_process_mailbox_events(struct wl1271 *wl) */ if (vector & MAX_TX_FAILURE_EVENT_ID) wlcore_event_max_tx_failure(wl, - le32_to_cpu(mbox->tx_retry_exceeded_bitmap)); + le16_to_cpu(mbox->tx_retry_exceeded_bitmap)); if (vector & INACTIVE_STA_EVENT_ID) wlcore_event_inactive_sta(wl, - le32_to_cpu(mbox->inactive_sta_bitmap)); + le16_to_cpu(mbox->inactive_sta_bitmap)); if (vector & REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID) wlcore_event_roc_complete(wl); diff --git a/drivers/net/wireless/ti/wl18xx/event.h b/drivers/net/wireless/ti/wl18xx/event.h index 070de1274694..ce8ea9c04052 100644 --- a/drivers/net/wireless/ti/wl18xx/event.h +++ b/drivers/net/wireless/ti/wl18xx/event.h @@ -74,10 +74,16 @@ struct wl18xx_event_mailbox { __le16 bss_loss_bitmap; /* bitmap of stations (by HLID) which exceeded max tx retries */ - __le32 tx_retry_exceeded_bitmap; + __le16 tx_retry_exceeded_bitmap; + + /* time sync high msb*/ + __le16 time_sync_tsf_high_msb; /* bitmap of inactive stations (by HLID) */ - __le32 inactive_sta_bitmap; + __le16 inactive_sta_bitmap; + + /* time sync high lsb*/ + __le16 time_sync_tsf_high_lsb; /* rx BA win size indicated by RX_BA_WIN_SIZE_CHANGE_EVENT_ID */ u8 rx_ba_role_id; @@ -98,14 +104,15 @@ struct wl18xx_event_mailbox { u8 sc_sync_channel; u8 sc_sync_band; - /* time sync msb*/ - u16 time_sync_tsf_msb; + /* time sync low msb*/ + __le16 time_sync_tsf_low_msb; + /* radar detect */ u8 radar_channel; u8 radar_type; - /* time sync lsb*/ - u16 time_sync_tsf_lsb; + /* time sync low lsb*/ + __le16 time_sync_tsf_low_lsb; } __packed; -- cgit v1.2.3