From 064827edf6901e5fcbd84fc258fb2326a530da9c Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Thu, 24 May 2007 23:37:28 -0400 Subject: [PATCH] libertas: scan two channels per scan command Scan two channels per each command on set_scan(), then bail out and let get_scan() continue the scanning work up to the last channel. This gives time to the firmware so it can go back to the association channel and keep the connection alive. Fixes http://dev.laptop.org/ticket/841 Signed-off-by: Marcelo Tosatti Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index e8b9020f9bd6..0dc4fc3b0b23 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -396,6 +396,8 @@ struct _wlan_adapter { u32 radiomode; u32 debugmode; u8 fw_ready; + + u8 last_scanned_channel; }; #endif /* _WLAN_DEV_H_ */ -- cgit v1.2.2 From 0601e7ee463f2736586de9a24025f8791db7f5a8 Mon Sep 17 00:00:00 2001 From: Javier Cardona Date: Fri, 25 May 2007 12:12:06 -0400 Subject: [PATCH] libertas: added transmission failures to mesh statistics Added transmission failures to mesh statistics. Removed whitespace before newlines. Signed-off-by: Javier Cardona Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 0dc4fc3b0b23..d7673c91f480 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -123,6 +123,7 @@ struct wlan_mesh_stats { u32 fwd_drop_noroute; /* Fwd: No route to Destination */ u32 fwd_drop_nobuf; /* Fwd: Run out of internal buffers */ u32 drop_blind; /* Rx: Dropped by blinding table */ + u32 tx_failed_cnt; /* Tx: Failed transmissions */ }; /** Private structure for the MV device */ -- cgit v1.2.2 From 208fdd2f447899164bd139452c291b155e53cee9 Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Fri, 25 May 2007 12:17:06 -0400 Subject: [PATCH] libertas: indirect all hardware access via hw_XXXX functions This functions makes all libertas_sbi_XXX functions static to the if_usb.c file and renames them to if_usb_XXXX(). The get called from other places of the source code via priv->hw_XXXX(). Signed-off-by: Holger Schurig Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index d7673c91f480..32e2077617bb 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -162,6 +162,14 @@ struct _wlan_private { struct delayed_work assoc_work; struct workqueue_struct *assoc_thread; + + /** Hardware access */ + int (*hw_register_dev) (wlan_private * priv); + int (*hw_unregister_dev) (wlan_private *); + int (*hw_prog_firmware) (wlan_private *); + int (*hw_host_to_card) (wlan_private * priv, u8 type, u8 * payload, u16 nb); + int (*hw_get_int_status) (wlan_private * priv, u8 *); + int (*hw_read_event_cause) (wlan_private *); }; /** Association request -- cgit v1.2.2 From 634b8f49c11f49272b09d13a34b22a17b8c3d419 Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Fri, 25 May 2007 13:05:16 -0400 Subject: [PATCH] libertas: remove unused variables in wlan_dev_t Actually, this patch removev wlan_dev_t totally and puts the used variables of it directly into wlan_private. That reduces one level of indirection and looks a little bit simpler. It's now "priv->card" and not "priv->wlan_dev.card" and "priv->dev" instead of "priv->wlan_dev.netdev" Changed two occurences of "((wlan_private *) dev->priv)->wlan_dev.netdev" into "dev", because I didn't see the point in doing pointer-ping-pong. The variables "ioport", "upld_rcv" and "upld_type" where unused. They have been removed. Signed-off-by: Holger Schurig Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 40 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 26 deletions(-) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 32e2077617bb..c43aa10f1a8b 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -89,31 +89,6 @@ struct sleep_params { u16 sp_reserved; }; -/** Data structure for the Marvell WLAN device */ -typedef struct _wlan_dev { - /** device name */ - char name[DEV_NAME_LEN]; - /** card pointer */ - void *card; - /** IO port */ - u32 ioport; - /** Upload received */ - u32 upld_rcv; - /** Upload type */ - u32 upld_typ; - /** Upload length */ - u32 upld_len; - /** netdev pointer */ - struct net_device *netdev; - /* Upload buffer */ - u8 upld_buf[WLAN_UPLD_SIZE]; - /* Download sent: - bit0 1/0=data_sent/data_tx_done, - bit1 1/0=cmd_sent/cmd_tx_done, - all other bits reserved 0 */ - u8 dnld_sent; -} wlan_dev_t, *pwlan_dev_t; - /* Mesh statistics */ struct wlan_mesh_stats { u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */ @@ -132,8 +107,11 @@ struct _wlan_private { int mesh_open; int infra_open; + char name[DEV_NAME_LEN]; + + void *card; wlan_adapter *adapter; - wlan_dev_t wlan_dev; + struct net_device *dev; struct net_device_stats stats; struct net_device *mesh_dev ; /* Virtual device */ @@ -154,6 +132,16 @@ struct _wlan_private { u32 bbp_offset; u32 rf_offset; + /** Upload length */ + u32 upld_len; + /* Upload buffer */ + u8 upld_buf[WLAN_UPLD_SIZE]; + /* Download sent: + bit0 1/0=data_sent/data_tx_done, + bit1 1/0=cmd_sent/cmd_tx_done, + all other bits reserved 0 */ + u8 dnld_sent; + const struct firmware *firmware; struct device *hotplug_device; -- cgit v1.2.2 From fcdb53dbc743f288bf72e485fefb3a967b733686 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 May 2007 16:15:56 -0400 Subject: [PATCH] libertas: make scan result handling more flexible - use a linked list for scan results - age scan results - pass bss_descriptors around instead of indexes into the scan table - lock access to the scan results - stop returning EAGAIN from SIOCGIWSCAN handler Signed-off-by: Dan Williams Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index c43aa10f1a8b..41d8a4cdd43b 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -257,8 +257,10 @@ struct _wlan_adapter { struct WLAN_802_11_SSID previousssid; u8 previousbssid[ETH_ALEN]; - struct bss_descriptor *scantable; - u32 numinscantable; + /* Scan results list */ + struct list_head network_list; + struct list_head network_free_list; + struct bss_descriptor *networks; u8 scantype; u32 scanmode; -- cgit v1.2.2 From ef9a264b7a288a07c43ddb244c4f9ab0e8df90e4 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 May 2007 16:46:33 -0400 Subject: [PATCH] libertas: move channel changing into association framework Handle channel changes through the deferred association framework rather than directly. Fixes errors when setting channels along with other parameters like mode and SSID. Signed-off-by: Dan Williams Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 41d8a4cdd43b..4ca60d9323b4 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -287,7 +287,6 @@ struct _wlan_adapter { u32 txantenna; u32 rxantenna; - u8 adhocchannel; u32 fragthsd; u32 rtsthsd; -- cgit v1.2.2 From e76850d620a0a26fa807b4fa189c64a94789461e Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 25 May 2007 17:09:41 -0400 Subject: [PATCH] libertas: make association paths consistent The BSS to associate with (in either Infrastructure or IBSS join operations) is now stored in _one_ place in the association request (the bss member), not two places as before (pattemptedbss and curbssparams->bssdescriptor). Association requests are passed to the necessary association functions to (a) give them access to the bss member and (b) ensure that association/join/start setup uses settings from the request, not the current adapter settings (which may not be valid for the requested settings). Because the 'bss' member of the association request is used now, the command return functions from associate and adhoc join/start need access to the in-progress association request to update curbssparams when everything is done. The association worker moves the request from pending to in-progress for the duration of the association attempt. Signed-off-by: Dan Williams Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 4ca60d9323b4..797a1249bcaf 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -63,7 +63,6 @@ struct wlan_802_11_security { /** Current Basic Service Set State Structure */ struct current_bss_params { - struct bss_descriptor bssdescriptor; /** bssid */ u8 bssid[ETH_ALEN]; /** ssid */ @@ -168,18 +167,20 @@ struct _wlan_private { struct assoc_request { #define ASSOC_FLAG_SSID 1 #define ASSOC_FLAG_CHANNEL 2 -#define ASSOC_FLAG_MODE 3 -#define ASSOC_FLAG_BSSID 4 -#define ASSOC_FLAG_WEP_KEYS 5 -#define ASSOC_FLAG_WEP_TX_KEYIDX 6 -#define ASSOC_FLAG_WPA_MCAST_KEY 7 -#define ASSOC_FLAG_WPA_UCAST_KEY 8 -#define ASSOC_FLAG_SECINFO 9 -#define ASSOC_FLAG_WPA_IE 10 +#define ASSOC_FLAG_BAND 3 +#define ASSOC_FLAG_MODE 4 +#define ASSOC_FLAG_BSSID 5 +#define ASSOC_FLAG_WEP_KEYS 6 +#define ASSOC_FLAG_WEP_TX_KEYIDX 7 +#define ASSOC_FLAG_WPA_MCAST_KEY 8 +#define ASSOC_FLAG_WPA_UCAST_KEY 9 +#define ASSOC_FLAG_SECINFO 10 +#define ASSOC_FLAG_WPA_IE 11 unsigned long flags; struct WLAN_802_11_SSID ssid; u8 channel; + u8 band; u8 mode; u8 bssid[ETH_ALEN]; @@ -196,6 +197,9 @@ struct assoc_request { /** WPA Information Elements*/ u8 wpa_ie[MAX_WPA_IE_LEN]; u8 wpa_ie_len; + + /* BSS to associate with for infrastructure of Ad-Hoc join */ + struct bss_descriptor bss; }; /** Wlan adapter data structure*/ @@ -252,8 +256,6 @@ struct _wlan_adapter { /* IW_MODE_* */ u8 mode; - struct bss_descriptor *pattemptedbssdesc; - struct WLAN_802_11_SSID previousssid; u8 previousbssid[ETH_ALEN]; @@ -322,7 +324,8 @@ struct _wlan_adapter { u16 locallisteninterval; u16 nullpktinterval; - struct assoc_request * assoc_req; + struct assoc_request * pending_assoc_req; + struct assoc_request * in_progress_assoc_req; /** Encryption parameter */ struct wlan_802_11_security secinfo; -- cgit v1.2.2 From e5b3d472ad4eaa9013fd9f67f7a1b132f3ec910c Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Fri, 25 May 2007 23:40:21 -0400 Subject: [PATCH] libertas: don't byte-swap firmware version number. It's a byte array. Signed-off-by: David Woodhouse Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 797a1249bcaf..91ac744ab9bc 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -205,7 +205,7 @@ struct assoc_request { /** Wlan adapter data structure*/ struct _wlan_adapter { /** STATUS variables */ - u32 fwreleasenumber; + u8 fwreleasenumber[4]; u32 fwcapinfo; /* protected with big lock */ -- cgit v1.2.2 From d8efea254887128d710cc1475505514da004932c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 28 May 2007 23:54:55 -0400 Subject: [PATCH] libertas: remove structure WLAN_802_11_SSID and libertas_escape_essid Replace WLAN_802_11_SSID with direct 'ssid' and 'ssid_len' members like ieee80211. In the process, remove private libertas_escape_essid and depend on the ieee80211 implementation of escape_essid instead. Signed-off-by: Dan Williams Signed-off-by: John W. Linville --- drivers/net/wireless/libertas/dev.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers/net/wireless/libertas/dev.h') diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h index 91ac744ab9bc..d6c340aef681 100644 --- a/drivers/net/wireless/libertas/dev.h +++ b/drivers/net/wireless/libertas/dev.h @@ -66,7 +66,8 @@ struct current_bss_params { /** bssid */ u8 bssid[ETH_ALEN]; /** ssid */ - struct WLAN_802_11_SSID ssid; + u8 ssid[IW_ESSID_MAX_SIZE + 1]; + u8 ssid_len; /** band */ u8 band; @@ -178,7 +179,8 @@ struct assoc_request { #define ASSOC_FLAG_WPA_IE 11 unsigned long flags; - struct WLAN_802_11_SSID ssid; + u8 ssid[IW_ESSID_MAX_SIZE + 1]; + u8 ssid_len; u8 channel; u8 band; u8 mode; @@ -256,8 +258,9 @@ struct _wlan_adapter { /* IW_MODE_* */ u8 mode; - struct WLAN_802_11_SSID previousssid; - u8 previousbssid[ETH_ALEN]; + u8 prev_ssid[IW_ESSID_MAX_SIZE + 1]; + u8 prev_ssid_len; + u8 prev_bssid[ETH_ALEN]; /* Scan results list */ struct list_head network_list; -- cgit v1.2.2