aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-05-11 17:54:19 -0400
committerJeff Garzik <jeff@garzik.org>2007-05-11 17:54:19 -0400
commit17cf8cc9439262cd90421435e0e8c7ab0af26833 (patch)
tree51f3f9080a5180d0983450f6ac274227a81628b5 /drivers/net
parent12414db11da8789d9a6b549c4899250f6e116630 (diff)
parent4269e2ad83036e1d8c076b1f1348f879a93be008 (diff)
Merge branch 'libertas' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/libertas/Makefile9
-rw-r--r--drivers/net/wireless/libertas/README516
-rw-r--r--drivers/net/wireless/libertas/assoc.c41
-rw-r--r--drivers/net/wireless/libertas/cmd.c23
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c4
-rw-r--r--drivers/net/wireless/libertas/debugfs.c31
-rw-r--r--drivers/net/wireless/libertas/defs.h52
-rw-r--r--drivers/net/wireless/libertas/dev.h14
-rw-r--r--drivers/net/wireless/libertas/fw.c9
-rw-r--r--drivers/net/wireless/libertas/if_usb.c5
-rw-r--r--drivers/net/wireless/libertas/if_usb.h2
-rw-r--r--drivers/net/wireless/libertas/ioctl.c1529
-rw-r--r--drivers/net/wireless/libertas/join.c194
-rw-r--r--drivers/net/wireless/libertas/join.h7
-rw-r--r--drivers/net/wireless/libertas/main.c7
-rw-r--r--drivers/net/wireless/libertas/rx.c4
-rw-r--r--drivers/net/wireless/libertas/scan.c203
-rw-r--r--drivers/net/wireless/libertas/scan.h22
-rw-r--r--drivers/net/wireless/libertas/tx.c2
-rw-r--r--drivers/net/wireless/libertas/version.h7
-rw-r--r--drivers/net/wireless/libertas/wext.c448
-rw-r--r--drivers/net/wireless/libertas/wext.h85
22 files changed, 259 insertions, 2955 deletions
diff --git a/drivers/net/wireless/libertas/Makefile b/drivers/net/wireless/libertas/Makefile
index 19c935071d8..56a8ea1fbf0 100644
--- a/drivers/net/wireless/libertas/Makefile
+++ b/drivers/net/wireless/libertas/Makefile
@@ -1,5 +1,3 @@
-# EXTRA_CFLAGS += -Wpacked
-
usb8xxx-objs := main.o fw.o wext.o \
rx.o tx.o cmd.o \
cmdresp.o scan.o \
@@ -7,13 +5,6 @@ usb8xxx-objs := main.o fw.o wext.o \
ioctl.o debugfs.o \
ethtool.o assoc.o
-ifeq ($(CONFIG_LIBERTAS_USB_DEBUG), y)
-EXTRA_CFLAGS += -DDEBUG -DPROC_DEBUG
-endif
-
-
-# This is needed to support the newer boot2 bootloader (v >= 3104)
-EXTRA_CFLAGS += -DSUPPORT_BOOT_COMMAND
usb8xxx-objs += if_bootcmd.o
usb8xxx-objs += if_usb.o
diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README
index 688da4c784b..378577200b5 100644
--- a/drivers/net/wireless/libertas/README
+++ b/drivers/net/wireless/libertas/README
@@ -40,64 +40,11 @@ NAME
SYNOPSIS
iwpriv <ethX> <command> [sub-command] ...
- iwpriv ethX version
- iwpriv ethX scantype [sub-command]
- iwpriv ethX getSNR <n>
- iwpriv ethX getNF <n>
- iwpriv ethX getRSSI <n>
- iwpriv ethX setrxant <n>
- iwpriv ethX getrxant
- iwpriv ethX settxant <n>
- iwpriv ethX gettxant
- iwpriv ethX authalgs <n>
- iwpriv ethX pre-TBTT <n>
- iwpriv ethX 8021xauthalgs <n>
- iwpriv ethX encryptionmode <n>
iwpriv ethX setregioncode <n>
iwpriv ethX getregioncode
- iwpriv ethX setbcnavg <n>
- iwpriv ethX getbcnavg
- iwpriv ethX setdataavg <n>
- iwpriv ethX setlisteninter <n>
- iwpriv ethX getlisteninter
- iwpriv ethX setmultipledtim <n>
- iwpriv ethX getmultipledtim
- iwpriv ethX atimwindow <n>
- iwpriv ethX deauth
- iwpriv ethX adhocstop
- iwpriv ethX radioon
- iwpriv ethX radiooff
- iwpriv ethX reasso-on
- iwpriv ethX reasso-off
- iwpriv ethX scanmode [sub-command]
- iwpriv ethX setwpaie <n>
- iwpriv ethX wlanidle-off
- iwpriv ethX wlanidle-on
- iwpriv ethX getcis
- iwpriv ethX getlog
- iwpriv ethX getadhocstatus
- iwpriv ethX adhocgrate <n>
-
-Version 4 Command:
- iwpriv ethX inactvityto <n>
- iwpriv ethX sleeppd <n>
- iwpriv ethX enable11d <n>
- iwpriv ethX tpccfg <n>
- iwpriv ethX powercfg <n>
- iwpriv ethX setafc <n>
- iwpriv ethX getafc
Version 5 Command:
iwpriv ethX ledgpio <n>
- iwpriv ethX scanprobes <n>
- iwpriv ethX lolisteninter <n>
- iwpriv ethX rateadapt <n> <m>
- iwpriv ethX txcontrol <n>
- iwpriv ethX psnullinterval <n>
- iwpriv ethX prescan <n>
- iwpriv ethX getrxinfo
- iwpriv ethX gettxrate
- iwpriv ethX beaconinterval
BT Commands:
The blinding table (BT) contains a list of mac addresses that should be
@@ -150,114 +97,6 @@ DESCRIPTION
The ethX parameter specifies the network device that is to be used to
perform this command on. it could be eth0, eth1 etc.
-version
- This is used to get the current version of the driver and the firmware.
-
-scantype
- This command is used to set the scan type to be used by the driver in
- the scan command. This setting will not be used while performing a scan
- for a specific SSID, as it is always done with scan type being active.
-
- where the sub-commands are: -
- active -- to set the scan type to active
- passive -- to set the scan type to passive
- get -- to get the scan type set in the driver
-
-getSNR
- This command gets the average and non average value of Signal to Noise
- Ratio of Beacon and Data.
-
- where value is:-
- 0 -- Beacon non-average.
- 1 -- Beacon average.
- 2 -- Data non-average.
- 3 -- Data average.
-
- If no value is given, all four values are returned in the order mentioned
- above.
-
- Note: This command is available only when STA is connected.
-
-getRSSI
- This command gets the average and non average value os Receive Signal
- Strength of Beacon and Data.
-
- where value is:-
- 0 -- Beacon non-average.
- 1 -- Beacon average.
- 2 -- Data non-average.
- 3 -- Data average.
-
- Note: This command is available only when STA is connected.
-
-getNF
- This command gets the average and non average value of Noise Floor of
- Beacon and Data.
-
- where value is:-
- 0 -- Beacon non-average.
- 1 -- Beacon average.
- 2 -- Data non-average.
- 3 -- Data average.
-
- Note: This command is available only when STA is connected.
-
-setrxant
- This command is used to set the mode for Rx antenna.
-
- The options that can be sent are:-
- 1 -- Antenna 1.
- 2 -- Antenna 2.
- 0xFFFF -- Diversity.
-
- Usage:
- iwpriv ethX setrxant 0x01: select Antenna 1.
-
-getrxant
- This command is used to get the mode for Rx antenna.
-
-
-settxant
- This command is used to set the mode for Tx antenna.
- The options that can be sent are:-
- 1 -- Antenna 1.
- 2 -- Antenna 2.
- 0xFFFF -- Diversity.
- Usage:
- iwpriv ethX settxant 0x01: select Antenna 1.
-
-gettxant
- This command is used to get the mode for Tx antenna.
-
-authalgs
- This command is used by the WPA supplicant to set the authentication
- algorithms in the station.
-
-8021xauthalgs
- This command is used by the WPA supplicant to set the 8021.x authentication algorithm type
- station.
-
- where values can be:-
- 1 -- None
- 2 -- LEAP
- 4 -- TLS
- 8 -- TTLs
- 16 -- MD5
-
-
-encryptionmode
- This command is used by the WPA supplicant to set the encryption algorithm.
-
- where values can be:-
- 0 -- NONE
- 1 -- WEP40
- 2 -- TKIP
- 3 -- CCMP
- 4 -- WEP104
-
-pre-TBTT
- This command is used to set pre-TBTT time period where value is in microseconds.
-
setregioncode
This command is used to set the region code in the station.
where value is 'region code' for various regions like
@@ -270,114 +109,6 @@ getregioncode
This command is used to get the region code information set in the
station.
-setbcnavg
- Set the weighting factor for calculating RSSI.
-
-getbcnavg
- Get weighting factor for calculating RSSI.
-
-setdataavg
- Set the weighting factor for calculating SNR.
-
-setlisteninter
- This command is used to set the listen interval in the
- station.
-
- where the value ranges between 1 - 255
-
-getlisteninter
- This command is used to get the listen interval value set in the
- station.
-
-setmultipledtim
- This command is used to set the multiple dtim value in the
- station.
- where the value is 1,2,3,4,5,0xfffe
- 0xfffe means the firmware will use listen interval in association
- command for waking up
-
-getmultipledtim
- This command is used to get the multiple dtim value set in the station.
-
-atimwindow
- This command is used to set the atim value in the
- station.
-
- where the value ranges between 0 - 50
-
-deauth
- This command is used to send the de-authentication to the AP with which
- the station is associated. This command is valid only when
- station is in Infrastructure mode.
-
- Note: This command is available only when STA is connected.
-
-adhocstop
- This command is used to stop beacon transmission from the station and
- go into idle state in ad-hoc mode.
-
- Note: This command is available only when STA is connected.
-
-radioon
- This command is used to turn on the RF antenna.
-
-radiooff
- This command is sued to turn off the RF antenna.
-
-scanmode
- This command is used to set the station to scan for either IBSS
- networks or BSS networks or both BSS and IBSS networks. This
- command can be used with sub commands,
-
- where the value for
- bss -- Scan All the BSS networks.
- ibss -- Scan All the IBSS networks.
- any -- Scan both BSS and IBSS networks.
-
-
-
-setwpaie
- This command is used by WPA supplicant to send the WPA-IE to the driver.
-
-wlanidle-off
- This command is used to get into idle state.
-
- Note: This command is available only when STA is connected.
-
-wlanidle-on
- This command is used to get off the idle state.
-
- Note: This command is available only when STA is connected.
-
-
-getlog
- This command is used to get the 802.11 statistics available in the
- station.
-
- Note: This command is available only when STA is connected.
-
-getadhocstatus
- This command is used to get the ad-hoc Network Status.
-
- The various status codes are:
- AdhocStarted
- AdhocJoined
- AdhocIdle
- InfraMode
- AutoUnknownMode
-
- Note: This command is available only when STA is connected.
-
-adhocgrate
- This command is used to enable(1) g_rate, Disable(0) g_rate
- and request(2) the status which g_rate is disabled/enabled,
- for Ad-hoc creator.
-
- where value is:-
- 0 -- Disabled
- 1 -- Enabled
- 2 -- Get
-
ledgpio
This command is used to set/get LEDs.
@@ -400,253 +131,6 @@ ledgpio
Note: LED0 is invalid
Note: Maximum Number of LEDs are 16.
-inactivityto
- This command is used by the host to set/get the inactivity timeout value,
- which specifies when WLAN device is put to sleep.
-
- Usage:
- iwpriv ethX inactivityto [<timeout>]
-
- where the parameter are:
- timeout: timeout value in milliseconds.
-
- Example:
- iwpriv eth1 inactivityto
- "get the timeout value"
-
- iwpriv eth1 inactivityto X
- "set timeout value to X ms"
-
-
-sleeppd
- This command is used to configure the sleep period of the WLAN device.
-
- Usage:
- iwpriv ethX sleeppd [<sleep period>]
-
- where the parameter are:
- Period: sleep period in milliseconds. Range 10~60.
-
- Example:
- iwpriv eth1 sleeppd 10
- "set period as 10 ms"
- iwpriv eth1 sleeppd
- "get the sleep period configuration"
-
-enable11d
- This command is used to control 11d
- where value is:-
- 1 -- Enabled
- 0 -- Disabled
- 2 -- Get
-
-
-
-
-tpccfg
- Enables or disables automatic transmit power control.
-
- The first parameter turns this feature on (1) or off (0). When turning
- on, the user must also supply four more parameters in the following
- order:
- -UseSNR (Use SNR (in addition to PER) for TPC algorithm),
- -P0 (P0 power level for TPC),
- -P1 (P1 power level for TPC),
- -P2 (P2 power level for TPC).
-
- Usage:
- iwpriv ethX tpccfg: Get current configuration
- iwpriv ethX tpccfg 0: disable auto TPC
- iwpriv ethX tpccfg 0x01 0x00 0x05 0x0a 0x0d: enable auto TPC; do not use SNR;
- P0=0x05; P1=0x0a; P2=0x0d;
- iwpriv ethX tpccfg 0x01 0x01 0x05 0x0a 0x0d: enable auto TPC; use SNR;
- P0=0x05; P1=0x0a; P2=0x0d.
-
-powercfg
- Enables or disables power adaptation.
-
- The first parameter turns this feature on (1) or off (0). When turning
- on, the user must also supply three more parameters in the following
- order:
- -P0 (P0 power level for Power Adaptation),
- -P1 (P1 power level for Power Adaptation),
- -P2 (P2 power level for Power Adaptation).
-
- Usage:
- iwpriv ethX powercfg: Get current configuration
- iwpriv ethX powercfg 0: disable power adaptation
- iwpriv ethX powercfg 1 0x0d 0x0f 0x12: enable power adaptation;
- P0=0x0d; P1=0x0f; P2=0x12.
-
-getafc
- This command returns automatic frequency control parameters. It returns
- three integers:
- -P0: automatic is on (1), or off (0),
- -P1: current timing offset in PPM (part per million), and
- -P2: current frequency offset in PPM.
-
-setafc
- Set automatic frequency control options.
-
- The first parameter turns automatic on (1) or off (0).
- The user must supply two more parameters in either case, in the following
- order:
-
- When auto is on:
-
- -P0 (automatic adjustment frequency threshold in PPM),
- -P1 (automatic adjustment period in beacon period),
-
- When auto is off:
-
- -P0 (manual adjustment timing offset in PPM), and
- -P1 (manual adjustment frequency offset in PPM).
-
- Usage:
- iwpriv ethX setafc 0 10 10: manual adjustment, both timing and frequcncy
- offset are 10 PPM.
-
- iwpriv ethX setafc 1 10 10 enable afc, automatic adjustment,
- frequency threshold 10 PPM, for every 10 beacon periods.
-
-
-
-scanprobes
- This command sets number of probe requests per channel.
-
- Usage:
- iwpriv ethX scanprobes 3 (set scan probes to 3)
- iwpriv ethX scanprobes (get scan probes)
-
-lolisteninter
- This command sets the value of listen interval.
-
- Usage:
- iwpriv ethX lolisteninter 234 (set the lolisteninter to 234)
- iwpriv ethX lolisteninter (get the lolisteninter value)
-
-rateadapt
- This command sets the data rates bitmap.
- Where <n>
- 0: Disable auto rate adapt
- 1: Enable auto rate adapt
-
- <m>
- data rate bitmap
- Bit Data rate
- 0 1 Mbps
- 1 2 Mbps
- 2 5.5 Mbps
- 3 11 Mbps
- 4 Reserved
- 5 6 Mbps
- 6 9 Mbps
- 7 12 Mbps
- 8 18 Mbps
- 9 24 Mbps
- 10 36 Mbps
- 11 48 Mbps
- 12 54 Mbps
- 12-15 Reserved
-
- Usage:
- iwpriv ethX rateadapt
- read the currect data rate setting
- iwpriv ethX rateadapt 1 0x07
- enable auto data rate adapt and
- data rates are 1Mbps, 2Mbsp and 5.5Mbps
-
-
-txcontrol
- This command is used to set the Tx rate, ack policy, and retry limit on a per packet basis.
-
- Where value <n> is:
- if bit[4] == 1:
- bit[3:0] -- 0 1 2 3 4 5 6 7 8 9 10 11 12 13-16
- Data Rate(Mbps) -- 1 2 5.5 11 Rsv 6 9 12 18 24 36 48 54 Rsv
-
- bit[12:8]
- if bit[12] == 1, bit[11:8] specifies the Tx retry limit.
-
- bit[14:13] specifies per packet ack policy:
- bit[14:13]
- 1 0 use immediate ack policy for this packet
- 1 1 use no ack policy for this packet
- 0 x use the per-packet ack policy setting
-
- Usage:
- iwpriv ethX txcontrol 0x7513
- Use no-ack policy, 5 retires for Tx, 11Mbps rate
-
-
-
-psnullinterval
- This command is used to set/request NULL package interval for Power Save
- under infrastructure mode.
-
- where value is:-
- -1 -- Disabled
- n>0 -- Set interval as n (seconds)
-
-prescan
- This command is used to enable (1)/disable(0) auto prescan before assoicate to the ap
-
- where value is:-
- 0 -- Disabled
- 1 -- Enabled
- 2 -- Get
-
-getrxinfo
- This command gets non average value of Signal to Noise Ratio of Data and rate index.
-
- The following table shows RateIndex and Rate
-
- RateIndex Data rate
- 0 1 Mbps
- 1 2 Mbps
- 2 5.5 Mbps
- 3 11 Mbps
- 4 Reserved
- 5 6 Mbps
- 6 9 Mbps
- 7 12 Mbps
- 8 18 Mbps
- 9 24 Mbps
- 10 36 Mbps
- 11 48 Mbps
- 12 54 Mbps
- 13-15 Reserved
-
-gettxrate
- This command gets current Tx rate index of the first packet associated with Rate Adaptation.
-
- The following table shows RateIndex and Rate
-
- RateIndex Data rate
- 0 1 Mbps
- 1 2 Mbps
- 2 5.5 Mbps
- 3 11 Mbps
- 4 Reserved
- 5 6 Mbps
- 6 9 Mbps
- 7 12 Mbps
- 8 18 Mbps
- 9 24 Mbps
- 10 36 Mbps
- 11 48 Mbps
- 12 54 Mbps
- 13-15 Reserved
-
-bcninterval
- This command is used to sets beacon interval in adhoc mode when an argument is given, and gets current adhoc
- beacon interval when no argument is given. The valid beacon interval is between 20 - 1000,
- default beacon interval is 100.
-
- Usage:
- iwpriv ethX bcninterval 100 (set adhoc beacon interval to 100)
- iwpriv ethX bcninterval (get adhoc beacon interval)
-
fwt_add
This command is used to insert an entry into the FWT table. The list of
parameters must follow the following structure:
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index b55c7f57aca..c260bd1b3d4 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -23,13 +23,13 @@ static int assoc_helper_essid(wlan_private *priv,
ENTER();
lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid);
- if (assoc_req->mode == wlan802_11infrastructure) {
+ if (assoc_req->mode == IW_MODE_INFRA) {
if (adapter->prescan) {
libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1);
}
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid,
- NULL, wlan802_11infrastructure);
+ NULL, IW_MODE_INFRA);
if (i >= 0) {
lbs_pr_debug(1,
"SSID found in scan list ... associating...\n");
@@ -44,7 +44,7 @@ static int assoc_helper_essid(wlan_private *priv,
lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n",
assoc_req->ssid.ssid);
}
- } else if (assoc_req->mode == wlan802_11ibss) {
+ } else if (assoc_req->mode == IW_MODE_ADHOC) {
/* Scan for the network, do not save previous results. Stale
* scan data will cause us to join a non-existant adhoc network
*/
@@ -52,7 +52,7 @@ static int assoc_helper_essid(wlan_private *priv,
/* Search for the requested SSID in the scan table */
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL,
- wlan802_11ibss);
+ IW_MODE_ADHOC);
if (i >= 0) {
lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret);
libertas_join_adhoc_network(priv, &adapter->scantable[i]);
@@ -90,10 +90,10 @@ static int assoc_helper_bssid(wlan_private *priv,
goto out;
}
- if (assoc_req->mode == wlan802_11infrastructure) {
+ if (assoc_req->mode == IW_MODE_INFRA) {
ret = wlan_associate(priv, &adapter->scantable[i]);
lbs_pr_debug(1, "ASSOC: return from wlan_associate(bssd) was %d\n", ret);
- } else if (assoc_req->mode == wlan802_11ibss) {
+ } else if (assoc_req->mode == IW_MODE_ADHOC) {
libertas_join_adhoc_network(priv, &adapter->scantable[i]);
}
memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid,
@@ -142,23 +142,23 @@ static int assoc_helper_mode(wlan_private *priv,
ENTER();
- if (assoc_req->mode == adapter->inframode) {
+ if (assoc_req->mode == adapter->mode) {
LEAVE();
return 0;
}
- if (assoc_req->mode == wlan802_11infrastructure) {
+ if (assoc_req->mode == IW_MODE_INFRA) {
if (adapter->psstate != PS_STATE_FULL_POWER)
libertas_ps_wakeup(priv, cmd_option_waitforrsp);
adapter->psmode = wlan802_11powermodecam;
}
- adapter->inframode = assoc_req->mode;
+ adapter->mode = assoc_req->mode;
ret = libertas_prepare_and_send_command(priv,
cmd_802_11_snmp_mib,
0, cmd_option_waitforrsp,
OID_802_11_INFRASTRUCTURE_MODE,
- (void *) assoc_req->mode);
+ (void *) (size_t) assoc_req->mode);
LEAVE();
return ret;
@@ -196,7 +196,7 @@ static int assoc_helper_wep_keys(wlan_private *priv,
goto out;
/* enable/disable the MAC's WEP packet filter */
- if (assoc_req->secinfo.WEPstatus == wlan802_11WEPenabled)
+ if (assoc_req->secinfo.wep_enabled)
adapter->currentpacketfilter |= cmd_act_mac_wep_enable;
else
adapter->currentpacketfilter &= ~cmd_act_mac_wep_enable;
@@ -300,8 +300,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
}
if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) {
- if (adapter->secinfo.authmode !=
- assoc_req->secinfo.authmode) {
+ if (adapter->secinfo.auth_mode != assoc_req->secinfo.auth_mode) {
lbs_pr_debug(1, "Deauthenticating due to updated security "
"info in configuration request.\n");
return 1;
@@ -316,7 +315,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
/* FIXME: deal with 'auto' mode somehow */
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
- if (assoc_req->mode != wlan802_11infrastructure)
+ if (assoc_req->mode != IW_MODE_INFRA)
return 1;
}
@@ -333,12 +332,12 @@ static int should_stop_adhoc(wlan_adapter *adapter,
if (adapter->curbssparams.ssid.ssidlength != assoc_req->ssid.ssidlength)
return 1;
if (memcmp(adapter->curbssparams.ssid.ssid, assoc_req->ssid.ssid,
- sizeof(struct WLAN_802_11_SSID)))
+ adapter->curbssparams.ssid.ssidlength))
return 1;
/* FIXME: deal with 'auto' mode somehow */
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
- if (assoc_req->mode != wlan802_11ibss)
+ if (assoc_req->mode != IW_MODE_ADHOC)
return 1;
}
@@ -382,7 +381,7 @@ void wlan_association_worker(struct work_struct *work)
}
if (find_any_ssid) {
- enum WLAN_802_11_NETWORK_INFRASTRUCTURE new_mode;
+ u8 new_mode;
ret = libertas_find_best_network_SSID(priv, &assoc_req->ssid,
assoc_req->mode, &new_mode);
@@ -393,7 +392,7 @@ void wlan_association_worker(struct work_struct *work)
}
/* Ensure we switch to the mode of the AP */
- if (assoc_req->mode == wlan802_11autounknown) {
+ if (assoc_req->mode == IW_MODE_AUTO) {
set_bit(ASSOC_FLAG_MODE, &assoc_req->flags);
assoc_req->mode = new_mode;
}
@@ -403,7 +402,7 @@ void wlan_association_worker(struct work_struct *work)
* Check if the attributes being changing require deauthentication
* from the currently associated infrastructure access point.
*/
- if (adapter->inframode == wlan802_11infrastructure) {
+ if (adapter->mode == IW_MODE_INFRA) {
if (should_deauth_infrastructure(adapter, assoc_req)) {
ret = libertas_send_deauthentication(priv);
if (ret) {
@@ -412,7 +411,7 @@ void wlan_association_worker(struct work_struct *work)
ret);
}
}
- } else if (adapter->inframode == wlan802_11ibss) {
+ } else if (adapter->mode == IW_MODE_ADHOC) {
if (should_stop_adhoc(adapter, assoc_req)) {
ret = libertas_stop_adhoc_network(priv);
if (ret) {
@@ -543,7 +542,7 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter)
assoc_req->channel = adapter->curbssparams.channel;
if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags))
- assoc_req->mode = adapter->inframode;
+ assoc_req->mode = adapter->mode;
if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
memcpy(&assoc_req->bssid, adapter->curbssparams.bssid,
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index bfdac58b5c0..de9cb46a70f 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -381,15 +381,16 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv,
switch (cmd_oid) {
case OID_802_11_INFRASTRUCTURE_MODE:
{
- enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode =
- (enum WLAN_802_11_NETWORK_INFRASTRUCTURE) pdata_buf;
+ u8 mode = (u8) (size_t) pdata_buf;
pSNMPMIB->querytype = cpu_to_le16(cmd_act_set);
pSNMPMIB->oid = cpu_to_le16((u16) desired_bsstype_i);
pSNMPMIB->bufsize = sizeof(u8);
- if (mode == wlan802_11infrastructure)
- ucTemp = SNMP_MIB_VALUE_INFRA;
- else
+ if (mode == IW_MODE_ADHOC) {
ucTemp = SNMP_MIB_VALUE_ADHOC;
+ } else {
+ /* Infra and Auto modes */
+ ucTemp = SNMP_MIB_VALUE_INFRA;
+ }
memmove(pSNMPMIB->value, &ucTemp, sizeof(u8));
@@ -947,8 +948,8 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u
spin_unlock_irqrestore(&adapter->driver_lock, flags);
- lbs_pr_debug(1, "QUEUE_CMD: Inserted node=0x%x, cmd=0x%x in cmdpendingq\n",
- (u32) cmdnode,
+ lbs_pr_debug(1, "QUEUE_CMD: Inserted node=%p, cmd=0x%x in cmdpendingq\n",
+ cmdnode,
((struct cmd_ds_gen*)cmdnode->bufvirtualaddr)->command);
done:
@@ -976,8 +977,8 @@ static int DownloadcommandToStation(wlan_private * priv,
ENTER();
if (!adapter || !cmdnode) {
- lbs_pr_debug(1, "DNLD_CMD: adapter = %#x, cmdnode = %#x\n",
- (int)adapter, (int)cmdnode);
+ lbs_pr_debug(1, "DNLD_CMD: adapter = %p, cmdnode = %p\n",
+ adapter, cmdnode);
if (cmdnode) {
spin_lock_irqsave(&adapter->driver_lock, flags);
__libertas_cleanup_and_insert_cmd(priv, cmdnode);
@@ -1174,8 +1175,8 @@ int libertas_prepare_and_send_command(wlan_private * priv,
cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr;
- lbs_pr_debug(1, "PREP_CMD: Val of cmd ptr =0x%x, command=0x%X\n",
- (u32) cmdptr, cmd_no);
+ lbs_pr_debug(1, "PREP_CMD: Val of cmd ptr=%p, command=0x%X\n",
+ cmdptr, cmd_no);
if (!cmdptr) {
lbs_pr_debug(1, "PREP_CMD: bufvirtualaddr of cmdnode is NULL\n");
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index cdb012c7e9c..c86454034b5 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -72,8 +72,6 @@ void libertas_mac_event_disconnected(wlan_private * priv)
adapter->secinfo.WPAenabled = 0;
adapter->secinfo.WPA2enabled = 0;
adapter->wpa_ie_len = 0;
- adapter->secinfo.auth1xalg = WLAN_1X_AUTH_ALG_NONE;
- adapter->secinfo.Encryptionmode = CIPHER_NONE;
adapter->connect_status = libertas_disconnected;
@@ -811,7 +809,7 @@ int libertas_process_rx_command(wlan_private * priv)
if (result) {
lbs_pr_debug(1, "CMD_RESP: PS command failed- %#x \n",
resp->result);
- if (adapter->inframode == wlan802_11ibss) {
+ if (adapter->mode == IW_MODE_ADHOC) {
/*
* We should not re-try enter-ps command in
* ad-hoc mode. It takes place in
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 51dfd202f55..7d7bc5e86a5 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -7,6 +7,7 @@
#include "dev.h"
#include "decl.h"
#include "host.h"
+#include "debugfs.h"
static struct dentry *libertas_dir = NULL;
static char *szStates[] = {
@@ -276,7 +277,7 @@ static void libertas_parse_ssid(char *buf, size_t count,
if (!end)
end = buf + count - 1;
- size = min(IW_ESSID_MAX_SIZE, end - hold);
+ size = min((size_t)IW_ESSID_MAX_SIZE, (size_t) (end - hold));
strncpy(scan_cfg->specificSSID, hold, size);
return;
@@ -1648,7 +1649,7 @@ struct libertas_debugfs_files {
struct file_operations fops;
};
-struct libertas_debugfs_files debugfs_files[] = {
+static struct libertas_debugfs_files debugfs_files[] = {
{ "info", 0444, FOPS(libertas_dev_info, write_file_dummy), },
{ "getscantable", 0444, FOPS(libertas_getscantable,
write_file_dummy), },
@@ -1658,7 +1659,7 @@ struct libertas_debugfs_files debugfs_files[] = {
{ "setuserscan", 0600, FOPS(NULL, libertas_setuserscan), },
};
-struct libertas_debugfs_files debugfs_events_files[] = {
+static struct libertas_debugfs_files debugfs_events_files[] = {
{"low_rssi", 0644, FOPS(libertas_lowrssi_read,
libertas_lowrssi_write), },
{"low_snr", 0644, FOPS(libertas_lowsnr_read,
@@ -1673,7 +1674,7 @@ struct libertas_debugfs_files debugfs_events_files[] = {
libertas_highsnr_write), },
};
-struct libertas_debugfs_files debugfs_regs_files[] = {
+static struct libertas_debugfs_files debugfs_regs_files[] = {
{"rdmac", 0644, FOPS(libertas_rdmac_read, libertas_rdmac_write), },
{"wrmac", 0600, FOPS(NULL, libertas_wrmac_write), },
{"rdbbp", 0644, FOPS(libertas_rdbbp_read, libertas_rdbbp_write), },
@@ -1778,7 +1779,7 @@ void libertas_debugfs_remove_one(wlan_private *priv)
struct debug_data {
char name[32];
u32 size;
- u32 addr;
+ size_t addr;
};
/* To debug any member of wlan_adapter, simply add one line here.
@@ -1825,6 +1826,8 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf,
val = *((u16 *) d[i].addr);
else if (d[i].size == 4)
val = *((u32 *) d[i].addr);
+ else if (d[i].size == 8)
+ val = *((u64 *) d[i].addr);
pos += sprintf(p + pos, "%s=%d\n", d[i].name, val);
}
@@ -1844,7 +1847,7 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf,
* @param data data to write
* @return number of data
*/
-static int wlan_debugfs_write(struct file *f, const char __user *buf,
+static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf,
size_t cnt, loff_t *ppos)
{
int r, i;
@@ -1886,12 +1889,14 @@ static int wlan_debugfs_write(struct file *f, const char __user *buf,
*((u16 *) d[i].addr) = (u16) r;
else if (d[i].size == 4)
*((u32 *) d[i].addr) = (u32) r;
+ else if (d[i].size == 8)
+ *((u64 *) d[i].addr) = (u64) r;
break;
} while (1);
}
kfree(pdata);
- return cnt;