The driver was dereferencing a NULL pointer because of the device instance
being registered via the set_wiphy_dev() function. The function
ar6000_avail_ev() was passing the argument as NULL instead of using the one
returned by the MMC stack through the probe callback.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
index 26dafc9..4f6ddf7 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -1604,6 +1604,14 @@ ar6000_avail_ev(void *context, void *hif_handle)
struct wireless_dev *wdev;
#endif /* ATH6K_CONFIG_CFG80211 */
int init_status = 0;
+ HIF_DEVICE_OS_DEVICE_INFO osDevInfo;
+
+ memset(&osDevInfo, 0, sizeof(osDevInfo));
+ if (HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_OS_DEVICE,
+ &osDevInfo, sizeof(osDevInfo))) {
+ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("%s: Failed to get OS device instance\n", __func__));
+ return A_ERROR;
+ }
AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("ar6000_available\n"));
@@ -1623,7 +1631,7 @@ ar6000_avail_ev(void *context, void *hif_handle)
device_index = i;
#ifdef ATH6K_CONFIG_CFG80211
- wdev = ar6k_cfg80211_init(NULL);
+ wdev = ar6k_cfg80211_init(osDevInfo.pOSDevice);
if (IS_ERR(wdev)) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: ar6k_cfg80211_init failed\n", __func__));
return A_ERROR;
@@ -1668,12 +1676,7 @@ ar6000_avail_ev(void *context, void *hif_handle)
#ifdef SET_NETDEV_DEV
if (ar_netif) {
- HIF_DEVICE_OS_DEVICE_INFO osDevInfo;
- A_MEMZERO(&osDevInfo, sizeof(osDevInfo));
- if (!HIFConfigureDevice(hif_handle, HIF_DEVICE_GET_OS_DEVICE,
- &osDevInfo, sizeof(osDevInfo))) {
- SET_NETDEV_DEV(dev, osDevInfo.pOSDevice);
- }
+ SET_NETDEV_DEV(dev, osDevInfo.pOSDevice);
}
#endif
--
1.6.3.3
When jiffies wrap-over, all the BSS in the cache is removed. Wrap-over of
jiffies is not handled in the correct way. This cause the scan list to go
empty during this time for a small duration
Signed-off-by: Vipin Mehta <[email protected]>
---
.../staging/ath6kl/os/linux/include/osapi_linux.h | 2 +-
drivers/staging/ath6kl/wlan/src/wlan_node.c | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/include/osapi_linux.h b/drivers/staging/ath6kl/os/linux/include/osapi_linux.h
index eb09d43..1957de0 100644
--- a/drivers/staging/ath6kl/os/linux/include/osapi_linux.h
+++ b/drivers/staging/ath6kl/os/linux/include/osapi_linux.h
@@ -121,7 +121,7 @@ typedef spinlock_t A_MUTEX_T;
/* Get current time in ms adding a constant offset (in ms) */
#define A_GET_MS(offset) \
- (jiffies + ((offset) / 1000) * HZ)
+ (((jiffies / HZ) * 1000) + (offset))
/*
* Timer Functions
diff --git a/drivers/staging/ath6kl/wlan/src/wlan_node.c b/drivers/staging/ath6kl/wlan/src/wlan_node.c
index 996b36d..d61cb6e 100644
--- a/drivers/staging/ath6kl/wlan/src/wlan_node.c
+++ b/drivers/staging/ath6kl/wlan/src/wlan_node.c
@@ -122,7 +122,7 @@ wlan_setup_node(struct ieee80211_node_table *nt, bss_t *ni,
timeoutValue = nt->nt_nodeAge;
- ni->ni_tstamp = A_GET_MS (timeoutValue);
+ ni->ni_tstamp = A_GET_MS (0);
ni->ni_actcnt = WLAN_NODE_INACT_CNT;
IEEE80211_NODE_LOCK_BH(nt);
@@ -360,7 +360,7 @@ wlan_refresh_inactive_nodes (struct ieee80211_node_table *nt)
if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0)
{
- if (bss->ni_tstamp <= now || --bss->ni_actcnt == 0)
+ if (((now - bss->ni_tstamp) > timeoutValue) || --bss->ni_actcnt == 0)
{
/*
* free up all but the current bss - if set
@@ -381,6 +381,7 @@ wlan_node_timeout (A_ATH_TIMER arg)
bss_t *bss, *nextBss;
u8 myBssid[IEEE80211_ADDR_LEN], reArmTimer = false;
u32 timeoutValue = 0;
+ u32 now = A_GET_MS(0);
timeoutValue = nt->nt_nodeAge;
@@ -393,7 +394,7 @@ wlan_node_timeout (A_ATH_TIMER arg)
if (A_MEMCMP(myBssid, bss->ni_macaddr, sizeof(myBssid)) != 0)
{
- if (bss->ni_tstamp <= A_GET_MS(0))
+ if ((now - bss->ni_tstamp) > timeoutValue)
{
/*
* free up all but the current bss - if set
--
1.6.3.3
On Fri, Feb 18, 2011 at 01:56:40PM -0800, Joe Perches wrote:
> On Fri, 2011-02-18 at 13:29 -0800, Greg KH wrote:
> > On Fri, Feb 18, 2011 at 01:13:02PM -0800, Vipin Mehta wrote:
> > > The driver was dereferencing a NULL pointer because of the device instance
> > > being registered via the set_wiphy_dev() function. The function
> > > ar6000_avail_ev() was passing the argument as NULL instead of using the one
> > > returned by the MMC stack through the probe callback.
> > I've applied all of these, but note that some of them add whitespace
> > warnings. In the future, I'll reject those that do this, please always
> > run your patches through scripts/checkpatch.pl to not have this happen.
>
> Vipin,
>
> A good test is to generate the patches using git format-patch
> then apply them to a new, separate branch using git am.
> Whitespace problems will cause rejects.
>
> You can use git am --whitespace=fix on each patch if necessary,
> then regenerate the git format-patch set from that new branch.
>
> cheers, Joe
>
Got it. Shall do that for subsequent patches.
On Fri, 2011-02-18 at 13:29 -0800, Greg KH wrote:
> On Fri, Feb 18, 2011 at 01:13:02PM -0800, Vipin Mehta wrote:
> > The driver was dereferencing a NULL pointer because of the device instance
> > being registered via the set_wiphy_dev() function. The function
> > ar6000_avail_ev() was passing the argument as NULL instead of using the one
> > returned by the MMC stack through the probe callback.
> I've applied all of these, but note that some of them add whitespace
> warnings. In the future, I'll reject those that do this, please always
> run your patches through scripts/checkpatch.pl to not have this happen.
Vipin,
A good test is to generate the patches using git format-patch
then apply them to a new, separate branch using git am.
Whitespace problems will cause rejects.
You can use git am --whitespace=fix on each patch if necessary,
then regenerate the git format-patch set from that new branch.
cheers, Joe
Fixing the driver initialization for manufacturing mode that involves
downloading a firmware binary meant for RF tests on the factory floor.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
index df9badb..d907e93 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -1806,7 +1806,9 @@ ar6000_avail_ev(void *context, void *hif_handle)
break;
}
#ifdef HTC_RAW_INTERFACE
- break; /* Don't call ar6000_init for ART */
+ if (!eppingtest && bypasswmi) {
+ break; /* Don't call ar6000_init for ART */
+ }
#endif
rtnl_lock();
status = (ar6000_init(dev)==0) ? 0 : A_ERROR;
--
1.6.3.3
There are style issues with almost all the patches in this series.
Please read Documentation/CodingStyle and run checkpatch.pl on
your patches before sending.
On Fri, Feb 18, 2011 at 01:13:11PM -0800, Vipin Mehta wrote:
> +static int
> +ar6000_xioctl_set_excess_tx_retry_thres_cmd(struct net_device * dev, char * userdata)
> +{
> + AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(dev);
^^^^
White space not needed here.
Better to declare this as:
struct ar6_softc *ar = (struct ar6_softc *)ar6k_priv(dev);
> + WMI_SET_EXCESS_TX_RETRY_THRES_CMD cmd;
> + int ret = 0;
> +
> + if (ar->arWmiReady == false) {
> + return -EIO;
> + }
No curly braces needed.
> +
> + if (copy_from_user(&cmd, userdata, sizeof(cmd))) {
> + return -EFAULT;
> + }
No curly braces needed.
> +
> + if (wmi_set_excess_tx_retry_thres_cmd(ar->arWmi, &cmd) != 0)
^^^^^
Not needed.
> + {
Curly braces on the wrong line.
Curly braces were not needed.
> + ret = -EINVAL;
Just return -EINVAL directly.
> + }
> + return(ret);
^ ^
Parentheses not needed.
Just return 0 directly.
> +}
Please you tabs to indent on new functions. If the code is inside an
existing function then be consistent, but if it's a new function then
use tabs.
regards,
dan carpenter
Adding host side interface to configure the excessive TX retry threshold.
It is used by the target to determine disconnection triggers. Additionally,
some definitions have been added to header file wmi.h to bridge the gap
for the newly added command.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/include/common/wmi.h | 36 ++++++++++++++------
drivers/staging/ath6kl/include/wmi_api.h | 3 ++
.../staging/ath6kl/os/linux/include/athdrv_linux.h | 1 +
.../ath6kl/os/linux/include/wmi_filter_linux.h | 7 ++++
drivers/staging/ath6kl/os/linux/ioctl.c | 28 +++++++++++++++
drivers/staging/ath6kl/wmi/wmi.c | 21 +++++++++++
6 files changed, 85 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/ath6kl/include/common/wmi.h b/drivers/staging/ath6kl/include/common/wmi.h
index f16ef28..a8b143a 100644
--- a/drivers/staging/ath6kl/include/common/wmi.h
+++ b/drivers/staging/ath6kl/include/common/wmi.h
@@ -422,17 +422,24 @@ typedef enum {
WMI_AP_SET_11BG_RATESET_CMDID,
WMI_SET_PMK_CMDID,
WMI_MCAST_FILTER_CMDID,
- /* COEX CMDID AR6003*/
- WMI_SET_BTCOEX_FE_ANT_CMDID,
- WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID,
- WMI_SET_BTCOEX_SCO_CONFIG_CMDID,
- WMI_SET_BTCOEX_A2DP_CONFIG_CMDID,
- WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID,
- WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID,
- WMI_SET_BTCOEX_DEBUG_CMDID,
- WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID,
- WMI_GET_BTCOEX_STATS_CMDID,
- WMI_GET_BTCOEX_CONFIG_CMDID,
+ /* COEX CMDID AR6003*/
+ WMI_SET_BTCOEX_FE_ANT_CMDID,
+ WMI_SET_BTCOEX_COLOCATED_BT_DEV_CMDID,
+ WMI_SET_BTCOEX_SCO_CONFIG_CMDID,
+ WMI_SET_BTCOEX_A2DP_CONFIG_CMDID,
+ WMI_SET_BTCOEX_ACLCOEX_CONFIG_CMDID,
+ WMI_SET_BTCOEX_BTINQUIRY_PAGE_CONFIG_CMDID,
+ WMI_SET_BTCOEX_DEBUG_CMDID,
+ WMI_SET_BTCOEX_BT_OPERATING_STATUS_CMDID,
+ WMI_GET_BTCOEX_STATS_CMDID,
+ WMI_GET_BTCOEX_CONFIG_CMDID,
+ WMI_GET_PMK_CMDID,
+ WMI_SET_PASSPHRASE_CMDID,
+ WMI_ENABLE_WAC_CMDID,
+ WMI_WAC_SCAN_REPLY_CMDID,
+ WMI_WAC_CTRL_REQ_CMDID,
+ WMI_SET_DIV_PARAMS_CMDID,
+ WMI_SET_EXCESS_TX_RETRY_THRES_CMDID,
} WMI_COMMAND_ID;
/*
@@ -550,6 +557,13 @@ typedef PREPACK struct {
} POSTPACK WMI_SET_PMK_CMD;
/*
+ * WMI_SET_EXCESS_TX_RETRY_THRES_CMDID
+ */
+typedef PREPACK struct {
+ A_UINT32 threshold;
+} POSTPACK WMI_SET_EXCESS_TX_RETRY_THRES_CMD;
+
+/*
* WMI_ADD_CIPHER_KEY_CMDID
*/
typedef enum {
diff --git a/drivers/staging/ath6kl/include/wmi_api.h b/drivers/staging/ath6kl/include/wmi_api.h
index e51440a..7ba8505 100644
--- a/drivers/staging/ath6kl/include/wmi_api.h
+++ b/drivers/staging/ath6kl/include/wmi_api.h
@@ -421,6 +421,9 @@ wmi_set_wlan_conn_precedence_cmd(struct wmi_t *wmip, BT_WLAN_CONN_PRECEDENCE pre
int
wmi_set_pmk_cmd(struct wmi_t *wmip, u8 *pmk);
+int
+wmi_set_excess_tx_retry_thres_cmd(struct wmi_t *wmip, WMI_SET_EXCESS_TX_RETRY_THRES_CMD *cmd);
+
u16 wmi_ieee2freq (int chan);
u32 wmi_freq2ieee (u16 freq);
diff --git a/drivers/staging/ath6kl/os/linux/include/athdrv_linux.h b/drivers/staging/ath6kl/os/linux/include/athdrv_linux.h
index 383571a..5a6c27e 100644
--- a/drivers/staging/ath6kl/os/linux/include/athdrv_linux.h
+++ b/drivers/staging/ath6kl/os/linux/include/athdrv_linux.h
@@ -997,6 +997,7 @@ typedef enum {
#define AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM 154
+#define AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES 161
/* used by AR6000_IOCTL_WMI_GETREV */
struct ar6000_version {
diff --git a/drivers/staging/ath6kl/os/linux/include/wmi_filter_linux.h b/drivers/staging/ath6kl/os/linux/include/wmi_filter_linux.h
index 0652c69..d172625 100644
--- a/drivers/staging/ath6kl/os/linux/include/wmi_filter_linux.h
+++ b/drivers/staging/ath6kl/os/linux/include/wmi_filter_linux.h
@@ -288,6 +288,13 @@ u8 xioctl_filter[] = {
(0xFF), /* AR6000_XIOCTL_ADD_AP_INTERFACE 152 */
(0xFF), /* AR6000_XIOCTL_REMOVE_AP_INTERFACE 153 */
(0xFF), /* AR6000_XIOCTL_WMI_SET_TX_SGI_PARAM 154 */
+(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_WPA_OFFLOAD_STATE 155 */
+(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_PASSPHRASE 156 */
+(0xFF),
+(0xFF),
+(0xFF),
+(0xFF),
+(INFRA_NETWORK | ADHOC_NETWORK), /* AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES 161 */
};
#endif /*_WMI_FILTER_LINUX_H_*/
diff --git a/drivers/staging/ath6kl/os/linux/ioctl.c b/drivers/staging/ath6kl/os/linux/ioctl.c
index 5be8ea3..fe275c7 100644
--- a/drivers/staging/ath6kl/os/linux/ioctl.c
+++ b/drivers/staging/ath6kl/os/linux/ioctl.c
@@ -1329,6 +1329,28 @@ ar6000_xioctl_get_btcoex_stats_cmd(struct net_device * dev, char *userdata, stru
return(ret);
}
+static int
+ar6000_xioctl_set_excess_tx_retry_thres_cmd(struct net_device * dev, char * userdata)
+{
+ AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(dev);
+ WMI_SET_EXCESS_TX_RETRY_THRES_CMD cmd;
+ int ret = 0;
+
+ if (ar->arWmiReady == false) {
+ return -EIO;
+ }
+
+ if (copy_from_user(&cmd, userdata, sizeof(cmd))) {
+ return -EFAULT;
+ }
+
+ if (wmi_set_excess_tx_retry_thres_cmd(ar->arWmi, &cmd) != 0)
+ {
+ ret = -EINVAL;
+ }
+ return(ret);
+}
+
#ifdef CONFIG_HOST_GPIO_SUPPORT
struct ar6000_gpio_intr_wait_cmd_s gpio_intr_results;
/* gpio_reg_results and gpio_data_available are protected by arSem */
@@ -4660,6 +4682,12 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
#endif
break;
+ case AR6000_XIOCTL_WMI_SET_EXCESS_TX_RETRY_THRES:
+ {
+ ret = ar6000_xioctl_set_excess_tx_retry_thres_cmd(dev, userdata);
+ break;
+ }
+
default:
ret = -EOPNOTSUPP;
}
diff --git a/drivers/staging/ath6kl/wmi/wmi.c b/drivers/staging/ath6kl/wmi/wmi.c
index 242e855..acbf6ed 100644
--- a/drivers/staging/ath6kl/wmi/wmi.c
+++ b/drivers/staging/ath6kl/wmi/wmi.c
@@ -6610,6 +6610,27 @@ wmi_set_pmk_cmd(struct wmi_t *wmip, u8 *pmk)
}
int
+wmi_set_excess_tx_retry_thres_cmd(struct wmi_t *wmip, WMI_SET_EXCESS_TX_RETRY_THRES_CMD *cmd)
+{
+ void *osbuf;
+ WMI_SET_EXCESS_TX_RETRY_THRES_CMD *p;
+
+ osbuf = A_NETBUF_ALLOC(sizeof(WMI_SET_EXCESS_TX_RETRY_THRES_CMD));
+ if (osbuf == NULL) {
+ return A_NO_MEMORY;
+ }
+
+ A_NETBUF_PUT(osbuf, sizeof(WMI_SET_EXCESS_TX_RETRY_THRES_CMD));
+
+ p = (WMI_SET_EXCESS_TX_RETRY_THRES_CMD *)(A_NETBUF_DATA(osbuf));
+ memset(p, 0, sizeof(*p));
+
+ p->threshold = cmd->threshold;
+
+ return (wmi_cmd_send(wmip, osbuf, WMI_SET_EXCESS_TX_RETRY_THRES_CMDID, NO_SYNC_WMIFLAG));
+}
+
+int
wmi_SGI_cmd(struct wmi_t *wmip, u32 sgiMask, u8 sgiPERThreshold)
{
void *osbuf;
--
1.6.3.3
Fixing the cached copy of the BSS filter set by user.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/os/linux/ioctl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/ioctl.c b/drivers/staging/ath6kl/os/linux/ioctl.c
index fe275c7..6d15d2d 100644
--- a/drivers/staging/ath6kl/os/linux/ioctl.c
+++ b/drivers/staging/ath6kl/os/linux/ioctl.c
@@ -2590,7 +2590,7 @@ int ar6000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
!= 0) {
ret = -EIO;
} else {
- ar->arUserBssFilter = param;
+ ar->arUserBssFilter = filt.bssFilter;
}
}
break;
--
1.6.3.3
Adding compile time support for enabling/disabling txop bursting.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 7 +++++++
.../staging/ath6kl/os/linux/include/wlan_config.h | 7 +++++++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
index b69280d..f084a92 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -2528,6 +2528,13 @@ int ar6000_target_config_wlan_params(AR_SOFTC_T *ar)
status = A_ERROR;
}
+#if WLAN_CONFIG_DISABLE_TX_BURSTING
+ if ((wmi_set_wmm_txop(ar->arWmi, WMI_TXOP_DISABLED)) != 0) {
+ AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Unable to set txop bursting \n"));
+ status = A_ERROR;
+ }
+#endif
+
return status;
}
diff --git a/drivers/staging/ath6kl/os/linux/include/wlan_config.h b/drivers/staging/ath6kl/os/linux/include/wlan_config.h
index f7d0487..2de5cef 100644
--- a/drivers/staging/ath6kl/os/linux/include/wlan_config.h
+++ b/drivers/staging/ath6kl/os/linux/include/wlan_config.h
@@ -103,6 +103,13 @@
#define WLAN_CONFIG_PM_WOW2 0
/*
+ * This configuration item enables/disables transmit bursting
+ * 0 - Enable tx Bursting (default)
+ * 1 - Disable tx bursting
+ */
+#define WLAN_CONFIG_DISABLE_TX_BURSTING 0
+
+/*
* Platform specific function to power ON/OFF AR6000
* and enable/disable SDIO card detection
*/
--
1.6.3.3
Return correct scan complete status to the cfg80211 module based on
the value returned from the hardware.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/os/linux/cfg80211.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/cfg80211.c b/drivers/staging/ath6kl/os/linux/cfg80211.c
index b7742d4..bc5f6a7 100644
--- a/drivers/staging/ath6kl/os/linux/cfg80211.c
+++ b/drivers/staging/ath6kl/os/linux/cfg80211.c
@@ -791,7 +791,7 @@ ar6k_cfg80211_scanComplete_event(AR_SOFTC_T *ar, int status)
wmi_iterate_nodes(ar->arWmi, ar6k_cfg80211_scan_node, ar->wdev->wiphy);
cfg80211_scan_done(ar->scan_request,
- (status & A_ECANCELED) ? true : false);
+ ((status & A_ECANCELED) || (status & A_EBUSY)) ? true : false);
if(ar->scan_request->n_ssids &&
ar->scan_request->ssids[0].ssid_len) {
--
1.6.3.3
A bug was observed during the reconnection phase in the WPA/WPA2-PSK scenario
where the EAPOL frames were going encrypted during an auto reconnection
attempt. The initial 4-way handshake would go fine but then the driver
was getting a command to set default keys sometime later. Setting of an
incorrect flag (TX_USAGE) in the hadrware was causing the EAPOL frames during
the subsequent 4-way handshake attempts to go encrypted causing the AP to
reject the station.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/os/linux/cfg80211.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/cfg80211.c b/drivers/staging/ath6kl/os/linux/cfg80211.c
index 1a4e315..b7742d4 100644
--- a/drivers/staging/ath6kl/os/linux/cfg80211.c
+++ b/drivers/staging/ath6kl/os/linux/cfg80211.c
@@ -983,6 +983,7 @@ ar6k_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *ndev,
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(ndev);
struct ar_key *key = NULL;
int status = 0;
+ u8 key_usage;
AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: index %d\n", __func__, key_index));
@@ -1011,8 +1012,13 @@ ar6k_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *ndev,
ar->arDefTxKeyIndex = key_index;
key = &ar->keys[ar->arDefTxKeyIndex];
+ key_usage = GROUP_USAGE;
+ if (WEP_CRYPT == ar->arPairwiseCrypto) {
+ key_usage |= TX_USAGE;
+ }
+
status = wmi_addKey_cmd(ar->arWmi, ar->arDefTxKeyIndex,
- ar->arPairwiseCrypto, GROUP_USAGE | TX_USAGE,
+ ar->arPairwiseCrypto, key_usage,
key->key_len, key->seq, key->key, KEY_OP_INIT_VAL,
NULL, SYNC_BOTH_WMIFLAG);
if (status) {
--
1.6.3.3
On Fri, Feb 18, 2011 at 01:13:02PM -0800, Vipin Mehta wrote:
> The driver was dereferencing a NULL pointer because of the device instance
> being registered via the set_wiphy_dev() function. The function
> ar6000_avail_ev() was passing the argument as NULL instead of using the one
> returned by the MMC stack through the probe callback.
I've applied all of these, but note that some of them add whitespace
warnings. In the future, I'll reject those that do this, please always
run your patches through scripts/checkpatch.pl to not have this happen.
thanks,
greg k-h
Virtual Scatter Gather Lists not getting freed during the HTCStop(). The
patch adds some clean up code in the code path.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/htc2/AR6000/ar6k.c | 9 +++++++++
drivers/staging/ath6kl/htc2/AR6000/ar6k.h | 2 ++
drivers/staging/ath6kl/htc2/htc.c | 2 ++
3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/ath6kl/htc2/AR6000/ar6k.c b/drivers/staging/ath6kl/htc2/AR6000/ar6k.c
index 6083231..ff0480b 100644
--- a/drivers/staging/ath6kl/htc2/AR6000/ar6k.c
+++ b/drivers/staging/ath6kl/htc2/AR6000/ar6k.c
@@ -810,6 +810,15 @@ static int DevSetupVirtualScatterSupport(AR6K_DEVICE *pDev)
return status;
}
+int DevCleanupMsgBundling(AR6K_DEVICE *pDev)
+{
+ if(NULL != pDev)
+ {
+ DevCleanupVirtualScatterSupport(pDev);
+ }
+
+ return 0;
+}
int DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer)
{
diff --git a/drivers/staging/ath6kl/htc2/AR6000/ar6k.h b/drivers/staging/ath6kl/htc2/AR6000/ar6k.h
index d3b6b30..19d8e70 100644
--- a/drivers/staging/ath6kl/htc2/AR6000/ar6k.h
+++ b/drivers/staging/ath6kl/htc2/AR6000/ar6k.h
@@ -297,6 +297,8 @@ static INLINE int DEV_PREPARE_SCATTER_OPERATION(HIF_SCATTER_REQ *pReq) {
int DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer);
+
+int DevCleanupMsgBundling(AR6K_DEVICE *pDev);
#define DEV_GET_MAX_MSG_PER_BUNDLE(pDev) (pDev)->HifScatterInfo.MaxScatterEntries
#define DEV_GET_MAX_BUNDLE_LENGTH(pDev) (pDev)->HifScatterInfo.MaxTransferSizePerScatterReq
diff --git a/drivers/staging/ath6kl/htc2/htc.c b/drivers/staging/ath6kl/htc2/htc.c
index 684eca9..e7adc45 100644
--- a/drivers/staging/ath6kl/htc2/htc.c
+++ b/drivers/staging/ath6kl/htc2/htc.c
@@ -486,6 +486,8 @@ void HTCStop(HTC_HANDLE HTCHandle)
/* flush all recv buffers */
HTCFlushRecvBuffers(target);
+ DevCleanupMsgBundling(&target->Device);
+
ResetEndpointStates(target);
AR_DEBUG_PRINTF(ATH_DEBUG_TRC, ("-HTCStop \n"));
--
1.6.3.3
Adding state in driver to track the sme state. The connect/disconnect
events from the driver were messing up the state maintained within the
cfg80211 module.
Signed-off-by: Vipin Mehta <[email protected]>
---
drivers/staging/ath6kl/os/linux/ar6000_drv.c | 1 +
drivers/staging/ath6kl/os/linux/cfg80211.c | 28 ++++++++++++++-----
.../staging/ath6kl/os/linux/include/ar6000_drv.h | 7 +++++
3 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
index 93592af..5dc5cf0 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -1670,6 +1670,7 @@ ar6000_avail_ev(void *context, void *hif_handle)
SET_NETDEV_DEV(dev, wiphy_dev(wdev->wiphy));
wdev->netdev = dev;
ar->arNetworkType = INFRA_NETWORK;
+ ar->smeState = SME_DISCONNECTED;
#endif /* ATH6K_CONFIG_CFG80211 */
init_netdev(dev, ifname);
diff --git a/drivers/staging/ath6kl/os/linux/cfg80211.c b/drivers/staging/ath6kl/os/linux/cfg80211.c
index 0f8f868..8644d19 100644
--- a/drivers/staging/ath6kl/os/linux/cfg80211.c
+++ b/drivers/staging/ath6kl/os/linux/cfg80211.c
@@ -248,6 +248,7 @@ ar6k_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
int status;
AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: \n", __func__));
+ ar->smeState = SME_CONNECTING;
if(ar->arWmiReady == false) {
AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready yet\n", __func__));
@@ -562,6 +563,7 @@ ar6k_cfg80211_connect_event(AR_SOFTC_T *ar, u16 channel,
if (false == ar->arConnected) {
/* inform connect result to cfg80211 */
+ ar->smeState = SME_DISCONNECTED;
cfg80211_connect_result(ar->arNetDev, bssid,
assocReqIe, assocReqLen,
assocRespIe, assocRespLen,
@@ -644,18 +646,28 @@ ar6k_cfg80211_disconnect_event(AR_SOFTC_T *ar, u8 reason,
}
}
- if(false == ar->arConnected) {
+ if(true == ar->arConnectPending) {
if(NO_NETWORK_AVAIL == reason) {
/* connect cmd failed */
- cfg80211_connect_result(ar->arNetDev, bssid,
- NULL, 0,
- NULL, 0,
- WLAN_STATUS_UNSPECIFIED_FAILURE,
- GFP_KERNEL);
+ wmi_disconnect_cmd(ar->arWmi);
+ } else if (reason == DISCONNECT_CMD) {
+ /* connection loss due to disconnect cmd or low rssi */
+ ar->arConnectPending = false;
+ if (ar->smeState == SME_CONNECTING) {
+ cfg80211_connect_result(ar->arNetDev, bssid,
+ NULL, 0,
+ NULL, 0,
+ WLAN_STATUS_UNSPECIFIED_FAILURE,
+ GFP_KERNEL);
+ } else {
+ cfg80211_disconnected(ar->arNetDev, reason, NULL, 0, GFP_KERNEL);
+ }
+ ar->smeState = SME_DISCONNECTED;
}
} else {
- /* connection loss due to disconnect cmd or low rssi */
- cfg80211_disconnected(ar->arNetDev, reason, NULL, 0, GFP_KERNEL);
+ if (reason != DISCONNECT_CMD) {
+ wmi_disconnect_cmd(ar->arWmi);
+ }
}
}
diff --git a/drivers/staging/ath6kl/os/linux/include/ar6000_drv.h b/drivers/staging/ath6kl/os/linux/include/ar6000_drv.h
index 339925a..f3b7344 100644
--- a/drivers/staging/ath6kl/os/linux/include/ar6000_drv.h
+++ b/drivers/staging/ath6kl/os/linux/include/ar6000_drv.h
@@ -393,6 +393,12 @@ struct ar_key {
u8 seq_len;
u32 cipher;
};
+
+enum {
+ SME_DISCONNECTED,
+ SME_CONNECTING,
+ SME_CONNECTED
+};
#endif /* ATH6K_CONFIG_CFG80211 */
@@ -595,6 +601,7 @@ typedef struct ar6_softc {
struct wireless_dev *wdev;
struct cfg80211_scan_request *scan_request;
struct ar_key keys[WMI_MAX_KEY_INDEX + 1];
+ u32 smeState;
#endif /* ATH6K_CONFIG_CFG80211 */
u16 arWlanPowerState;
bool arWlanOff;
--
1.6.3.3