* Please pull 'libertas-fixes' branch of wireless-2.6
@ 2007-07-03 18:48 John W. Linville
0 siblings, 0 replies; 8+ messages in thread
From: John W. Linville @ 2007-07-03 18:48 UTC (permalink / raw)
To: jeff-o2qLIJkoznsdnm+yROfE0A
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
The following changes since commit aa2e09da2a332e748532aa2a71b090e7e7c3203d:
Len Brown (1):
ACPI: fix acpi_osi=!Linux
are found in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas-fixes
Holger Schurig (1):
libertas: fix use-after-free in rx path
Robert P. J. Day (1):
WIRELESS: Remove clearly obsolete libertas/version.h file.
drivers/net/wireless/libertas/rx.c | 1 -
drivers/net/wireless/libertas/version.h | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
delete mode 100644 drivers/net/wireless/libertas/version.h
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index 88d9d2d..769c86f 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -439,7 +439,6 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
ret = 0;
done:
- skb->protocol = __constant_htons(0x0019); /* ETH_P_80211_RAW */
lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
return ret;
}
diff --git a/drivers/net/wireless/libertas/version.h b/drivers/net/wireless/libertas/version.h
deleted file mode 100644
index 8b13789..0000000
--- a/drivers/net/wireless/libertas/version.h
+++ /dev/null
@@ -1 +0,0 @@
-
--
John W. Linville
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org
^ permalink raw reply related [flat|nested] 8+ messages in thread* Please pull 'libertas-fixes' branch of wireless-2.6
@ 2007-06-27 20:55 John W. Linville
[not found] ` <20070627205539.GB13617-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-07-02 12:14 ` Jeff Garzik
0 siblings, 2 replies; 8+ messages in thread
From: John W. Linville @ 2007-06-27 20:55 UTC (permalink / raw)
To: jeff-o2qLIJkoznsdnm+yROfE0A
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, dcbw-H+wXaHxf7aLQT0dZR+AlfA
The following changes since commit 189548642c5962e60c3667bdb3a703fe0bed12a6:
Linus Torvalds (1):
Linus 2.6.22-rc6
are found in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas-fixes
Dan Williams (4):
libertas: style fixes
libertas: kill wlan_scan_process_results
libertas: fix WPA associations by handling ENABLE_RSN correctly
libertas: remove private ioctls
drivers/net/wireless/libertas/Makefile | 2 +-
drivers/net/wireless/libertas/README | 275 --------
drivers/net/wireless/libertas/assoc.c | 28 +-
drivers/net/wireless/libertas/cmd.c | 12 +-
drivers/net/wireless/libertas/cmdresp.c | 21 +
drivers/net/wireless/libertas/hostcmd.h | 2 +-
drivers/net/wireless/libertas/ioctl.c | 1081 -------------------------------
drivers/net/wireless/libertas/main.c | 8 +-
drivers/net/wireless/libertas/scan.c | 51 +--
drivers/net/wireless/libertas/wext.c | 152 -----
drivers/net/wireless/libertas/wext.h | 45 +--
11 files changed, 79 insertions(+), 1598 deletions(-)
delete mode 100644 drivers/net/wireless/libertas/ioctl.c
diff --git a/drivers/net/wireless/libertas/Makefile b/drivers/net/wireless/libertas/Makefile
index a1097f5..32ed413 100644
--- a/drivers/net/wireless/libertas/Makefile
+++ b/drivers/net/wireless/libertas/Makefile
@@ -2,7 +2,7 @@ libertas-objs := main.o fw.o wext.o \
rx.o tx.o cmd.o \
cmdresp.o scan.o \
join.o 11d.o \
- ioctl.o debugfs.o \
+ debugfs.o \
ethtool.o assoc.o
usb8xxx-objs += if_bootcmd.o
diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README
index 1f92f50..0b133ce 100644
--- a/drivers/net/wireless/libertas/README
+++ b/drivers/net/wireless/libertas/README
@@ -28,281 +28,6 @@ DRIVER LOADING
insmod usb8388.ko [fw_name=usb8388.bin]
-=====================
-IWPRIV COMMAND
-=====================
-
-NAME
- This manual describes the usage of private commands used in Marvell WLAN
- Linux Driver. All the commands available in Wlanconfig will not be available
- in the iwpriv.
-
-SYNOPSIS
- iwpriv <ethX> <command> [sub-command] ...
-
- iwpriv ethX setregioncode <n>
- iwpriv ethX getregioncode
-
-Version 5 Command:
- iwpriv ethX ledgpio <n>
-
-BT Commands:
- The blinding table (BT) contains a list of mac addresses that will be,
- by default, ignored by the firmware. It is also possible to invert this
- behavior so that we will ignore all traffic except for the portion
- coming from mac addresess in the list. It is primarily used for
- debugging and testing networks. It can be edited and inspected with
- the following commands:
-
- iwpriv ethX bt_reset
- iwpriv ethX bt_add <mac_address>
- iwpriv ethX bt_del <mac_address>
- iwpriv ethX bt_list <id>
- iwpriv ethX bt_get_invert <n>
- iwpriv ethX bt_set_invert <n>
-
-FWT Commands:
- The forwarding table (FWT) is a feature used to manage mesh network
- routing in the firmware. The FWT is essentially a routing table that
- associates a destination mac address (da) with a next hop receiver
- address (ra). The FWT can be inspected and edited with the following
- iwpriv commands, which are described in greater detail below.
- Eventually, the table will be automatically maintained by a custom
- routing protocol.
-
- NOTE: FWT commands replace the previous DFT commands. What were the DFT
- commands?, you might ask. They were an earlier API to the firmware that
- implemented a simple MAC-layer forwarding mechanism. In the unlikely
- event that you were using these commands, you must migrate to the new
- FWT commands which can be used to achieve the same functionality.
-
- iwpriv ethX fwt_add [parameters]
- iwpriv ethX fwt_del [parameters]
- iwpriv ethX fwt_lookup [parameters]
- iwpriv ethX fwt_list [parameters]
- iwpriv ethX fwt_list_route [parameters]
- iwpriv ethX fwt_list_neigh [parameters]
- iwpriv ethX fwt_reset [parameters]
- iwpriv ethX fwt_cleanup
- iwpriv ethX fwt_time
-
-MESH Commands:
-
- The MESH commands are used to configure various features of the mesh
- routing protocol. The following commands are supported:
-
- iwpriv ethX mesh_get_ttl
- iwpriv ethX mesh_set_ttl ttl
-
-DESCRIPTION
- Those commands are used to send additional commands to the Marvell WLAN
- card via the Linux device driver.
-
- The ethX parameter specifies the network device that is to be used to
- perform this command on. it could be eth0, eth1 etc.
-
-setregioncode
- This command is used to set the region code in the station.
- where value is 'region code' for various regions like
- USA FCC, Canada IC, Spain, France, Europe ETSI, Japan ...
-
- Usage:
- iwpriv ethX setregioncode 0x10: set region code to USA (0x10).
-
-getregioncode
- This command is used to get the region code information set in the
- station.
-
-ledgpio
- This command is used to set/get LEDs.
-
- iwpriv ethX ledgpio <LEDs>
- will set the corresponding LED for the GPIO Line.
-
- iwpriv ethX ledgpio
- will give u which LEDs are Enabled.
-
- Usage:
- iwpriv eth1 ledgpio 1 0 2 1 3 4
- will enable
- LED 1 -> GPIO 0
- LED 2 -> GPIO 1
- LED 3 -> GPIO 4
-
- iwpriv eth1 ledgpio
- shows LED information in the format as mentioned above.
-
- Note: LED0 is invalid
- Note: Maximum Number of LEDs are 16.
-
-fwt_add
- This command is used to insert an entry into the FWT table. The list of
- parameters must follow the following structure:
-
- iwpriv ethX fwt_add da ra [metric dir rate ssn dsn hopcount ttl expiration sleepmode snr]
-
- The parameters between brackets are optional, but they must appear in
- the order specified. For example, if you want to specify the metric,
- you must also specify the dir, ssn, and dsn but you need not specify the
- hopcount, expiration, sleepmode, or snr. Any unspecified parameters
- will be assigned the defaults specified below.
-
- The different parameters are:-
- da -- DA MAC address in the form 00:11:22:33:44:55
- ra -- RA MAC address in the form 00:11:22:33:44:55
- metric -- route metric (cost: smaller-metric routes are
- preferred, default is 0)
- dir -- direction (1 for direct, 0 for reverse,
- default is 1)
- rate -- data rate used for transmission to the RA,
- as specified for the rateadapt command,
- default is 3 (11Mbps)
- ssn -- Source Sequence Number (time at the RA for
- reverse routes. Default is 0)
- dsn -- Destination Sequence Number (time at the DA
- for direct routes. Default is 0)
- hopcount -- hop count (currently unused, default is 0)
- ttl -- TTL (Only used in reverse entries)
- expiration -- entry expiration (in ticks, where a tick is
- 1024us, or ~ 1ms. Use 0 for an indefinite
- entry, default is 0)
- sleepmode -- RA's sleep mode (currently unused, default is
- 0)
- snr -- SNR in the link to RA (currently unused,
- default is 0)
-
- The command does not return anything.
-
-fwt_del
- This command is used to remove an entry to the FWT table. The list of
- parameters must follow the following structure:
-
- iwpriv ethX fwt_del da ra [dir]
-
- where the different parameters are:-
- da -- DA MAC address (in the form "00:11:22:33:44:55")
- ra -- RA MAC address (in the form "00:11:22:33:44:55")
- dir -- direction (1 for direct, 0 for reverse,
- default is 1)
-
- The command does not return anything.
-
-fwt_lookup
- This command is used to get the best route in the FWT table to a given
- host. The only parameter is the MAC address of the host that is being
- looked for.
-
- iwpriv ethX fwt_lookup da
-
- where:-
- da -- DA MAC address (in the form "00:11:22:33:44:55")
-
- The command returns an output string identical to the one returned by
- fwt_list described below.
-
-
-fwt_list
- This command is used to list a route from the FWT table. The only
- parameter is the index into the table. If you want to list all the
- routes in a table, start with index=0, and keep listing until you get a
- "(null)" string. Note that the indicies may change as the fwt is
- updated. It is expected that most users will not use fwt_list directly,
- but that a utility similar to the traditional route command will be used
- to invoke fwt_list over and over.
-
- iwpriv ethX fwt_list index
-
- The output is a string of the following form:
-
- da ra valid metric dir rate ssn dsn hopcount ttl expiration
- sleepmode snr precursor
-
- where the different fields are:-
- da -- DA MAC address (in the form "00:11:22:33:44:55")
- ra -- RA MAC address (in the form "00:11:22:33:44:55")
- valid -- whether the route is valid (0 if not valid)
- metric -- route metric (cost: smaller-metric routes are preferred)
- dir -- direction (1 for direct, 0 for reverse)
- rate -- data rate used for transmission to the RA,
- as specified for the rateadapt command
- ssn -- Source Sequence Number (time at the RA for reverse routes)
- dsn -- Destination Sequence Number (time at the DA for direct routes)
- hopcount -- hop count (currently unused)
- ttl -- TTL (only used in reverse entries)
- expiration -- entry expiration (in ticks, where a tick is 1024us, or ~ 1ms. Use 0 for an indefinite entry)
- sleepmode -- RA's sleep mode (currently unused)
- snr -- SNR in the link to RA (currently unused)
- precursor -- predecessor in direct routes
-
-fwt_list_route
- This command is equivalent to fwt_list.
-
-fwt_list_neigh
- This command is used to list a neighbor from the FWT table. The only
- parameter is the neighbor ID. If you want to list all the neighbors in a
- table, start with nid=0, and keep incrementing nid until you get a
- "(null)" string. Note that the nid from a fwt_list_route command can be
- used as an input to this command. Also note that this command is meant
- mostly for debugging. It is expected that users will use fwt_lookup.
- One important reason for this is that the neighbor id may change as the
- neighbor table is altered.
-
- iwpriv ethX fwt_list_neigh nid
-
- The output is a string of the following form:
-
- ra sleepmode snr references
-
- where the different fields are:-
- ra -- RA MAC address (in the form "00:11:22:33:44:55")
- sleepmode -- RA's sleep mode (currently unused)
- snr -- SNR in the link to RA (currently unused)
- references -- RA's reference counter
-
-fwt_reset
- This command is used to reset the FWT table, getting rid of all the
- entries. There are no input parameters.
-
- iwpriv ethX fwt_reset
-
- The command does not return anything.
-
-fwt_cleanup
- This command is used to perform user-based garbage recollection. The
- FWT table is checked, and all the entries that are expired or invalid
- are cleaned. Note that this is exported to the driver for debugging
- purposes, as garbage collection is also fired by the firmware when in
- space problems. There are no input parameters.
-
- iwpriv ethX fwt_cleanup
-
- The command does returns the number of invalid/expired routes deleted.
-
-fwt_time
- This command returns a card's internal time representation. It is this
- time that is used to represent the expiration times of FWT entries. The
- number is not consistent from card to card; it is simply a timer count.
- The fwt_time command is used to inspect the timer so that expiration
- times reported by fwt_list can be properly interpreted.
-
- iwpriv ethX fwt_time
-
-mesh_get_ttl
-
- The mesh ttl is the number of hops a mesh packet can traverse before it
- is dropped. This parameter is used to prevent infinite loops in the
- mesh network. The value returned by this function is the ttl assigned
- to all mesh packets. Currently there is no way to control the ttl on a
- per packet or per socket basis.
-
- iwpriv ethX mesh_get_ttl
-
-mesh_set_ttl ttl
-
- Set the ttl. The argument must be between 0 and 255.
-
- iwpriv ethX mesh_set_ttl <ttl>
-
=========================
ETHTOOL
=========================
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index f67efa0..afd5617 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -323,6 +323,8 @@ static int assoc_helper_secinfo(wlan_private *priv,
{
wlan_adapter *adapter = priv->adapter;
int ret = 0;
+ u32 do_wpa;
+ u32 rsn = 0;
lbs_deb_enter(LBS_DEB_ASSOC);
@@ -333,12 +335,34 @@ static int assoc_helper_secinfo(wlan_private *priv,
if (ret)
goto out;
- /* enable/disable RSN */
+ /* If RSN is already enabled, don't try to enable it again, since
+ * ENABLE_RSN resets internal state machines and will clobber the
+ * 4-way WPA handshake.
+ */
+
+ /* Get RSN enabled/disabled */
ret = libertas_prepare_and_send_command(priv,
cmd_802_11_enable_rsn,
cmd_act_set,
cmd_option_waitforrsp,
- 0, assoc_req);
+ 0, &rsn);
+ if (ret) {
+ lbs_deb_assoc("Failed to get RSN status: %d", ret);
+ goto out;
+ }
+
+ /* Don't re-enable RSN if it's already enabled */
+ do_wpa = (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled);
+ if (do_wpa == rsn)
+ goto out;
+
+ /* Set RSN enabled/disabled */
+ rsn = do_wpa;
+ ret = libertas_prepare_and_send_command(priv,
+ cmd_802_11_enable_rsn,
+ cmd_act_set,
+ cmd_option_waitforrsp,
+ 0, &rsn);
out:
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 124e029..13f6528 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -228,17 +228,19 @@ static int wlan_cmd_802_11_enable_rsn(wlan_private * priv,
void * pdata_buf)
{
struct cmd_ds_802_11_enable_rsn *penableRSN = &cmd->params.enbrsn;
- struct assoc_request * assoc_req = pdata_buf;
+ u32 * enable = pdata_buf;
lbs_deb_enter(LBS_DEB_CMD);
cmd->command = cpu_to_le16(cmd_802_11_enable_rsn);
cmd->size = cpu_to_le16(sizeof(*penableRSN) + S_DS_GEN);
penableRSN->action = cpu_to_le16(cmd_action);
- if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) {
- penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
- } else {
- penableRSN->enable = cpu_to_le16(cmd_disable_rsn);
+
+ if (cmd_action == cmd_act_set) {
+ if (*enable)
+ penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
+ else
+ penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
}
lbs_deb_leave(LBS_DEB_CMD);
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 0c3b9a5..6ac0d47 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -537,6 +537,24 @@ static int wlan_ret_get_log(wlan_private * priv,
return 0;
}
+static int libertas_ret_802_11_enable_rsn(wlan_private * priv,
+ struct cmd_ds_command *resp)
+{
+ struct cmd_ds_802_11_enable_rsn *enable_rsn = &resp->params.enbrsn;
+ wlan_adapter *adapter = priv->adapter;
+ u32 * pdata_buf = adapter->cur_cmd->pdata_buf;
+
+ lbs_deb_enter(LBS_DEB_CMD);
+
+ if (enable_rsn->action == cpu_to_le16(cmd_act_get)) {
+ if (pdata_buf)
+ *pdata_buf = (u32) le16_to_cpu(enable_rsn->enable);
+ }
+
+ lbs_deb_enter(LBS_DEB_CMD);
+ return 0;
+}
+
static inline int handle_cmd_response(u16 respcmd,
struct cmd_ds_command *resp,
wlan_private *priv)
@@ -610,7 +628,10 @@ static inline int handle_cmd_response(u16 respcmd,
case cmd_ret_802_11_authenticate:
case cmd_ret_802_11_radio_control:
case cmd_ret_802_11_beacon_stop:
+ break;
+
case cmd_ret_802_11_enable_rsn:
+ ret = libertas_ret_802_11_enable_rsn(priv, resp);
break;
case cmd_ret_802_11_data_rate:
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index 3acf939..09b898f 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -503,7 +503,7 @@ struct cmd_ds_802_11_ad_hoc_join {
struct cmd_ds_802_11_enable_rsn {
__le16 action;
__le16 enable;
-};
+} __attribute__ ((packed));
struct MrvlIEtype_keyParamSet {
/* type ID */
diff --git a/drivers/net/wireless/libertas/ioctl.c b/drivers/net/wireless/libertas/ioctl.c
deleted file mode 100644
index f410815..0000000
--- a/drivers/net/wireless/libertas/ioctl.c
+++ /dev/null
@@ -1,1081 +0,0 @@
-/**
- * This file contains ioctl functions
- */
-
-#include <linux/ctype.h>
-#include <linux/delay.h>
-#include <linux/if.h>
-#include <linux/if_arp.h>
-#include <linux/wireless.h>
-
-#include <net/iw_handler.h>
-#include <net/ieee80211.h>
-
-#include "host.h"
-#include "radiotap.h"
-#include "decl.h"
-#include "defs.h"
-#include "dev.h"
-#include "join.h"
-#include "wext.h"
-
-#define MAX_SCAN_CELL_SIZE (IW_EV_ADDR_LEN + \
- IW_ESSID_MAX_SIZE + \
- IW_EV_UINT_LEN + IW_EV_FREQ_LEN + \
- IW_EV_QUAL_LEN + IW_ESSID_MAX_SIZE + \
- IW_EV_PARAM_LEN + 40) /* 40 for WPAIE */
-
-#define WAIT_FOR_SCAN_RRESULT_MAX_TIME (10 * HZ)
-
-static int wlan_set_region(wlan_private * priv, u16 region_code)
-{
- int i;
- int ret = 0;
-
- for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
- // use the region code to search for the index
- if (region_code == libertas_region_code_to_index[i]) {
- priv->adapter->regiontableindex = (u16) i;
- priv->adapter->regioncode = region_code;
- break;
- }
- }
-
- // if it's unidentified region code
- if (i >= MRVDRV_MAX_REGION_CODE) {
- lbs_deb_ioctl("region Code not identified\n");
- ret = -1;
- goto done;
- }
-
- if (libertas_set_regiontable(priv, priv->adapter->regioncode, 0)) {
- ret = -EINVAL;
- }
-
-done:
- lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
- return ret;
-}
-
-static inline int hex2int(char c)
-{
- if (c >= '0' && c <= '9')
- return (c - '0');
- if (c >= 'a' && c <= 'f')
- return (c - 'a' + 10);
- if (c >= 'A' && c <= 'F')
- return (c - 'A' + 10);
- return -1;
-}
-
-/* Convert a string representation of a MAC address ("xx:xx:xx:xx:xx:xx")
- into binary format (6 bytes).
-
- This function expects that each byte is represented with 2 characters
- (e.g., 11:2:11:11:11:11 is invalid)
-
- */
-static char *eth_str2addr(char *ethstr, u8 * addr)
-{
- int i, val, val2;
- char *pos = ethstr;
-
- /* get rid of initial blanks */
- while (*pos == ' ' || *pos == '\t')
- ++pos;
-
- for (i = 0; i < 6; i++) {
- val = hex2int(*pos++);
- if (val < 0)
- return NULL;
- val2 = hex2int(*pos++);
- if (val2 < 0)
- return NULL;
- addr[i] = (val * 16 + val2) & 0xff;
-
- if (i < 5 && *pos++ != ':')
- return NULL;
- }
- return pos;
-}
-
-/* this writes xx:xx:xx:xx:xx:xx into ethstr
- (ethstr must have space for 18 chars) */
-static int eth_addr2str(u8 * addr, char *ethstr)
-{
- int i;
- char *pos = ethstr;
-
- for (i = 0; i < 6; i++) {
- sprintf(pos, "%02x", addr[i] & 0xff);
- pos += 2;
- if (i < 5)
- *pos++ = ':';
- }
- return 17;
-}
-
-/**
- * @brief Add an entry to the BT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- char ethaddrs_str[18];
- char *pos;
- u8 ethaddr[ETH_ALEN];
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(ethaddrs_str, wrq->u.data.pointer,
- sizeof(ethaddrs_str)))
- return -EFAULT;
-
- if ((pos = eth_str2addr(ethaddrs_str, ethaddr)) == NULL) {
- lbs_pr_info("BT_ADD: Invalid MAC address\n");
- return -EINVAL;
- }
-
- lbs_deb_ioctl("BT: adding %s\n", ethaddrs_str);
- ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
- cmd_act_bt_access_add,
- cmd_option_waitforrsp, 0, ethaddr);
- lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
- return ret;
-}
-
-/**
- * @brief Delete an entry from the BT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- char ethaddrs_str[18];
- u8 ethaddr[ETH_ALEN];
- char *pos;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(ethaddrs_str, wrq->u.data.pointer,
- sizeof(ethaddrs_str)))
- return -EFAULT;
-
- if ((pos = eth_str2addr(ethaddrs_str, ethaddr)) == NULL) {
- lbs_pr_info("Invalid MAC address\n");
- return -EINVAL;
- }
-
- lbs_deb_ioctl("BT: deleting %s\n", ethaddrs_str);
-
- return (libertas_prepare_and_send_command(priv,
- cmd_bt_access,
- cmd_act_bt_access_del,
- cmd_option_waitforrsp, 0, ethaddr));
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief Reset all entries from the BT table
- * @param priv A pointer to wlan_private structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_bt_reset_ioctl(wlan_private * priv)
-{
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- lbs_pr_alert( "BT: resetting\n");
-
- return (libertas_prepare_and_send_command(priv,
- cmd_bt_access,
- cmd_act_bt_access_reset,
- cmd_option_waitforrsp, 0, NULL));
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief List an entry from the BT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req)
-{
- int pos;
- char *addr1;
- struct iwreq *wrq = (struct iwreq *)req;
- /* used to pass id and store the bt entry returned by the FW */
- union {
- u32 id;
- char addr1addr2[2 * ETH_ALEN];
- } param;
- static char outstr[64];
- char *pbuf = outstr;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(outstr, wrq->u.data.pointer, sizeof(outstr))) {
- lbs_deb_ioctl("Copy from user failed\n");
- return -1;
- }
- param.id = simple_strtoul(outstr, NULL, 10);
- pos = sprintf(pbuf, "%d: ", param.id);
- pbuf += pos;
-
- ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
- cmd_act_bt_access_list,
- cmd_option_waitforrsp, 0,
- (char *)¶m);
-
- if (ret == 0) {
- addr1 = param.addr1addr2;
-
- pos = sprintf(pbuf, "BT includes node ");
- pbuf += pos;
- pos = eth_addr2str(addr1, pbuf);
- pbuf += pos;
- } else {
- sprintf(pbuf, "(null)");
- pbuf += pos;
- }
-
- wrq->u.data.length = strlen(outstr);
- if (copy_to_user(wrq->u.data.pointer, (char *)outstr,
- wrq->u.data.length)) {
- lbs_deb_ioctl("BT_LIST: Copy to user failed!\n");
- return -EFAULT;
- }
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0 ;
-}
-
-/**
- * @brief Sets inverted state of blacklist (non-zero if inverted)
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_bt_set_invert_ioctl(wlan_private * priv, struct ifreq *req)
-{
- int ret;
- struct iwreq *wrq = (struct iwreq *)req;
- union {
- u32 id;
- char addr1addr2[2 * ETH_ALEN];
- } param;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- param.id = SUBCMD_DATA(wrq) ;
- ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
- cmd_act_bt_access_set_invert,
- cmd_option_waitforrsp, 0,
- (char *)¶m);
- if (ret != 0)
- return -EFAULT;
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief Gets inverted state of blacklist (non-zero if inverted)
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_bt_get_invert_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- int ret;
- union {
- u32 id;
- char addr1addr2[2 * ETH_ALEN];
- } param;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
- cmd_act_bt_access_get_invert,
- cmd_option_waitforrsp, 0,
- (char *)¶m);
-
- if (ret == 0)
- wrq->u.param.value = le32_to_cpu(param.id);
- else
- return -EFAULT;
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief Find the next parameter in an input string
- * @param ptr A pointer to the input parameter string
- * @return A pointer to the next parameter, or 0 if no parameters left.
- */
-static char * next_param(char * ptr)
-{
- if (!ptr) return NULL;
- while (*ptr == ' ' || *ptr == '\t') ++ptr;
- return (*ptr == '\0') ? NULL : ptr;
-}
-
-/**
- * @brief Add an entry to the FWT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- char in_str[128];
- static struct cmd_ds_fwt_access fwt_access;
- char *ptr;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
- return -EFAULT;
-
- if ((ptr = eth_str2addr(in_str, fwt_access.da)) == NULL) {
- lbs_pr_alert( "FWT_ADD: Invalid MAC address 1\n");
- return -EINVAL;
- }
-
- if ((ptr = eth_str2addr(ptr, fwt_access.ra)) == NULL) {
- lbs_pr_alert( "FWT_ADD: Invalid MAC address 2\n");
- return -EINVAL;
- }
-
- if ((ptr = next_param(ptr)))
- fwt_access.metric =
- cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
- else
- fwt_access.metric = cpu_to_le32(FWT_DEFAULT_METRIC);
-
- if ((ptr = next_param(ptr)))
- fwt_access.dir = (u8)simple_strtoul(ptr, &ptr, 10);
- else
- fwt_access.dir = FWT_DEFAULT_DIR;
-
- if ((ptr = next_param(ptr)))
- fwt_access.rate = (u8) simple_strtoul(ptr, &ptr, 10);
- else
- fwt_access.rate = FWT_DEFAULT_RATE;
-
- if ((ptr = next_param(ptr)))
- fwt_access.ssn =
- cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
- else
- fwt_access.ssn = cpu_to_le32(FWT_DEFAULT_SSN);
-
- if ((ptr = next_param(ptr)))
- fwt_access.dsn =
- cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
- else
- fwt_access.dsn = cpu_to_le32(FWT_DEFAULT_DSN);
-
- if ((ptr = next_param(ptr)))
- fwt_access.hopcount = simple_strtoul(ptr, &ptr, 10);
- else
- fwt_access.hopcount = FWT_DEFAULT_HOPCOUNT;
-
- if ((ptr = next_param(ptr)))
- fwt_access.ttl = simple_strtoul(ptr, &ptr, 10);
- else
- fwt_access.ttl = FWT_DEFAULT_TTL;
-
- if ((ptr = next_param(ptr)))
- fwt_access.expiration =
- cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
- else
- fwt_access.expiration = cpu_to_le32(FWT_DEFAULT_EXPIRATION);
-
- if ((ptr = next_param(ptr)))
- fwt_access.sleepmode = (u8)simple_strtoul(ptr, &ptr, 10);
- else
- fwt_access.sleepmode = FWT_DEFAULT_SLEEPMODE;
-
- if ((ptr = next_param(ptr)))
- fwt_access.snr =
- cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
- else
- fwt_access.snr = cpu_to_le32(FWT_DEFAULT_SNR);
-
-#ifdef DEBUG
- {
- char ethaddr1_str[18], ethaddr2_str[18];
- eth_addr2str(fwt_access.da, ethaddr1_str);
- eth_addr2str(fwt_access.ra, ethaddr2_str);
- lbs_deb_ioctl("FWT_ADD: adding (da:%s,%i,ra:%s)\n", ethaddr1_str,
- fwt_access.dir, ethaddr2_str);
- lbs_deb_ioctl("FWT_ADD: ssn:%u dsn:%u met:%u hop:%u ttl:%u exp:%u slp:%u snr:%u\n",
- fwt_access.ssn, fwt_access.dsn, fwt_access.metric,
- fwt_access.hopcount, fwt_access.ttl, fwt_access.expiration,
- fwt_access.sleepmode, fwt_access.snr);
- }
-#endif
-
- ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
- cmd_act_fwt_access_add,
- cmd_option_waitforrsp, 0,
- (void *)&fwt_access);
-
- lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
- return ret;
-}
-
-/**
- * @brief Delete an entry from the FWT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- char in_str[64];
- static struct cmd_ds_fwt_access fwt_access;
- char *ptr;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
- return -EFAULT;
-
- if ((ptr = eth_str2addr(in_str, fwt_access.da)) == NULL) {
- lbs_pr_alert( "FWT_DEL: Invalid MAC address 1\n");
- return -EINVAL;
- }
-
- if ((ptr = eth_str2addr(ptr, fwt_access.ra)) == NULL) {
- lbs_pr_alert( "FWT_DEL: Invalid MAC address 2\n");
- return -EINVAL;
- }
-
- if ((ptr = next_param(ptr)))
- fwt_access.dir = (u8)simple_strtoul(ptr, &ptr, 10);
- else
- fwt_access.dir = FWT_DEFAULT_DIR;
-
-#ifdef DEBUG
- {
- char ethaddr1_str[18], ethaddr2_str[18];
- lbs_deb_ioctl("FWT_DEL: line is %s\n", in_str);
- eth_addr2str(fwt_access.da, ethaddr1_str);
- eth_addr2str(fwt_access.ra, ethaddr2_str);
- lbs_deb_ioctl("FWT_DEL: removing (da:%s,ra:%s,dir:%d)\n", ethaddr1_str,
- ethaddr2_str, fwt_access.dir);
- }
-#endif
-
- ret = libertas_prepare_and_send_command(priv,
- cmd_fwt_access,
- cmd_act_fwt_access_del,
- cmd_option_waitforrsp, 0,
- (void *)&fwt_access);
- lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
- return ret;
-}
-
-
-/**
- * @brief Print route parameters
- * @param fwt_access struct cmd_ds_fwt_access with route info
- * @param buf destination buffer for route info
- */
-static void print_route(struct cmd_ds_fwt_access fwt_access, char *buf)
-{
- buf += sprintf(buf, " ");
- buf += eth_addr2str(fwt_access.da, buf);
- buf += sprintf(buf, " ");
- buf += eth_addr2str(fwt_access.ra, buf);
- buf += sprintf(buf, " %u", fwt_access.valid);
- buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.metric));
- buf += sprintf(buf, " %u", fwt_access.dir);
- buf += sprintf(buf, " %u", fwt_access.rate);
- buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.ssn));
- buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.dsn));
- buf += sprintf(buf, " %u", fwt_access.hopcount);
- buf += sprintf(buf, " %u", fwt_access.ttl);
- buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.expiration));
- buf += sprintf(buf, " %u", fwt_access.sleepmode);
- buf += sprintf(buf, " %u ", le32_to_cpu(fwt_access.snr));
- buf += eth_addr2str(fwt_access.prec, buf);
-}
-
-/**
- * @brief Lookup an entry in the FWT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- char in_str[64];
- char *ptr;
- static struct cmd_ds_fwt_access fwt_access;
- static char out_str[128];
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
- return -EFAULT;
-
- if ((ptr = eth_str2addr(in_str, fwt_access.da)) == NULL) {
- lbs_pr_alert( "FWT_LOOKUP: Invalid MAC address\n");
- return -EINVAL;
- }
-
-#ifdef DEBUG
- {
- char ethaddr1_str[18];
- lbs_deb_ioctl("FWT_LOOKUP: line is %s\n", in_str);
- eth_addr2str(fwt_access.da, ethaddr1_str);
- lbs_deb_ioctl("FWT_LOOKUP: looking for (da:%s)\n", ethaddr1_str);
- }
-#endif
-
- ret = libertas_prepare_and_send_command(priv,
- cmd_fwt_access,
- cmd_act_fwt_access_lookup,
- cmd_option_waitforrsp, 0,
- (void *)&fwt_access);
-
- if (ret == 0)
- print_route(fwt_access, out_str);
- else
- sprintf(out_str, "(null)");
-
- wrq->u.data.length = strlen(out_str);
- if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
- wrq->u.data.length)) {
- lbs_deb_ioctl("FWT_LOOKUP: Copy to user failed!\n");
- return -EFAULT;
- }
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief Reset all entries from the FWT table
- * @param priv A pointer to wlan_private structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_reset_ioctl(wlan_private * priv)
-{
- lbs_deb_ioctl("FWT: resetting\n");
-
- return (libertas_prepare_and_send_command(priv,
- cmd_fwt_access,
- cmd_act_fwt_access_reset,
- cmd_option_waitforrsp, 0, NULL));
-}
-
-/**
- * @brief List an entry from the FWT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- char in_str[8];
- static struct cmd_ds_fwt_access fwt_access;
- char *ptr = in_str;
- static char out_str[128];
- char *pbuf = out_str;
- int ret = 0;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) {
- ret = -EFAULT;
- goto out;
- }
-
- fwt_access.id = cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
-
-#ifdef DEBUG
- {
- lbs_deb_ioctl("FWT_LIST: line is %s\n", in_str);
- lbs_deb_ioctl("FWT_LIST: listing id:%i\n", le32_to_cpu(fwt_access.id));
- }
-#endif
-
- ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
- cmd_act_fwt_access_list,
- cmd_option_waitforrsp, 0, (void *)&fwt_access);
-
- if (ret == 0)
- print_route(fwt_access, pbuf);
- else
- pbuf += sprintf(pbuf, " (null)");
-
- wrq->u.data.length = strlen(out_str);
- if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
- wrq->u.data.length)) {
- lbs_deb_ioctl("FWT_LIST: Copy to user failed!\n");
- ret = -EFAULT;
- goto out;
- }
-
- ret = 0;
-
-out:
- lbs_deb_leave(LBS_DEB_IOCTL);
- return ret;
-}
-
-/**
- * @brief List an entry from the FRT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- char in_str[64];
- static struct cmd_ds_fwt_access fwt_access;
- char *ptr = in_str;
- static char out_str[128];
- char *pbuf = out_str;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
- return -EFAULT;
-
- fwt_access.id = cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
-
-#ifdef DEBUG
- {
- lbs_deb_ioctl("FWT_LIST_ROUTE: line is %s\n", in_str);
- lbs_deb_ioctl("FWT_LIST_ROUTE: listing id:%i\n", le32_to_cpu(fwt_access.id));
- }
-#endif
-
- ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
- cmd_act_fwt_access_list_route,
- cmd_option_waitforrsp, 0, (void *)&fwt_access);
-
- if (ret == 0) {
- print_route(fwt_access, pbuf);
- } else
- pbuf += sprintf(pbuf, " (null)");
-
- wrq->u.data.length = strlen(out_str);
- if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
- wrq->u.data.length)) {
- lbs_deb_ioctl("FWT_LIST_ROUTE: Copy to user failed!\n");
- return -EFAULT;
- }
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief List an entry from the FNT table
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- char in_str[8];
- static struct cmd_ds_fwt_access fwt_access;
- char *ptr = in_str;
- static char out_str[128];
- char *pbuf = out_str;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
- return -EFAULT;
-
- memset(&fwt_access, 0, sizeof(fwt_access));
- fwt_access.id = cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
-
-#ifdef DEBUG
- {
- lbs_deb_ioctl("FWT_LIST_NEIGHBOR: line is %s\n", in_str);
- lbs_deb_ioctl("FWT_LIST_NEIGHBOR: listing id:%i\n", le32_to_cpu(fwt_access.id));
- }
-#endif
-
- ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
- cmd_act_fwt_access_list_neighbor,
- cmd_option_waitforrsp, 0,
- (void *)&fwt_access);
-
- if (ret == 0) {
- pbuf += sprintf(pbuf, " ra ");
- pbuf += eth_addr2str(fwt_access.ra, pbuf);
- pbuf += sprintf(pbuf, " slp %u", fwt_access.sleepmode);
- pbuf += sprintf(pbuf, " snr %u", le32_to_cpu(fwt_access.snr));
- pbuf += sprintf(pbuf, " ref %u", le32_to_cpu(fwt_access.references));
- } else
- pbuf += sprintf(pbuf, " (null)");
-
- wrq->u.data.length = strlen(out_str);
- if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
- wrq->u.data.length)) {
- lbs_deb_ioctl("FWT_LIST_NEIGHBOR: Copy to user failed!\n");
- return -EFAULT;
- }
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief Cleans up the route (FRT) and neighbor (FNT) tables
- * (Garbage Collection)
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- static struct cmd_ds_fwt_access fwt_access;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- lbs_deb_ioctl("FWT: cleaning up\n");
-
- memset(&fwt_access, 0, sizeof(fwt_access));
-
- ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
- cmd_act_fwt_access_cleanup,
- cmd_option_waitforrsp, 0,
- (void *)&fwt_access);
-
- if (ret == 0)
- wrq->u.param.value = le32_to_cpu(fwt_access.references);
- else
- return -EFAULT;
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief Gets firmware internal time (debug purposes)
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- static struct cmd_ds_fwt_access fwt_access;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- lbs_deb_ioctl("FWT: getting time\n");
-
- memset(&fwt_access, 0, sizeof(fwt_access));
-
- ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
- cmd_act_fwt_access_time,
- cmd_option_waitforrsp, 0,
- (void *)&fwt_access);
-
- if (ret == 0)
- wrq->u.param.value = le32_to_cpu(fwt_access.references);
- else
- return -EFAULT;
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief Gets mesh ttl from firmware
- * @param priv A pointer to wlan_private structure
- * @param req A pointer to ifreq structure
- * @return 0 --success, otherwise fail
- */
-static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req)
-{
- struct iwreq *wrq = (struct iwreq *)req;
- struct cmd_ds_mesh_access mesh_access;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- memset(&mesh_access, 0, sizeof(mesh_access));
-
- ret = libertas_prepare_and_send_command(priv, cmd_mesh_access,
- cmd_act_mesh_get_ttl,
- cmd_option_waitforrsp, 0,
- (void *)&mesh_access);
-
- if (ret == 0)
- wrq->u.param.value = le32_to_cpu(mesh_access.data[0]);
- else
- return -EFAULT;
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return 0;
-}
-
-/**
- * @brief Gets mesh ttl from firmware
- * @param priv A pointer to wlan_private structure
- * @param ttl New ttl value
- * @return 0 --success, otherwise fail
- */
-static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl)
-{
- struct cmd_ds_mesh_access mesh_access;
- int ret;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- if( (ttl > 0xff) || (ttl < 0) )
- return -EINVAL;
-
- memset(&mesh_access, 0, sizeof(mesh_access));
- mesh_access.data[0] = cpu_to_le32(ttl);
-
- ret = libertas_prepare_and_send_command(priv, cmd_mesh_access,
- cmd_act_mesh_set_ttl,
- cmd_option_waitforrsp, 0,
- (void *)&mesh_access);
-
- if (ret != 0)
- ret = -EFAULT;
-
- lbs_deb_leave(LBS_DEB_IOCTL);
- return ret;
-}
-
-/**
- * @brief ioctl function - entry point
- *
- * @param dev A pointer to net_device structure
- * @param req A pointer to ifreq structure
- * @param cmd command
- * @return 0--success, otherwise fail
- */
-int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
-{
- int subcmd = 0;
- int idata = 0;
- int *pdata;
- int ret = 0;
- wlan_private *priv = dev->priv;
- wlan_adapter *adapter = priv->adapter;
- struct iwreq *wrq = (struct iwreq *)req;
-
- lbs_deb_enter(LBS_DEB_IOCTL);
-
- lbs_deb_ioctl("libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd);
- switch (cmd) {
- case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */
- switch (wrq->u.data.flags) {
- case WLAN_SUBCMD_BT_RESET: /* bt_reset */
- wlan_bt_reset_ioctl(priv);
- break;
- case WLAN_SUBCMD_FWT_RESET: /* fwt_reset */
- wlan_fwt_reset_ioctl(priv);
- break;
- } /* End of switch */
- break;
-
- case WLAN_SETONEINT_GETNONE:
- /* The first 4 bytes of req->ifr_data is sub-ioctl number
- * after 4 bytes sits the payload.
- */
- subcmd = wrq->u.data.flags;
- if (!subcmd)
- subcmd = (int)wrq->u.param.value;
-
- switch (subcmd) {
- case WLANSETREGION:
- idata = SUBCMD_DATA(wrq);
- ret = wlan_set_region(priv, (u16) idata);
- break;
- case WLAN_SUBCMD_MESH_SET_TTL:
- idata = SUBCMD_DATA(wrq);
- ret = wlan_mesh_set_ttl_ioctl(priv, idata);
- break;
-
- case WLAN_SUBCMD_BT_SET_INVERT:
- ret = wlan_bt_set_invert_ioctl(priv, req);
- break ;
-
- default:
- ret = -EOPNOTSUPP;
- break;
- }
-
- break;
-
- case WLAN_SET128CHAR_GET128CHAR:
- switch ((int)wrq->u.data.flags) {
- case WLAN_SUBCMD_BT_ADD:
- ret = wlan_bt_add_ioctl(priv, req);
- break;
- case WLAN_SUBCMD_BT_DEL:
- ret = wlan_bt_del_ioctl(priv, req);
- break;
- case WLAN_SUBCMD_BT_LIST:
- ret = wlan_bt_list_ioctl(priv, req);
- break;
- case WLAN_SUBCMD_FWT_ADD:
- ret = wlan_fwt_add_ioctl(priv, req);
- break;
- case WLAN_SUBCMD_FWT_DEL:
- ret = wlan_fwt_del_ioctl(priv, req);
- break;
- case WLAN_SUBCMD_FWT_LOOKUP:
- ret = wlan_fwt_lookup_ioctl(priv, req);
- break;
- case WLAN_SUBCMD_FWT_LIST_NEIGHBOR:
- ret = wlan_fwt_list_neighbor_ioctl(priv, req);
- break;
- case WLAN_SUBCMD_FWT_LIST:
- ret = wlan_fwt_list_ioctl(priv, req);
- break;
- case WLAN_SUBCMD_FWT_LIST_ROUTE:
- ret = wlan_fwt_list_route_ioctl(priv, req);
- break;
- }
- break;
-
- case WLAN_SETNONE_GETONEINT:
- switch (wrq->u.param.value) {
- case WLANGETREGION:
- pdata = (int *)wrq->u.name;
- *pdata = (int)adapter->regioncode;
- break;
- case WLAN_SUBCMD_FWT_CLEANUP: /* fwt_cleanup */
- ret = wlan_fwt_cleanup_ioctl(priv, req);
- break;
-
- case WLAN_SUBCMD_FWT_TIME: /* fwt_time */
- ret = wlan_fwt_time_ioctl(priv, req);
- break;
-
- case WLAN_SUBCMD_MESH_GET_TTL:
- ret = wlan_mesh_get_ttl_ioctl(priv, req);
- break;
-
- case WLAN_SUBCMD_BT_GET_INVERT:
- ret = wlan_bt_get_invert_ioctl(priv, req);
- break ;
-
- default:
- ret = -EOPNOTSUPP;
-
- }
-
- break;
-
- case WLAN_SET_GET_SIXTEEN_INT:
- switch ((int)wrq->u.data.flags) {
- case WLAN_LED_GPIO_CTRL:
- {
- int i;
- int data[16];
-
- struct cmd_ds_802_11_led_ctrl ctrl;
- struct mrvlietypes_ledgpio *gpio =
- (struct mrvlietypes_ledgpio *) ctrl.data;
-
- memset(&ctrl, 0, sizeof(ctrl));
- if (wrq->u.data.length > MAX_LEDS * 2)
- return -ENOTSUPP;
- if ((wrq->u.data.length % 2) != 0)
- return -ENOTSUPP;
- if (wrq->u.data.length == 0) {
- ctrl.action =
- cpu_to_le16
- (cmd_act_get);
- } else {
- if (copy_from_user
- (data, wrq->u.data.pointer,
- sizeof(int) *
- wrq->u.data.length)) {
- lbs_deb_ioctl(
- "Copy from user failed\n");
- return -EFAULT;
- }
-
- ctrl.action =
- cpu_to_le16
- (cmd_act_set);
- ctrl.numled = cpu_to_le16(0);
- gpio->header.type =
- cpu_to_le16(TLV_TYPE_LED_GPIO);
- gpio->header.len = wrq->u.data.length;
- for (i = 0; i < wrq->u.data.length;
- i += 2) {
- gpio->ledpin[i / 2].led =
- data[i];
- gpio->ledpin[i / 2].pin =
- data[i + 1];
- }
- }
- ret =
- libertas_prepare_and_send_command(priv,
- cmd_802_11_led_gpio_ctrl,
- 0,
- cmd_option_waitforrsp,
- 0, (void *)&ctrl);
- for (i = 0; i < gpio->header.len; i += 2) {
- data[i] = gpio->ledpin[i / 2].led;
- data[i + 1] = gpio->ledpin[i / 2].pin;
- }
- if (copy_to_user(wrq->u.data.pointer, data,
- sizeof(int) *
- gpio->header.len)) {
- lbs_deb_ioctl("Copy to user failed\n");
- return -EFAULT;
- }
-
- wrq->u.data.length = gpio->header.len;
- }
- break;
- }
- break;
-
- default:
- ret = -EINVAL;
- break;
- }
-
- lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
- return ret;
-}
-
-
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 623ab4b..4a59306 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -181,7 +181,8 @@ u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE] =
* @brief Get function for sysfs attribute anycast_mask
*/
static ssize_t libertas_anycast_get(struct device * dev,
- struct device_attribute *attr, char * buf) {
+ struct device_attribute *attr, char * buf)
+{
struct cmd_ds_mesh_access mesh_access;
memset(&mesh_access, 0, sizeof(mesh_access));
@@ -197,7 +198,8 @@ static ssize_t libertas_anycast_get(struct device * dev,
* @brief Set function for sysfs attribute anycast_mask
*/
static ssize_t libertas_anycast_set(struct device * dev,
- struct device_attribute *attr, const char * buf, size_t count) {
+ struct device_attribute *attr, const char * buf, size_t count)
+{
struct cmd_ds_mesh_access mesh_access;
uint32_t datum;
@@ -799,7 +801,6 @@ wlan_private *libertas_add_card(void *card, struct device *dmdev)
dev->open = wlan_open;
dev->hard_start_xmit = wlan_pre_start_xmit;
dev->stop = wlan_close;
- dev->do_ioctl = libertas_do_ioctl;
dev->set_mac_address = wlan_set_mac_address;
dev->tx_timeout = wlan_tx_timeout;
dev->get_stats = wlan_get_stats;
@@ -918,7 +919,6 @@ int libertas_add_mesh(wlan_private *priv, struct device *dev)
mesh_dev->open = mesh_open;
mesh_dev->hard_start_xmit = mesh_pre_start_xmit;
mesh_dev->stop = mesh_close;
- mesh_dev->do_ioctl = libertas_do_ioctl;
mesh_dev->get_stats = wlan_get_stats;
mesh_dev->set_mac_address = wlan_set_mac_address;
mesh_dev->ethtool_ops = &libertas_ethtool_ops;
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 606af50..c3043dc 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -215,38 +215,6 @@ done:
}
/**
- * @brief Post process the scan table after a new scan command has completed
- *
- * Inspect each entry of the scan table and try to find an entry that
- * matches our current associated/joined network from the scan. If
- * one is found, update the stored copy of the bssdescriptor for our
- * current network.
- *
- * Debug dump the current scan table contents if compiled accordingly.
- *
- * @param priv A pointer to wlan_private structure
- *
- * @return void
- */
-static void wlan_scan_process_results(wlan_private * priv)
-{
- wlan_adapter *adapter = priv->adapter;
- struct bss_descriptor * iter_bss;
- int i = 0;
-
- if (adapter->connect_status == libertas_connected)
- return;
-
- mutex_lock(&adapter->lock);
- list_for_each_entry (iter_bss, &adapter->network_list, list) {
- lbs_deb_scan("Scan:(%02d) " MAC_FMT ", RSSI[%03d], SSID[%s]\n",
- i++, MAC_ARG(iter_bss->bssid), (s32) iter_bss->rssi,
- escape_essid(iter_bss->ssid, iter_bss->ssid_len));
- }
- mutex_unlock(&adapter->lock);
-}
-
-/**
* @brief Create a channel list for the driver to scan based on region info
*
* Use the driver region/band information to construct a comprehensive list
@@ -791,6 +759,10 @@ int wlan_scan_networks(wlan_private * priv,
u8 scancurrentchanonly;
int maxchanperscan;
int ret;
+#ifdef CONFIG_LIBERTAS_DEBUG
+ struct bss_descriptor * iter_bss;
+ int i = 0;
+#endif
lbs_deb_enter(LBS_DEB_ASSOC);
@@ -832,11 +804,16 @@ int wlan_scan_networks(wlan_private * priv,
puserscanin,
full_scan);
- /* Process the resulting scan table:
- * - Remove any bad ssids
- * - Update our current BSS information from scan data
- */
- wlan_scan_process_results(priv);
+#ifdef CONFIG_LIBERTAS_DEBUG
+ /* Dump the scan table */
+ mutex_lock(&adapter->lock);
+ list_for_each_entry (iter_bss, &adapter->network_list, list) {
+ lbs_deb_scan("Scan:(%02d) " MAC_FMT ", RSSI[%03d], SSID[%s]\n",
+ i++, MAC_ARG(iter_bss->bssid), (s32) iter_bss->rssi,
+ escape_essid(iter_bss->ssid, iter_bss->ssid_len));
+ }
+ mutex_unlock(&adapter->lock);
+#endif
if (priv->adapter->connect_status == libertas_connected) {
netif_carrier_on(priv->dev);
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 8939251..f42b796 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -913,148 +913,6 @@ out:
return 0;
}
-/*
- * iwpriv settable callbacks
- */
-
-static const iw_handler wlan_private_handler[] = {
- NULL, /* SIOCIWFIRSTPRIV */
-};
-
-static const struct iw_priv_args wlan_private_args[] = {
- /*
- * { cmd, set_args, get_args, name }
- */
- /* Using iwpriv sub-command feature */
- {
- WLAN_SETONEINT_GETNONE, /* IOCTL: 24 */
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- IW_PRIV_TYPE_NONE,
- ""},
- {
- WLANSETREGION,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- IW_PRIV_TYPE_NONE,
- "setregioncode"},
- {
- WLAN_SUBCMD_MESH_SET_TTL,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- IW_PRIV_TYPE_NONE,
- "mesh_set_ttl"},
- {
- WLAN_SETNONE_GETONEINT,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- ""},
- {
- WLANGETREGION,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "getregioncode"},
- {
- WLAN_SUBCMD_FWT_CLEANUP,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "fwt_cleanup"},
- {
- WLAN_SUBCMD_FWT_TIME,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "fwt_time"},
- {
- WLAN_SUBCMD_MESH_GET_TTL,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "mesh_get_ttl"},
- {
- WLAN_SETNONE_GETNONE,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_NONE,
- ""},
- {
- WLAN_SUBCMD_FWT_RESET,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_NONE,
- "fwt_reset"},
- {
- WLAN_SUBCMD_BT_RESET,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_NONE,
- "bt_reset"},
- {
- WLAN_SET128CHAR_GET128CHAR,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- ""},
- /* BT Management */
- {
- WLAN_SUBCMD_BT_ADD,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "bt_add"},
- {
- WLAN_SUBCMD_BT_DEL,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "bt_del"},
- {
- WLAN_SUBCMD_BT_LIST,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "bt_list"},
- {
- WLAN_SUBCMD_BT_SET_INVERT,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- IW_PRIV_TYPE_NONE,
- "bt_set_invert"},
- {
- WLAN_SUBCMD_BT_GET_INVERT,
- IW_PRIV_TYPE_NONE,
- IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
- "bt_get_invert"},
- /* FWT Management */
- {
- WLAN_SUBCMD_FWT_ADD,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "fwt_add"},
- {
- WLAN_SUBCMD_FWT_DEL,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "fwt_del"},
- {
- WLAN_SUBCMD_FWT_LOOKUP,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "fwt_lookup"},
- {
- WLAN_SUBCMD_FWT_LIST_NEIGHBOR,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "fwt_list_neigh"},
- {
- WLAN_SUBCMD_FWT_LIST,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "fwt_list"},
- {
- WLAN_SUBCMD_FWT_LIST_ROUTE,
- IW_PRIV_TYPE_CHAR | 128,
- IW_PRIV_TYPE_CHAR | 128,
- "fwt_list_route"},
- {
- WLAN_SET_GET_SIXTEEN_INT,
- IW_PRIV_TYPE_INT | 16,
- IW_PRIV_TYPE_INT | 16,
- ""},
- {
- WLAN_LED_GPIO_CTRL,
- IW_PRIV_TYPE_INT | 16,
- IW_PRIV_TYPE_INT | 16,
- "ledgpio"},
-};
-
static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
{
enum {
@@ -2444,22 +2302,12 @@ static const iw_handler mesh_wlan_handler[] = {
};
struct iw_handler_def libertas_handler_def = {
.num_standard = sizeof(wlan_handler) / sizeof(iw_handler),
- .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler),
- .num_private_args = sizeof(wlan_private_args) /
- sizeof(struct iw_priv_args),
.standard = (iw_handler *) wlan_handler,
- .private = (iw_handler *) wlan_private_handler,
- .private_args = (struct iw_priv_args *)wlan_private_args,
.get_wireless_stats = wlan_get_wireless_stats,
};
struct iw_handler_def mesh_handler_def = {
.num_standard = sizeof(mesh_wlan_handler) / sizeof(iw_handler),
- .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler),
- .num_private_args = sizeof(wlan_private_args) /
- sizeof(struct iw_priv_args),
.standard = (iw_handler *) mesh_wlan_handler,
- .private = (iw_handler *) wlan_private_handler,
- .private_args = (struct iw_priv_args *)wlan_private_args,
.get_wireless_stats = wlan_get_wireless_stats,
};
diff --git a/drivers/net/wireless/libertas/wext.h b/drivers/net/wireless/libertas/wext.h
index d555056..3d5196c 100644
--- a/drivers/net/wireless/libertas/wext.h
+++ b/drivers/net/wireless/libertas/wext.h
@@ -7,45 +7,6 @@
#define SUBCMD_OFFSET 4
#define SUBCMD_DATA(x) *((int *)(x->u.name + SUBCMD_OFFSET))
-/** PRIVATE CMD ID */
-#define WLANIOCTL SIOCIWFIRSTPRIV
-
-#define WLAN_SETNONE_GETNONE (WLANIOCTL + 8)
-#define WLAN_SUBCMD_BT_RESET 13
-#define WLAN_SUBCMD_FWT_RESET 14
-
-#define WLAN_SETNONE_GETONEINT (WLANIOCTL + 15)
-#define WLANGETREGION 1
-
-#define WLAN_SUBCMD_FWT_CLEANUP 15
-#define WLAN_SUBCMD_FWT_TIME 16
-#define WLAN_SUBCMD_MESH_GET_TTL 17
-#define WLAN_SUBCMD_BT_GET_INVERT 18
-
-#define WLAN_SETONEINT_GETNONE (WLANIOCTL + 24)
-#define WLANSETREGION 8
-#define WLAN_SUBCMD_MESH_SET_TTL 18
-#define WLAN_SUBCMD_BT_SET_INVERT 19
-
-#define WLAN_SET128CHAR_GET128CHAR (WLANIOCTL + 25)
-#define WLAN_SUBCMD_BT_ADD 18
-#define WLAN_SUBCMD_BT_DEL 19
-#define WLAN_SUBCMD_BT_LIST 20
-#define WLAN_SUBCMD_FWT_ADD 21
-#define WLAN_SUBCMD_FWT_DEL 22
-#define WLAN_SUBCMD_FWT_LOOKUP 23
-#define WLAN_SUBCMD_FWT_LIST_NEIGHBOR 24
-#define WLAN_SUBCMD_FWT_LIST 25
-#define WLAN_SUBCMD_FWT_LIST_ROUTE 26
-
-#define WLAN_SET_GET_SIXTEEN_INT (WLANIOCTL + 29)
-#define WLAN_LED_GPIO_CTRL 5
-
-#define WLAN_LINKMODE_802_3 0
-#define WLAN_LINKMODE_802_11 2
-#define WLAN_RADIOMODE_NONE 0
-#define WLAN_RADIOMODE_RADIOTAP 2
-
/** wlan_ioctl_regrdwr */
struct wlan_ioctl_regrdwr {
/** Which register to access */
@@ -57,9 +18,13 @@ struct wlan_ioctl_regrdwr {
u32 value;
};
+#define WLAN_LINKMODE_802_3 0
+#define WLAN_LINKMODE_802_11 2
+#define WLAN_RADIOMODE_NONE 0
+#define WLAN_RADIOMODE_RADIOTAP 2
+
extern struct iw_handler_def libertas_handler_def;
extern struct iw_handler_def mesh_handler_def;
-int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int i);
int wlan_radio_ioctl(wlan_private * priv, u8 option);
#endif /* _WLAN_WEXT_H_ */
--
John W. Linville
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org
^ permalink raw reply related [flat|nested] 8+ messages in thread[parent not found: <20070627205539.GB13617-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>]
* Re: Please pull 'libertas-fixes' branch of wireless-2.6
[not found] ` <20070627205539.GB13617-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
@ 2007-07-02 11:07 ` Dan Williams
0 siblings, 0 replies; 8+ messages in thread
From: Dan Williams @ 2007-07-02 11:07 UTC (permalink / raw)
To: jeff-o2qLIJkoznsdnm+yROfE0A
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, John W. Linville
On Wed, 2007-06-27 at 16:55 -0400, John W. Linville wrote:
> The following changes since commit 189548642c5962e60c3667bdb3a703fe0bed12a6:
> Linus Torvalds (1):
> Linus 2.6.22-rc6
Jeff,
These don't look like they made it into rc7 at all; we don't really want
the ioctls leaking out into kernel ABI, which these fixes remove...
Thanks,
Dan
> are found in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas-fixes
>
> Dan Williams (4):
> libertas: style fixes
> libertas: kill wlan_scan_process_results
> libertas: fix WPA associations by handling ENABLE_RSN correctly
> libertas: remove private ioctls
>
> drivers/net/wireless/libertas/Makefile | 2 +-
> drivers/net/wireless/libertas/README | 275 --------
> drivers/net/wireless/libertas/assoc.c | 28 +-
> drivers/net/wireless/libertas/cmd.c | 12 +-
> drivers/net/wireless/libertas/cmdresp.c | 21 +
> drivers/net/wireless/libertas/hostcmd.h | 2 +-
> drivers/net/wireless/libertas/ioctl.c | 1081 -------------------------------
> drivers/net/wireless/libertas/main.c | 8 +-
> drivers/net/wireless/libertas/scan.c | 51 +--
> drivers/net/wireless/libertas/wext.c | 152 -----
> drivers/net/wireless/libertas/wext.h | 45 +--
> 11 files changed, 79 insertions(+), 1598 deletions(-)
> delete mode 100644 drivers/net/wireless/libertas/ioctl.c
>
> diff --git a/drivers/net/wireless/libertas/Makefile b/drivers/net/wireless/libertas/Makefile
> index a1097f5..32ed413 100644
> --- a/drivers/net/wireless/libertas/Makefile
> +++ b/drivers/net/wireless/libertas/Makefile
> @@ -2,7 +2,7 @@ libertas-objs := main.o fw.o wext.o \
> rx.o tx.o cmd.o \
> cmdresp.o scan.o \
> join.o 11d.o \
> - ioctl.o debugfs.o \
> + debugfs.o \
> ethtool.o assoc.o
>
> usb8xxx-objs += if_bootcmd.o
> diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README
> index 1f92f50..0b133ce 100644
> --- a/drivers/net/wireless/libertas/README
> +++ b/drivers/net/wireless/libertas/README
> @@ -28,281 +28,6 @@ DRIVER LOADING
>
> insmod usb8388.ko [fw_name=usb8388.bin]
>
> -=====================
> -IWPRIV COMMAND
> -=====================
> -
> -NAME
> - This manual describes the usage of private commands used in Marvell WLAN
> - Linux Driver. All the commands available in Wlanconfig will not be available
> - in the iwpriv.
> -
> -SYNOPSIS
> - iwpriv <ethX> <command> [sub-command] ...
> -
> - iwpriv ethX setregioncode <n>
> - iwpriv ethX getregioncode
> -
> -Version 5 Command:
> - iwpriv ethX ledgpio <n>
> -
> -BT Commands:
> - The blinding table (BT) contains a list of mac addresses that will be,
> - by default, ignored by the firmware. It is also possible to invert this
> - behavior so that we will ignore all traffic except for the portion
> - coming from mac addresess in the list. It is primarily used for
> - debugging and testing networks. It can be edited and inspected with
> - the following commands:
> -
> - iwpriv ethX bt_reset
> - iwpriv ethX bt_add <mac_address>
> - iwpriv ethX bt_del <mac_address>
> - iwpriv ethX bt_list <id>
> - iwpriv ethX bt_get_invert <n>
> - iwpriv ethX bt_set_invert <n>
> -
> -FWT Commands:
> - The forwarding table (FWT) is a feature used to manage mesh network
> - routing in the firmware. The FWT is essentially a routing table that
> - associates a destination mac address (da) with a next hop receiver
> - address (ra). The FWT can be inspected and edited with the following
> - iwpriv commands, which are described in greater detail below.
> - Eventually, the table will be automatically maintained by a custom
> - routing protocol.
> -
> - NOTE: FWT commands replace the previous DFT commands. What were the DFT
> - commands?, you might ask. They were an earlier API to the firmware that
> - implemented a simple MAC-layer forwarding mechanism. In the unlikely
> - event that you were using these commands, you must migrate to the new
> - FWT commands which can be used to achieve the same functionality.
> -
> - iwpriv ethX fwt_add [parameters]
> - iwpriv ethX fwt_del [parameters]
> - iwpriv ethX fwt_lookup [parameters]
> - iwpriv ethX fwt_list [parameters]
> - iwpriv ethX fwt_list_route [parameters]
> - iwpriv ethX fwt_list_neigh [parameters]
> - iwpriv ethX fwt_reset [parameters]
> - iwpriv ethX fwt_cleanup
> - iwpriv ethX fwt_time
> -
> -MESH Commands:
> -
> - The MESH commands are used to configure various features of the mesh
> - routing protocol. The following commands are supported:
> -
> - iwpriv ethX mesh_get_ttl
> - iwpriv ethX mesh_set_ttl ttl
> -
> -DESCRIPTION
> - Those commands are used to send additional commands to the Marvell WLAN
> - card via the Linux device driver.
> -
> - The ethX parameter specifies the network device that is to be used to
> - perform this command on. it could be eth0, eth1 etc.
> -
> -setregioncode
> - This command is used to set the region code in the station.
> - where value is 'region code' for various regions like
> - USA FCC, Canada IC, Spain, France, Europe ETSI, Japan ...
> -
> - Usage:
> - iwpriv ethX setregioncode 0x10: set region code to USA (0x10).
> -
> -getregioncode
> - This command is used to get the region code information set in the
> - station.
> -
> -ledgpio
> - This command is used to set/get LEDs.
> -
> - iwpriv ethX ledgpio <LEDs>
> - will set the corresponding LED for the GPIO Line.
> -
> - iwpriv ethX ledgpio
> - will give u which LEDs are Enabled.
> -
> - Usage:
> - iwpriv eth1 ledgpio 1 0 2 1 3 4
> - will enable
> - LED 1 -> GPIO 0
> - LED 2 -> GPIO 1
> - LED 3 -> GPIO 4
> -
> - iwpriv eth1 ledgpio
> - shows LED information in the format as mentioned above.
> -
> - Note: LED0 is invalid
> - Note: Maximum Number of LEDs are 16.
> -
> -fwt_add
> - This command is used to insert an entry into the FWT table. The list of
> - parameters must follow the following structure:
> -
> - iwpriv ethX fwt_add da ra [metric dir rate ssn dsn hopcount ttl expiration sleepmode snr]
> -
> - The parameters between brackets are optional, but they must appear in
> - the order specified. For example, if you want to specify the metric,
> - you must also specify the dir, ssn, and dsn but you need not specify the
> - hopcount, expiration, sleepmode, or snr. Any unspecified parameters
> - will be assigned the defaults specified below.
> -
> - The different parameters are:-
> - da -- DA MAC address in the form 00:11:22:33:44:55
> - ra -- RA MAC address in the form 00:11:22:33:44:55
> - metric -- route metric (cost: smaller-metric routes are
> - preferred, default is 0)
> - dir -- direction (1 for direct, 0 for reverse,
> - default is 1)
> - rate -- data rate used for transmission to the RA,
> - as specified for the rateadapt command,
> - default is 3 (11Mbps)
> - ssn -- Source Sequence Number (time at the RA for
> - reverse routes. Default is 0)
> - dsn -- Destination Sequence Number (time at the DA
> - for direct routes. Default is 0)
> - hopcount -- hop count (currently unused, default is 0)
> - ttl -- TTL (Only used in reverse entries)
> - expiration -- entry expiration (in ticks, where a tick is
> - 1024us, or ~ 1ms. Use 0 for an indefinite
> - entry, default is 0)
> - sleepmode -- RA's sleep mode (currently unused, default is
> - 0)
> - snr -- SNR in the link to RA (currently unused,
> - default is 0)
> -
> - The command does not return anything.
> -
> -fwt_del
> - This command is used to remove an entry to the FWT table. The list of
> - parameters must follow the following structure:
> -
> - iwpriv ethX fwt_del da ra [dir]
> -
> - where the different parameters are:-
> - da -- DA MAC address (in the form "00:11:22:33:44:55")
> - ra -- RA MAC address (in the form "00:11:22:33:44:55")
> - dir -- direction (1 for direct, 0 for reverse,
> - default is 1)
> -
> - The command does not return anything.
> -
> -fwt_lookup
> - This command is used to get the best route in the FWT table to a given
> - host. The only parameter is the MAC address of the host that is being
> - looked for.
> -
> - iwpriv ethX fwt_lookup da
> -
> - where:-
> - da -- DA MAC address (in the form "00:11:22:33:44:55")
> -
> - The command returns an output string identical to the one returned by
> - fwt_list described below.
> -
> -
> -fwt_list
> - This command is used to list a route from the FWT table. The only
> - parameter is the index into the table. If you want to list all the
> - routes in a table, start with index=0, and keep listing until you get a
> - "(null)" string. Note that the indicies may change as the fwt is
> - updated. It is expected that most users will not use fwt_list directly,
> - but that a utility similar to the traditional route command will be used
> - to invoke fwt_list over and over.
> -
> - iwpriv ethX fwt_list index
> -
> - The output is a string of the following form:
> -
> - da ra valid metric dir rate ssn dsn hopcount ttl expiration
> - sleepmode snr precursor
> -
> - where the different fields are:-
> - da -- DA MAC address (in the form "00:11:22:33:44:55")
> - ra -- RA MAC address (in the form "00:11:22:33:44:55")
> - valid -- whether the route is valid (0 if not valid)
> - metric -- route metric (cost: smaller-metric routes are preferred)
> - dir -- direction (1 for direct, 0 for reverse)
> - rate -- data rate used for transmission to the RA,
> - as specified for the rateadapt command
> - ssn -- Source Sequence Number (time at the RA for reverse routes)
> - dsn -- Destination Sequence Number (time at the DA for direct routes)
> - hopcount -- hop count (currently unused)
> - ttl -- TTL (only used in reverse entries)
> - expiration -- entry expiration (in ticks, where a tick is 1024us, or ~ 1ms. Use 0 for an indefinite entry)
> - sleepmode -- RA's sleep mode (currently unused)
> - snr -- SNR in the link to RA (currently unused)
> - precursor -- predecessor in direct routes
> -
> -fwt_list_route
> - This command is equivalent to fwt_list.
> -
> -fwt_list_neigh
> - This command is used to list a neighbor from the FWT table. The only
> - parameter is the neighbor ID. If you want to list all the neighbors in a
> - table, start with nid=0, and keep incrementing nid until you get a
> - "(null)" string. Note that the nid from a fwt_list_route command can be
> - used as an input to this command. Also note that this command is meant
> - mostly for debugging. It is expected that users will use fwt_lookup.
> - One important reason for this is that the neighbor id may change as the
> - neighbor table is altered.
> -
> - iwpriv ethX fwt_list_neigh nid
> -
> - The output is a string of the following form:
> -
> - ra sleepmode snr references
> -
> - where the different fields are:-
> - ra -- RA MAC address (in the form "00:11:22:33:44:55")
> - sleepmode -- RA's sleep mode (currently unused)
> - snr -- SNR in the link to RA (currently unused)
> - references -- RA's reference counter
> -
> -fwt_reset
> - This command is used to reset the FWT table, getting rid of all the
> - entries. There are no input parameters.
> -
> - iwpriv ethX fwt_reset
> -
> - The command does not return anything.
> -
> -fwt_cleanup
> - This command is used to perform user-based garbage recollection. The
> - FWT table is checked, and all the entries that are expired or invalid
> - are cleaned. Note that this is exported to the driver for debugging
> - purposes, as garbage collection is also fired by the firmware when in
> - space problems. There are no input parameters.
> -
> - iwpriv ethX fwt_cleanup
> -
> - The command does returns the number of invalid/expired routes deleted.
> -
> -fwt_time
> - This command returns a card's internal time representation. It is this
> - time that is used to represent the expiration times of FWT entries. The
> - number is not consistent from card to card; it is simply a timer count.
> - The fwt_time command is used to inspect the timer so that expiration
> - times reported by fwt_list can be properly interpreted.
> -
> - iwpriv ethX fwt_time
> -
> -mesh_get_ttl
> -
> - The mesh ttl is the number of hops a mesh packet can traverse before it
> - is dropped. This parameter is used to prevent infinite loops in the
> - mesh network. The value returned by this function is the ttl assigned
> - to all mesh packets. Currently there is no way to control the ttl on a
> - per packet or per socket basis.
> -
> - iwpriv ethX mesh_get_ttl
> -
> -mesh_set_ttl ttl
> -
> - Set the ttl. The argument must be between 0 and 255.
> -
> - iwpriv ethX mesh_set_ttl <ttl>
> -
> =========================
> ETHTOOL
> =========================
> diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
> index f67efa0..afd5617 100644
> --- a/drivers/net/wireless/libertas/assoc.c
> +++ b/drivers/net/wireless/libertas/assoc.c
> @@ -323,6 +323,8 @@ static int assoc_helper_secinfo(wlan_private *priv,
> {
> wlan_adapter *adapter = priv->adapter;
> int ret = 0;
> + u32 do_wpa;
> + u32 rsn = 0;
>
> lbs_deb_enter(LBS_DEB_ASSOC);
>
> @@ -333,12 +335,34 @@ static int assoc_helper_secinfo(wlan_private *priv,
> if (ret)
> goto out;
>
> - /* enable/disable RSN */
> + /* If RSN is already enabled, don't try to enable it again, since
> + * ENABLE_RSN resets internal state machines and will clobber the
> + * 4-way WPA handshake.
> + */
> +
> + /* Get RSN enabled/disabled */
> ret = libertas_prepare_and_send_command(priv,
> cmd_802_11_enable_rsn,
> cmd_act_set,
> cmd_option_waitforrsp,
> - 0, assoc_req);
> + 0, &rsn);
> + if (ret) {
> + lbs_deb_assoc("Failed to get RSN status: %d", ret);
> + goto out;
> + }
> +
> + /* Don't re-enable RSN if it's already enabled */
> + do_wpa = (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled);
> + if (do_wpa == rsn)
> + goto out;
> +
> + /* Set RSN enabled/disabled */
> + rsn = do_wpa;
> + ret = libertas_prepare_and_send_command(priv,
> + cmd_802_11_enable_rsn,
> + cmd_act_set,
> + cmd_option_waitforrsp,
> + 0, &rsn);
>
> out:
> lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> index 124e029..13f6528 100644
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -228,17 +228,19 @@ static int wlan_cmd_802_11_enable_rsn(wlan_private * priv,
> void * pdata_buf)
> {
> struct cmd_ds_802_11_enable_rsn *penableRSN = &cmd->params.enbrsn;
> - struct assoc_request * assoc_req = pdata_buf;
> + u32 * enable = pdata_buf;
>
> lbs_deb_enter(LBS_DEB_CMD);
>
> cmd->command = cpu_to_le16(cmd_802_11_enable_rsn);
> cmd->size = cpu_to_le16(sizeof(*penableRSN) + S_DS_GEN);
> penableRSN->action = cpu_to_le16(cmd_action);
> - if (assoc_req->secinfo.WPAenabled || assoc_req->secinfo.WPA2enabled) {
> - penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
> - } else {
> - penableRSN->enable = cpu_to_le16(cmd_disable_rsn);
> +
> + if (cmd_action == cmd_act_set) {
> + if (*enable)
> + penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
> + else
> + penableRSN->enable = cpu_to_le16(cmd_enable_rsn);
> }
>
> lbs_deb_leave(LBS_DEB_CMD);
> diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
> index 0c3b9a5..6ac0d47 100644
> --- a/drivers/net/wireless/libertas/cmdresp.c
> +++ b/drivers/net/wireless/libertas/cmdresp.c
> @@ -537,6 +537,24 @@ static int wlan_ret_get_log(wlan_private * priv,
> return 0;
> }
>
> +static int libertas_ret_802_11_enable_rsn(wlan_private * priv,
> + struct cmd_ds_command *resp)
> +{
> + struct cmd_ds_802_11_enable_rsn *enable_rsn = &resp->params.enbrsn;
> + wlan_adapter *adapter = priv->adapter;
> + u32 * pdata_buf = adapter->cur_cmd->pdata_buf;
> +
> + lbs_deb_enter(LBS_DEB_CMD);
> +
> + if (enable_rsn->action == cpu_to_le16(cmd_act_get)) {
> + if (pdata_buf)
> + *pdata_buf = (u32) le16_to_cpu(enable_rsn->enable);
> + }
> +
> + lbs_deb_enter(LBS_DEB_CMD);
> + return 0;
> +}
> +
> static inline int handle_cmd_response(u16 respcmd,
> struct cmd_ds_command *resp,
> wlan_private *priv)
> @@ -610,7 +628,10 @@ static inline int handle_cmd_response(u16 respcmd,
> case cmd_ret_802_11_authenticate:
> case cmd_ret_802_11_radio_control:
> case cmd_ret_802_11_beacon_stop:
> + break;
> +
> case cmd_ret_802_11_enable_rsn:
> + ret = libertas_ret_802_11_enable_rsn(priv, resp);
> break;
>
> case cmd_ret_802_11_data_rate:
> diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
> index 3acf939..09b898f 100644
> --- a/drivers/net/wireless/libertas/hostcmd.h
> +++ b/drivers/net/wireless/libertas/hostcmd.h
> @@ -503,7 +503,7 @@ struct cmd_ds_802_11_ad_hoc_join {
> struct cmd_ds_802_11_enable_rsn {
> __le16 action;
> __le16 enable;
> -};
> +} __attribute__ ((packed));
>
> struct MrvlIEtype_keyParamSet {
> /* type ID */
> diff --git a/drivers/net/wireless/libertas/ioctl.c b/drivers/net/wireless/libertas/ioctl.c
> deleted file mode 100644
> index f410815..0000000
> --- a/drivers/net/wireless/libertas/ioctl.c
> +++ /dev/null
> @@ -1,1081 +0,0 @@
> -/**
> - * This file contains ioctl functions
> - */
> -
> -#include <linux/ctype.h>
> -#include <linux/delay.h>
> -#include <linux/if.h>
> -#include <linux/if_arp.h>
> -#include <linux/wireless.h>
> -
> -#include <net/iw_handler.h>
> -#include <net/ieee80211.h>
> -
> -#include "host.h"
> -#include "radiotap.h"
> -#include "decl.h"
> -#include "defs.h"
> -#include "dev.h"
> -#include "join.h"
> -#include "wext.h"
> -
> -#define MAX_SCAN_CELL_SIZE (IW_EV_ADDR_LEN + \
> - IW_ESSID_MAX_SIZE + \
> - IW_EV_UINT_LEN + IW_EV_FREQ_LEN + \
> - IW_EV_QUAL_LEN + IW_ESSID_MAX_SIZE + \
> - IW_EV_PARAM_LEN + 40) /* 40 for WPAIE */
> -
> -#define WAIT_FOR_SCAN_RRESULT_MAX_TIME (10 * HZ)
> -
> -static int wlan_set_region(wlan_private * priv, u16 region_code)
> -{
> - int i;
> - int ret = 0;
> -
> - for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
> - // use the region code to search for the index
> - if (region_code == libertas_region_code_to_index[i]) {
> - priv->adapter->regiontableindex = (u16) i;
> - priv->adapter->regioncode = region_code;
> - break;
> - }
> - }
> -
> - // if it's unidentified region code
> - if (i >= MRVDRV_MAX_REGION_CODE) {
> - lbs_deb_ioctl("region Code not identified\n");
> - ret = -1;
> - goto done;
> - }
> -
> - if (libertas_set_regiontable(priv, priv->adapter->regioncode, 0)) {
> - ret = -EINVAL;
> - }
> -
> -done:
> - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
> - return ret;
> -}
> -
> -static inline int hex2int(char c)
> -{
> - if (c >= '0' && c <= '9')
> - return (c - '0');
> - if (c >= 'a' && c <= 'f')
> - return (c - 'a' + 10);
> - if (c >= 'A' && c <= 'F')
> - return (c - 'A' + 10);
> - return -1;
> -}
> -
> -/* Convert a string representation of a MAC address ("xx:xx:xx:xx:xx:xx")
> - into binary format (6 bytes).
> -
> - This function expects that each byte is represented with 2 characters
> - (e.g., 11:2:11:11:11:11 is invalid)
> -
> - */
> -static char *eth_str2addr(char *ethstr, u8 * addr)
> -{
> - int i, val, val2;
> - char *pos = ethstr;
> -
> - /* get rid of initial blanks */
> - while (*pos == ' ' || *pos == '\t')
> - ++pos;
> -
> - for (i = 0; i < 6; i++) {
> - val = hex2int(*pos++);
> - if (val < 0)
> - return NULL;
> - val2 = hex2int(*pos++);
> - if (val2 < 0)
> - return NULL;
> - addr[i] = (val * 16 + val2) & 0xff;
> -
> - if (i < 5 && *pos++ != ':')
> - return NULL;
> - }
> - return pos;
> -}
> -
> -/* this writes xx:xx:xx:xx:xx:xx into ethstr
> - (ethstr must have space for 18 chars) */
> -static int eth_addr2str(u8 * addr, char *ethstr)
> -{
> - int i;
> - char *pos = ethstr;
> -
> - for (i = 0; i < 6; i++) {
> - sprintf(pos, "%02x", addr[i] & 0xff);
> - pos += 2;
> - if (i < 5)
> - *pos++ = ':';
> - }
> - return 17;
> -}
> -
> -/**
> - * @brief Add an entry to the BT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_bt_add_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - char ethaddrs_str[18];
> - char *pos;
> - u8 ethaddr[ETH_ALEN];
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(ethaddrs_str, wrq->u.data.pointer,
> - sizeof(ethaddrs_str)))
> - return -EFAULT;
> -
> - if ((pos = eth_str2addr(ethaddrs_str, ethaddr)) == NULL) {
> - lbs_pr_info("BT_ADD: Invalid MAC address\n");
> - return -EINVAL;
> - }
> -
> - lbs_deb_ioctl("BT: adding %s\n", ethaddrs_str);
> - ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
> - cmd_act_bt_access_add,
> - cmd_option_waitforrsp, 0, ethaddr);
> - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
> - return ret;
> -}
> -
> -/**
> - * @brief Delete an entry from the BT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_bt_del_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - char ethaddrs_str[18];
> - u8 ethaddr[ETH_ALEN];
> - char *pos;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(ethaddrs_str, wrq->u.data.pointer,
> - sizeof(ethaddrs_str)))
> - return -EFAULT;
> -
> - if ((pos = eth_str2addr(ethaddrs_str, ethaddr)) == NULL) {
> - lbs_pr_info("Invalid MAC address\n");
> - return -EINVAL;
> - }
> -
> - lbs_deb_ioctl("BT: deleting %s\n", ethaddrs_str);
> -
> - return (libertas_prepare_and_send_command(priv,
> - cmd_bt_access,
> - cmd_act_bt_access_del,
> - cmd_option_waitforrsp, 0, ethaddr));
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief Reset all entries from the BT table
> - * @param priv A pointer to wlan_private structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_bt_reset_ioctl(wlan_private * priv)
> -{
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - lbs_pr_alert( "BT: resetting\n");
> -
> - return (libertas_prepare_and_send_command(priv,
> - cmd_bt_access,
> - cmd_act_bt_access_reset,
> - cmd_option_waitforrsp, 0, NULL));
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief List an entry from the BT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_bt_list_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - int pos;
> - char *addr1;
> - struct iwreq *wrq = (struct iwreq *)req;
> - /* used to pass id and store the bt entry returned by the FW */
> - union {
> - u32 id;
> - char addr1addr2[2 * ETH_ALEN];
> - } param;
> - static char outstr[64];
> - char *pbuf = outstr;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(outstr, wrq->u.data.pointer, sizeof(outstr))) {
> - lbs_deb_ioctl("Copy from user failed\n");
> - return -1;
> - }
> - param.id = simple_strtoul(outstr, NULL, 10);
> - pos = sprintf(pbuf, "%d: ", param.id);
> - pbuf += pos;
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
> - cmd_act_bt_access_list,
> - cmd_option_waitforrsp, 0,
> - (char *)¶m);
> -
> - if (ret == 0) {
> - addr1 = param.addr1addr2;
> -
> - pos = sprintf(pbuf, "BT includes node ");
> - pbuf += pos;
> - pos = eth_addr2str(addr1, pbuf);
> - pbuf += pos;
> - } else {
> - sprintf(pbuf, "(null)");
> - pbuf += pos;
> - }
> -
> - wrq->u.data.length = strlen(outstr);
> - if (copy_to_user(wrq->u.data.pointer, (char *)outstr,
> - wrq->u.data.length)) {
> - lbs_deb_ioctl("BT_LIST: Copy to user failed!\n");
> - return -EFAULT;
> - }
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0 ;
> -}
> -
> -/**
> - * @brief Sets inverted state of blacklist (non-zero if inverted)
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_bt_set_invert_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - int ret;
> - struct iwreq *wrq = (struct iwreq *)req;
> - union {
> - u32 id;
> - char addr1addr2[2 * ETH_ALEN];
> - } param;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - param.id = SUBCMD_DATA(wrq) ;
> - ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
> - cmd_act_bt_access_set_invert,
> - cmd_option_waitforrsp, 0,
> - (char *)¶m);
> - if (ret != 0)
> - return -EFAULT;
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief Gets inverted state of blacklist (non-zero if inverted)
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_bt_get_invert_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - int ret;
> - union {
> - u32 id;
> - char addr1addr2[2 * ETH_ALEN];
> - } param;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_bt_access,
> - cmd_act_bt_access_get_invert,
> - cmd_option_waitforrsp, 0,
> - (char *)¶m);
> -
> - if (ret == 0)
> - wrq->u.param.value = le32_to_cpu(param.id);
> - else
> - return -EFAULT;
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief Find the next parameter in an input string
> - * @param ptr A pointer to the input parameter string
> - * @return A pointer to the next parameter, or 0 if no parameters left.
> - */
> -static char * next_param(char * ptr)
> -{
> - if (!ptr) return NULL;
> - while (*ptr == ' ' || *ptr == '\t') ++ptr;
> - return (*ptr == '\0') ? NULL : ptr;
> -}
> -
> -/**
> - * @brief Add an entry to the FWT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_add_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - char in_str[128];
> - static struct cmd_ds_fwt_access fwt_access;
> - char *ptr;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
> - return -EFAULT;
> -
> - if ((ptr = eth_str2addr(in_str, fwt_access.da)) == NULL) {
> - lbs_pr_alert( "FWT_ADD: Invalid MAC address 1\n");
> - return -EINVAL;
> - }
> -
> - if ((ptr = eth_str2addr(ptr, fwt_access.ra)) == NULL) {
> - lbs_pr_alert( "FWT_ADD: Invalid MAC address 2\n");
> - return -EINVAL;
> - }
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.metric =
> - cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
> - else
> - fwt_access.metric = cpu_to_le32(FWT_DEFAULT_METRIC);
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.dir = (u8)simple_strtoul(ptr, &ptr, 10);
> - else
> - fwt_access.dir = FWT_DEFAULT_DIR;
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.rate = (u8) simple_strtoul(ptr, &ptr, 10);
> - else
> - fwt_access.rate = FWT_DEFAULT_RATE;
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.ssn =
> - cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
> - else
> - fwt_access.ssn = cpu_to_le32(FWT_DEFAULT_SSN);
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.dsn =
> - cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
> - else
> - fwt_access.dsn = cpu_to_le32(FWT_DEFAULT_DSN);
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.hopcount = simple_strtoul(ptr, &ptr, 10);
> - else
> - fwt_access.hopcount = FWT_DEFAULT_HOPCOUNT;
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.ttl = simple_strtoul(ptr, &ptr, 10);
> - else
> - fwt_access.ttl = FWT_DEFAULT_TTL;
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.expiration =
> - cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
> - else
> - fwt_access.expiration = cpu_to_le32(FWT_DEFAULT_EXPIRATION);
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.sleepmode = (u8)simple_strtoul(ptr, &ptr, 10);
> - else
> - fwt_access.sleepmode = FWT_DEFAULT_SLEEPMODE;
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.snr =
> - cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
> - else
> - fwt_access.snr = cpu_to_le32(FWT_DEFAULT_SNR);
> -
> -#ifdef DEBUG
> - {
> - char ethaddr1_str[18], ethaddr2_str[18];
> - eth_addr2str(fwt_access.da, ethaddr1_str);
> - eth_addr2str(fwt_access.ra, ethaddr2_str);
> - lbs_deb_ioctl("FWT_ADD: adding (da:%s,%i,ra:%s)\n", ethaddr1_str,
> - fwt_access.dir, ethaddr2_str);
> - lbs_deb_ioctl("FWT_ADD: ssn:%u dsn:%u met:%u hop:%u ttl:%u exp:%u slp:%u snr:%u\n",
> - fwt_access.ssn, fwt_access.dsn, fwt_access.metric,
> - fwt_access.hopcount, fwt_access.ttl, fwt_access.expiration,
> - fwt_access.sleepmode, fwt_access.snr);
> - }
> -#endif
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
> - cmd_act_fwt_access_add,
> - cmd_option_waitforrsp, 0,
> - (void *)&fwt_access);
> -
> - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
> - return ret;
> -}
> -
> -/**
> - * @brief Delete an entry from the FWT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_del_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - char in_str[64];
> - static struct cmd_ds_fwt_access fwt_access;
> - char *ptr;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
> - return -EFAULT;
> -
> - if ((ptr = eth_str2addr(in_str, fwt_access.da)) == NULL) {
> - lbs_pr_alert( "FWT_DEL: Invalid MAC address 1\n");
> - return -EINVAL;
> - }
> -
> - if ((ptr = eth_str2addr(ptr, fwt_access.ra)) == NULL) {
> - lbs_pr_alert( "FWT_DEL: Invalid MAC address 2\n");
> - return -EINVAL;
> - }
> -
> - if ((ptr = next_param(ptr)))
> - fwt_access.dir = (u8)simple_strtoul(ptr, &ptr, 10);
> - else
> - fwt_access.dir = FWT_DEFAULT_DIR;
> -
> -#ifdef DEBUG
> - {
> - char ethaddr1_str[18], ethaddr2_str[18];
> - lbs_deb_ioctl("FWT_DEL: line is %s\n", in_str);
> - eth_addr2str(fwt_access.da, ethaddr1_str);
> - eth_addr2str(fwt_access.ra, ethaddr2_str);
> - lbs_deb_ioctl("FWT_DEL: removing (da:%s,ra:%s,dir:%d)\n", ethaddr1_str,
> - ethaddr2_str, fwt_access.dir);
> - }
> -#endif
> -
> - ret = libertas_prepare_and_send_command(priv,
> - cmd_fwt_access,
> - cmd_act_fwt_access_del,
> - cmd_option_waitforrsp, 0,
> - (void *)&fwt_access);
> - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
> - return ret;
> -}
> -
> -
> -/**
> - * @brief Print route parameters
> - * @param fwt_access struct cmd_ds_fwt_access with route info
> - * @param buf destination buffer for route info
> - */
> -static void print_route(struct cmd_ds_fwt_access fwt_access, char *buf)
> -{
> - buf += sprintf(buf, " ");
> - buf += eth_addr2str(fwt_access.da, buf);
> - buf += sprintf(buf, " ");
> - buf += eth_addr2str(fwt_access.ra, buf);
> - buf += sprintf(buf, " %u", fwt_access.valid);
> - buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.metric));
> - buf += sprintf(buf, " %u", fwt_access.dir);
> - buf += sprintf(buf, " %u", fwt_access.rate);
> - buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.ssn));
> - buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.dsn));
> - buf += sprintf(buf, " %u", fwt_access.hopcount);
> - buf += sprintf(buf, " %u", fwt_access.ttl);
> - buf += sprintf(buf, " %u", le32_to_cpu(fwt_access.expiration));
> - buf += sprintf(buf, " %u", fwt_access.sleepmode);
> - buf += sprintf(buf, " %u ", le32_to_cpu(fwt_access.snr));
> - buf += eth_addr2str(fwt_access.prec, buf);
> -}
> -
> -/**
> - * @brief Lookup an entry in the FWT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_lookup_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - char in_str[64];
> - char *ptr;
> - static struct cmd_ds_fwt_access fwt_access;
> - static char out_str[128];
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
> - return -EFAULT;
> -
> - if ((ptr = eth_str2addr(in_str, fwt_access.da)) == NULL) {
> - lbs_pr_alert( "FWT_LOOKUP: Invalid MAC address\n");
> - return -EINVAL;
> - }
> -
> -#ifdef DEBUG
> - {
> - char ethaddr1_str[18];
> - lbs_deb_ioctl("FWT_LOOKUP: line is %s\n", in_str);
> - eth_addr2str(fwt_access.da, ethaddr1_str);
> - lbs_deb_ioctl("FWT_LOOKUP: looking for (da:%s)\n", ethaddr1_str);
> - }
> -#endif
> -
> - ret = libertas_prepare_and_send_command(priv,
> - cmd_fwt_access,
> - cmd_act_fwt_access_lookup,
> - cmd_option_waitforrsp, 0,
> - (void *)&fwt_access);
> -
> - if (ret == 0)
> - print_route(fwt_access, out_str);
> - else
> - sprintf(out_str, "(null)");
> -
> - wrq->u.data.length = strlen(out_str);
> - if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
> - wrq->u.data.length)) {
> - lbs_deb_ioctl("FWT_LOOKUP: Copy to user failed!\n");
> - return -EFAULT;
> - }
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief Reset all entries from the FWT table
> - * @param priv A pointer to wlan_private structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_reset_ioctl(wlan_private * priv)
> -{
> - lbs_deb_ioctl("FWT: resetting\n");
> -
> - return (libertas_prepare_and_send_command(priv,
> - cmd_fwt_access,
> - cmd_act_fwt_access_reset,
> - cmd_option_waitforrsp, 0, NULL));
> -}
> -
> -/**
> - * @brief List an entry from the FWT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_list_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - char in_str[8];
> - static struct cmd_ds_fwt_access fwt_access;
> - char *ptr = in_str;
> - static char out_str[128];
> - char *pbuf = out_str;
> - int ret = 0;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str))) {
> - ret = -EFAULT;
> - goto out;
> - }
> -
> - fwt_access.id = cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
> -
> -#ifdef DEBUG
> - {
> - lbs_deb_ioctl("FWT_LIST: line is %s\n", in_str);
> - lbs_deb_ioctl("FWT_LIST: listing id:%i\n", le32_to_cpu(fwt_access.id));
> - }
> -#endif
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
> - cmd_act_fwt_access_list,
> - cmd_option_waitforrsp, 0, (void *)&fwt_access);
> -
> - if (ret == 0)
> - print_route(fwt_access, pbuf);
> - else
> - pbuf += sprintf(pbuf, " (null)");
> -
> - wrq->u.data.length = strlen(out_str);
> - if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
> - wrq->u.data.length)) {
> - lbs_deb_ioctl("FWT_LIST: Copy to user failed!\n");
> - ret = -EFAULT;
> - goto out;
> - }
> -
> - ret = 0;
> -
> -out:
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return ret;
> -}
> -
> -/**
> - * @brief List an entry from the FRT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_list_route_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - char in_str[64];
> - static struct cmd_ds_fwt_access fwt_access;
> - char *ptr = in_str;
> - static char out_str[128];
> - char *pbuf = out_str;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
> - return -EFAULT;
> -
> - fwt_access.id = cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
> -
> -#ifdef DEBUG
> - {
> - lbs_deb_ioctl("FWT_LIST_ROUTE: line is %s\n", in_str);
> - lbs_deb_ioctl("FWT_LIST_ROUTE: listing id:%i\n", le32_to_cpu(fwt_access.id));
> - }
> -#endif
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
> - cmd_act_fwt_access_list_route,
> - cmd_option_waitforrsp, 0, (void *)&fwt_access);
> -
> - if (ret == 0) {
> - print_route(fwt_access, pbuf);
> - } else
> - pbuf += sprintf(pbuf, " (null)");
> -
> - wrq->u.data.length = strlen(out_str);
> - if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
> - wrq->u.data.length)) {
> - lbs_deb_ioctl("FWT_LIST_ROUTE: Copy to user failed!\n");
> - return -EFAULT;
> - }
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief List an entry from the FNT table
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_list_neighbor_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - char in_str[8];
> - static struct cmd_ds_fwt_access fwt_access;
> - char *ptr = in_str;
> - static char out_str[128];
> - char *pbuf = out_str;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if (copy_from_user(in_str, wrq->u.data.pointer, sizeof(in_str)))
> - return -EFAULT;
> -
> - memset(&fwt_access, 0, sizeof(fwt_access));
> - fwt_access.id = cpu_to_le32(simple_strtoul(ptr, &ptr, 10));
> -
> -#ifdef DEBUG
> - {
> - lbs_deb_ioctl("FWT_LIST_NEIGHBOR: line is %s\n", in_str);
> - lbs_deb_ioctl("FWT_LIST_NEIGHBOR: listing id:%i\n", le32_to_cpu(fwt_access.id));
> - }
> -#endif
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
> - cmd_act_fwt_access_list_neighbor,
> - cmd_option_waitforrsp, 0,
> - (void *)&fwt_access);
> -
> - if (ret == 0) {
> - pbuf += sprintf(pbuf, " ra ");
> - pbuf += eth_addr2str(fwt_access.ra, pbuf);
> - pbuf += sprintf(pbuf, " slp %u", fwt_access.sleepmode);
> - pbuf += sprintf(pbuf, " snr %u", le32_to_cpu(fwt_access.snr));
> - pbuf += sprintf(pbuf, " ref %u", le32_to_cpu(fwt_access.references));
> - } else
> - pbuf += sprintf(pbuf, " (null)");
> -
> - wrq->u.data.length = strlen(out_str);
> - if (copy_to_user(wrq->u.data.pointer, (char *)out_str,
> - wrq->u.data.length)) {
> - lbs_deb_ioctl("FWT_LIST_NEIGHBOR: Copy to user failed!\n");
> - return -EFAULT;
> - }
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief Cleans up the route (FRT) and neighbor (FNT) tables
> - * (Garbage Collection)
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_cleanup_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - static struct cmd_ds_fwt_access fwt_access;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - lbs_deb_ioctl("FWT: cleaning up\n");
> -
> - memset(&fwt_access, 0, sizeof(fwt_access));
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
> - cmd_act_fwt_access_cleanup,
> - cmd_option_waitforrsp, 0,
> - (void *)&fwt_access);
> -
> - if (ret == 0)
> - wrq->u.param.value = le32_to_cpu(fwt_access.references);
> - else
> - return -EFAULT;
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief Gets firmware internal time (debug purposes)
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_fwt_time_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - static struct cmd_ds_fwt_access fwt_access;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - lbs_deb_ioctl("FWT: getting time\n");
> -
> - memset(&fwt_access, 0, sizeof(fwt_access));
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_fwt_access,
> - cmd_act_fwt_access_time,
> - cmd_option_waitforrsp, 0,
> - (void *)&fwt_access);
> -
> - if (ret == 0)
> - wrq->u.param.value = le32_to_cpu(fwt_access.references);
> - else
> - return -EFAULT;
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief Gets mesh ttl from firmware
> - * @param priv A pointer to wlan_private structure
> - * @param req A pointer to ifreq structure
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_mesh_get_ttl_ioctl(wlan_private * priv, struct ifreq *req)
> -{
> - struct iwreq *wrq = (struct iwreq *)req;
> - struct cmd_ds_mesh_access mesh_access;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - memset(&mesh_access, 0, sizeof(mesh_access));
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_mesh_access,
> - cmd_act_mesh_get_ttl,
> - cmd_option_waitforrsp, 0,
> - (void *)&mesh_access);
> -
> - if (ret == 0)
> - wrq->u.param.value = le32_to_cpu(mesh_access.data[0]);
> - else
> - return -EFAULT;
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return 0;
> -}
> -
> -/**
> - * @brief Gets mesh ttl from firmware
> - * @param priv A pointer to wlan_private structure
> - * @param ttl New ttl value
> - * @return 0 --success, otherwise fail
> - */
> -static int wlan_mesh_set_ttl_ioctl(wlan_private * priv, int ttl)
> -{
> - struct cmd_ds_mesh_access mesh_access;
> - int ret;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - if( (ttl > 0xff) || (ttl < 0) )
> - return -EINVAL;
> -
> - memset(&mesh_access, 0, sizeof(mesh_access));
> - mesh_access.data[0] = cpu_to_le32(ttl);
> -
> - ret = libertas_prepare_and_send_command(priv, cmd_mesh_access,
> - cmd_act_mesh_set_ttl,
> - cmd_option_waitforrsp, 0,
> - (void *)&mesh_access);
> -
> - if (ret != 0)
> - ret = -EFAULT;
> -
> - lbs_deb_leave(LBS_DEB_IOCTL);
> - return ret;
> -}
> -
> -/**
> - * @brief ioctl function - entry point
> - *
> - * @param dev A pointer to net_device structure
> - * @param req A pointer to ifreq structure
> - * @param cmd command
> - * @return 0--success, otherwise fail
> - */
> -int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
> -{
> - int subcmd = 0;
> - int idata = 0;
> - int *pdata;
> - int ret = 0;
> - wlan_private *priv = dev->priv;
> - wlan_adapter *adapter = priv->adapter;
> - struct iwreq *wrq = (struct iwreq *)req;
> -
> - lbs_deb_enter(LBS_DEB_IOCTL);
> -
> - lbs_deb_ioctl("libertas_do_ioctl: ioctl cmd = 0x%x\n", cmd);
> - switch (cmd) {
> - case WLAN_SETNONE_GETNONE: /* set WPA mode on/off ioctl #20 */
> - switch (wrq->u.data.flags) {
> - case WLAN_SUBCMD_BT_RESET: /* bt_reset */
> - wlan_bt_reset_ioctl(priv);
> - break;
> - case WLAN_SUBCMD_FWT_RESET: /* fwt_reset */
> - wlan_fwt_reset_ioctl(priv);
> - break;
> - } /* End of switch */
> - break;
> -
> - case WLAN_SETONEINT_GETNONE:
> - /* The first 4 bytes of req->ifr_data is sub-ioctl number
> - * after 4 bytes sits the payload.
> - */
> - subcmd = wrq->u.data.flags;
> - if (!subcmd)
> - subcmd = (int)wrq->u.param.value;
> -
> - switch (subcmd) {
> - case WLANSETREGION:
> - idata = SUBCMD_DATA(wrq);
> - ret = wlan_set_region(priv, (u16) idata);
> - break;
> - case WLAN_SUBCMD_MESH_SET_TTL:
> - idata = SUBCMD_DATA(wrq);
> - ret = wlan_mesh_set_ttl_ioctl(priv, idata);
> - break;
> -
> - case WLAN_SUBCMD_BT_SET_INVERT:
> - ret = wlan_bt_set_invert_ioctl(priv, req);
> - break ;
> -
> - default:
> - ret = -EOPNOTSUPP;
> - break;
> - }
> -
> - break;
> -
> - case WLAN_SET128CHAR_GET128CHAR:
> - switch ((int)wrq->u.data.flags) {
> - case WLAN_SUBCMD_BT_ADD:
> - ret = wlan_bt_add_ioctl(priv, req);
> - break;
> - case WLAN_SUBCMD_BT_DEL:
> - ret = wlan_bt_del_ioctl(priv, req);
> - break;
> - case WLAN_SUBCMD_BT_LIST:
> - ret = wlan_bt_list_ioctl(priv, req);
> - break;
> - case WLAN_SUBCMD_FWT_ADD:
> - ret = wlan_fwt_add_ioctl(priv, req);
> - break;
> - case WLAN_SUBCMD_FWT_DEL:
> - ret = wlan_fwt_del_ioctl(priv, req);
> - break;
> - case WLAN_SUBCMD_FWT_LOOKUP:
> - ret = wlan_fwt_lookup_ioctl(priv, req);
> - break;
> - case WLAN_SUBCMD_FWT_LIST_NEIGHBOR:
> - ret = wlan_fwt_list_neighbor_ioctl(priv, req);
> - break;
> - case WLAN_SUBCMD_FWT_LIST:
> - ret = wlan_fwt_list_ioctl(priv, req);
> - break;
> - case WLAN_SUBCMD_FWT_LIST_ROUTE:
> - ret = wlan_fwt_list_route_ioctl(priv, req);
> - break;
> - }
> - break;
> -
> - case WLAN_SETNONE_GETONEINT:
> - switch (wrq->u.param.value) {
> - case WLANGETREGION:
> - pdata = (int *)wrq->u.name;
> - *pdata = (int)adapter->regioncode;
> - break;
> - case WLAN_SUBCMD_FWT_CLEANUP: /* fwt_cleanup */
> - ret = wlan_fwt_cleanup_ioctl(priv, req);
> - break;
> -
> - case WLAN_SUBCMD_FWT_TIME: /* fwt_time */
> - ret = wlan_fwt_time_ioctl(priv, req);
> - break;
> -
> - case WLAN_SUBCMD_MESH_GET_TTL:
> - ret = wlan_mesh_get_ttl_ioctl(priv, req);
> - break;
> -
> - case WLAN_SUBCMD_BT_GET_INVERT:
> - ret = wlan_bt_get_invert_ioctl(priv, req);
> - break ;
> -
> - default:
> - ret = -EOPNOTSUPP;
> -
> - }
> -
> - break;
> -
> - case WLAN_SET_GET_SIXTEEN_INT:
> - switch ((int)wrq->u.data.flags) {
> - case WLAN_LED_GPIO_CTRL:
> - {
> - int i;
> - int data[16];
> -
> - struct cmd_ds_802_11_led_ctrl ctrl;
> - struct mrvlietypes_ledgpio *gpio =
> - (struct mrvlietypes_ledgpio *) ctrl.data;
> -
> - memset(&ctrl, 0, sizeof(ctrl));
> - if (wrq->u.data.length > MAX_LEDS * 2)
> - return -ENOTSUPP;
> - if ((wrq->u.data.length % 2) != 0)
> - return -ENOTSUPP;
> - if (wrq->u.data.length == 0) {
> - ctrl.action =
> - cpu_to_le16
> - (cmd_act_get);
> - } else {
> - if (copy_from_user
> - (data, wrq->u.data.pointer,
> - sizeof(int) *
> - wrq->u.data.length)) {
> - lbs_deb_ioctl(
> - "Copy from user failed\n");
> - return -EFAULT;
> - }
> -
> - ctrl.action =
> - cpu_to_le16
> - (cmd_act_set);
> - ctrl.numled = cpu_to_le16(0);
> - gpio->header.type =
> - cpu_to_le16(TLV_TYPE_LED_GPIO);
> - gpio->header.len = wrq->u.data.length;
> - for (i = 0; i < wrq->u.data.length;
> - i += 2) {
> - gpio->ledpin[i / 2].led =
> - data[i];
> - gpio->ledpin[i / 2].pin =
> - data[i + 1];
> - }
> - }
> - ret =
> - libertas_prepare_and_send_command(priv,
> - cmd_802_11_led_gpio_ctrl,
> - 0,
> - cmd_option_waitforrsp,
> - 0, (void *)&ctrl);
> - for (i = 0; i < gpio->header.len; i += 2) {
> - data[i] = gpio->ledpin[i / 2].led;
> - data[i + 1] = gpio->ledpin[i / 2].pin;
> - }
> - if (copy_to_user(wrq->u.data.pointer, data,
> - sizeof(int) *
> - gpio->header.len)) {
> - lbs_deb_ioctl("Copy to user failed\n");
> - return -EFAULT;
> - }
> -
> - wrq->u.data.length = gpio->header.len;
> - }
> - break;
> - }
> - break;
> -
> - default:
> - ret = -EINVAL;
> - break;
> - }
> -
> - lbs_deb_leave_args(LBS_DEB_IOCTL, "ret %d", ret);
> - return ret;
> -}
> -
> -
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index 623ab4b..4a59306 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -181,7 +181,8 @@ u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE] =
> * @brief Get function for sysfs attribute anycast_mask
> */
> static ssize_t libertas_anycast_get(struct device * dev,
> - struct device_attribute *attr, char * buf) {
> + struct device_attribute *attr, char * buf)
> +{
> struct cmd_ds_mesh_access mesh_access;
>
> memset(&mesh_access, 0, sizeof(mesh_access));
> @@ -197,7 +198,8 @@ static ssize_t libertas_anycast_get(struct device * dev,
> * @brief Set function for sysfs attribute anycast_mask
> */
> static ssize_t libertas_anycast_set(struct device * dev,
> - struct device_attribute *attr, const char * buf, size_t count) {
> + struct device_attribute *attr, const char * buf, size_t count)
> +{
> struct cmd_ds_mesh_access mesh_access;
> uint32_t datum;
>
> @@ -799,7 +801,6 @@ wlan_private *libertas_add_card(void *card, struct device *dmdev)
> dev->open = wlan_open;
> dev->hard_start_xmit = wlan_pre_start_xmit;
> dev->stop = wlan_close;
> - dev->do_ioctl = libertas_do_ioctl;
> dev->set_mac_address = wlan_set_mac_address;
> dev->tx_timeout = wlan_tx_timeout;
> dev->get_stats = wlan_get_stats;
> @@ -918,7 +919,6 @@ int libertas_add_mesh(wlan_private *priv, struct device *dev)
> mesh_dev->open = mesh_open;
> mesh_dev->hard_start_xmit = mesh_pre_start_xmit;
> mesh_dev->stop = mesh_close;
> - mesh_dev->do_ioctl = libertas_do_ioctl;
> mesh_dev->get_stats = wlan_get_stats;
> mesh_dev->set_mac_address = wlan_set_mac_address;
> mesh_dev->ethtool_ops = &libertas_ethtool_ops;
> diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
> index 606af50..c3043dc 100644
> --- a/drivers/net/wireless/libertas/scan.c
> +++ b/drivers/net/wireless/libertas/scan.c
> @@ -215,38 +215,6 @@ done:
> }
>
> /**
> - * @brief Post process the scan table after a new scan command has completed
> - *
> - * Inspect each entry of the scan table and try to find an entry that
> - * matches our current associated/joined network from the scan. If
> - * one is found, update the stored copy of the bssdescriptor for our
> - * current network.
> - *
> - * Debug dump the current scan table contents if compiled accordingly.
> - *
> - * @param priv A pointer to wlan_private structure
> - *
> - * @return void
> - */
> -static void wlan_scan_process_results(wlan_private * priv)
> -{
> - wlan_adapter *adapter = priv->adapter;
> - struct bss_descriptor * iter_bss;
> - int i = 0;
> -
> - if (adapter->connect_status == libertas_connected)
> - return;
> -
> - mutex_lock(&adapter->lock);
> - list_for_each_entry (iter_bss, &adapter->network_list, list) {
> - lbs_deb_scan("Scan:(%02d) " MAC_FMT ", RSSI[%03d], SSID[%s]\n",
> - i++, MAC_ARG(iter_bss->bssid), (s32) iter_bss->rssi,
> - escape_essid(iter_bss->ssid, iter_bss->ssid_len));
> - }
> - mutex_unlock(&adapter->lock);
> -}
> -
> -/**
> * @brief Create a channel list for the driver to scan based on region info
> *
> * Use the driver region/band information to construct a comprehensive list
> @@ -791,6 +759,10 @@ int wlan_scan_networks(wlan_private * priv,
> u8 scancurrentchanonly;
> int maxchanperscan;
> int ret;
> +#ifdef CONFIG_LIBERTAS_DEBUG
> + struct bss_descriptor * iter_bss;
> + int i = 0;
> +#endif
>
> lbs_deb_enter(LBS_DEB_ASSOC);
>
> @@ -832,11 +804,16 @@ int wlan_scan_networks(wlan_private * priv,
> puserscanin,
> full_scan);
>
> - /* Process the resulting scan table:
> - * - Remove any bad ssids
> - * - Update our current BSS information from scan data
> - */
> - wlan_scan_process_results(priv);
> +#ifdef CONFIG_LIBERTAS_DEBUG
> + /* Dump the scan table */
> + mutex_lock(&adapter->lock);
> + list_for_each_entry (iter_bss, &adapter->network_list, list) {
> + lbs_deb_scan("Scan:(%02d) " MAC_FMT ", RSSI[%03d], SSID[%s]\n",
> + i++, MAC_ARG(iter_bss->bssid), (s32) iter_bss->rssi,
> + escape_essid(iter_bss->ssid, iter_bss->ssid_len));
> + }
> + mutex_unlock(&adapter->lock);
> +#endif
>
> if (priv->adapter->connect_status == libertas_connected) {
> netif_carrier_on(priv->dev);
> diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
> index 8939251..f42b796 100644
> --- a/drivers/net/wireless/libertas/wext.c
> +++ b/drivers/net/wireless/libertas/wext.c
> @@ -913,148 +913,6 @@ out:
> return 0;
> }
>
> -/*
> - * iwpriv settable callbacks
> - */
> -
> -static const iw_handler wlan_private_handler[] = {
> - NULL, /* SIOCIWFIRSTPRIV */
> -};
> -
> -static const struct iw_priv_args wlan_private_args[] = {
> - /*
> - * { cmd, set_args, get_args, name }
> - */
> - /* Using iwpriv sub-command feature */
> - {
> - WLAN_SETONEINT_GETNONE, /* IOCTL: 24 */
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - IW_PRIV_TYPE_NONE,
> - ""},
> - {
> - WLANSETREGION,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - IW_PRIV_TYPE_NONE,
> - "setregioncode"},
> - {
> - WLAN_SUBCMD_MESH_SET_TTL,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - IW_PRIV_TYPE_NONE,
> - "mesh_set_ttl"},
> - {
> - WLAN_SETNONE_GETONEINT,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - ""},
> - {
> - WLANGETREGION,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - "getregioncode"},
> - {
> - WLAN_SUBCMD_FWT_CLEANUP,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - "fwt_cleanup"},
> - {
> - WLAN_SUBCMD_FWT_TIME,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - "fwt_time"},
> - {
> - WLAN_SUBCMD_MESH_GET_TTL,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - "mesh_get_ttl"},
> - {
> - WLAN_SETNONE_GETNONE,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_NONE,
> - ""},
> - {
> - WLAN_SUBCMD_FWT_RESET,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_NONE,
> - "fwt_reset"},
> - {
> - WLAN_SUBCMD_BT_RESET,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_NONE,
> - "bt_reset"},
> - {
> - WLAN_SET128CHAR_GET128CHAR,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - ""},
> - /* BT Management */
> - {
> - WLAN_SUBCMD_BT_ADD,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "bt_add"},
> - {
> - WLAN_SUBCMD_BT_DEL,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "bt_del"},
> - {
> - WLAN_SUBCMD_BT_LIST,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "bt_list"},
> - {
> - WLAN_SUBCMD_BT_SET_INVERT,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - IW_PRIV_TYPE_NONE,
> - "bt_set_invert"},
> - {
> - WLAN_SUBCMD_BT_GET_INVERT,
> - IW_PRIV_TYPE_NONE,
> - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1,
> - "bt_get_invert"},
> - /* FWT Management */
> - {
> - WLAN_SUBCMD_FWT_ADD,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "fwt_add"},
> - {
> - WLAN_SUBCMD_FWT_DEL,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "fwt_del"},
> - {
> - WLAN_SUBCMD_FWT_LOOKUP,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "fwt_lookup"},
> - {
> - WLAN_SUBCMD_FWT_LIST_NEIGHBOR,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "fwt_list_neigh"},
> - {
> - WLAN_SUBCMD_FWT_LIST,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "fwt_list"},
> - {
> - WLAN_SUBCMD_FWT_LIST_ROUTE,
> - IW_PRIV_TYPE_CHAR | 128,
> - IW_PRIV_TYPE_CHAR | 128,
> - "fwt_list_route"},
> - {
> - WLAN_SET_GET_SIXTEEN_INT,
> - IW_PRIV_TYPE_INT | 16,
> - IW_PRIV_TYPE_INT | 16,
> - ""},
> - {
> - WLAN_LED_GPIO_CTRL,
> - IW_PRIV_TYPE_INT | 16,
> - IW_PRIV_TYPE_INT | 16,
> - "ledgpio"},
> -};
> -
> static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
> {
> enum {
> @@ -2444,22 +2302,12 @@ static const iw_handler mesh_wlan_handler[] = {
> };
> struct iw_handler_def libertas_handler_def = {
> .num_standard = sizeof(wlan_handler) / sizeof(iw_handler),
> - .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler),
> - .num_private_args = sizeof(wlan_private_args) /
> - sizeof(struct iw_priv_args),
> .standard = (iw_handler *) wlan_handler,
> - .private = (iw_handler *) wlan_private_handler,
> - .private_args = (struct iw_priv_args *)wlan_private_args,
> .get_wireless_stats = wlan_get_wireless_stats,
> };
>
> struct iw_handler_def mesh_handler_def = {
> .num_standard = sizeof(mesh_wlan_handler) / sizeof(iw_handler),
> - .num_private = sizeof(wlan_private_handler) / sizeof(iw_handler),
> - .num_private_args = sizeof(wlan_private_args) /
> - sizeof(struct iw_priv_args),
> .standard = (iw_handler *) mesh_wlan_handler,
> - .private = (iw_handler *) wlan_private_handler,
> - .private_args = (struct iw_priv_args *)wlan_private_args,
> .get_wireless_stats = wlan_get_wireless_stats,
> };
> diff --git a/drivers/net/wireless/libertas/wext.h b/drivers/net/wireless/libertas/wext.h
> index d555056..3d5196c 100644
> --- a/drivers/net/wireless/libertas/wext.h
> +++ b/drivers/net/wireless/libertas/wext.h
> @@ -7,45 +7,6 @@
> #define SUBCMD_OFFSET 4
> #define SUBCMD_DATA(x) *((int *)(x->u.name + SUBCMD_OFFSET))
>
> -/** PRIVATE CMD ID */
> -#define WLANIOCTL SIOCIWFIRSTPRIV
> -
> -#define WLAN_SETNONE_GETNONE (WLANIOCTL + 8)
> -#define WLAN_SUBCMD_BT_RESET 13
> -#define WLAN_SUBCMD_FWT_RESET 14
> -
> -#define WLAN_SETNONE_GETONEINT (WLANIOCTL + 15)
> -#define WLANGETREGION 1
> -
> -#define WLAN_SUBCMD_FWT_CLEANUP 15
> -#define WLAN_SUBCMD_FWT_TIME 16
> -#define WLAN_SUBCMD_MESH_GET_TTL 17
> -#define WLAN_SUBCMD_BT_GET_INVERT 18
> -
> -#define WLAN_SETONEINT_GETNONE (WLANIOCTL + 24)
> -#define WLANSETREGION 8
> -#define WLAN_SUBCMD_MESH_SET_TTL 18
> -#define WLAN_SUBCMD_BT_SET_INVERT 19
> -
> -#define WLAN_SET128CHAR_GET128CHAR (WLANIOCTL + 25)
> -#define WLAN_SUBCMD_BT_ADD 18
> -#define WLAN_SUBCMD_BT_DEL 19
> -#define WLAN_SUBCMD_BT_LIST 20
> -#define WLAN_SUBCMD_FWT_ADD 21
> -#define WLAN_SUBCMD_FWT_DEL 22
> -#define WLAN_SUBCMD_FWT_LOOKUP 23
> -#define WLAN_SUBCMD_FWT_LIST_NEIGHBOR 24
> -#define WLAN_SUBCMD_FWT_LIST 25
> -#define WLAN_SUBCMD_FWT_LIST_ROUTE 26
> -
> -#define WLAN_SET_GET_SIXTEEN_INT (WLANIOCTL + 29)
> -#define WLAN_LED_GPIO_CTRL 5
> -
> -#define WLAN_LINKMODE_802_3 0
> -#define WLAN_LINKMODE_802_11 2
> -#define WLAN_RADIOMODE_NONE 0
> -#define WLAN_RADIOMODE_RADIOTAP 2
> -
> /** wlan_ioctl_regrdwr */
> struct wlan_ioctl_regrdwr {
> /** Which register to access */
> @@ -57,9 +18,13 @@ struct wlan_ioctl_regrdwr {
> u32 value;
> };
>
> +#define WLAN_LINKMODE_802_3 0
> +#define WLAN_LINKMODE_802_11 2
> +#define WLAN_RADIOMODE_NONE 0
> +#define WLAN_RADIOMODE_RADIOTAP 2
> +
> extern struct iw_handler_def libertas_handler_def;
> extern struct iw_handler_def mesh_handler_def;
> -int libertas_do_ioctl(struct net_device *dev, struct ifreq *req, int i);
> int wlan_radio_ioctl(wlan_private * priv, u8 option);
>
> #endif /* _WLAN_WEXT_H_ */
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Please pull 'libertas-fixes' branch of wireless-2.6
2007-06-27 20:55 John W. Linville
[not found] ` <20070627205539.GB13617-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
@ 2007-07-02 12:14 ` Jeff Garzik
1 sibling, 0 replies; 8+ messages in thread
From: Jeff Garzik @ 2007-07-02 12:14 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, netdev, dcbw
John W. Linville wrote:
> The following changes since commit 189548642c5962e60c3667bdb3a703fe0bed12a6:
> Linus Torvalds (1):
> Linus 2.6.22-rc6
>
> are found in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas-fixes
>
> Dan Williams (4):
> libertas: style fixes
> libertas: kill wlan_scan_process_results
> libertas: fix WPA associations by handling ENABLE_RSN correctly
> libertas: remove private ioctls
>
> drivers/net/wireless/libertas/Makefile | 2 +-
> drivers/net/wireless/libertas/README | 275 --------
> drivers/net/wireless/libertas/assoc.c | 28 +-
> drivers/net/wireless/libertas/cmd.c | 12 +-
> drivers/net/wireless/libertas/cmdresp.c | 21 +
> drivers/net/wireless/libertas/hostcmd.h | 2 +-
> drivers/net/wireless/libertas/ioctl.c | 1081 -------------------------------
> drivers/net/wireless/libertas/main.c | 8 +-
> drivers/net/wireless/libertas/scan.c | 51 +--
> drivers/net/wireless/libertas/wext.c | 152 -----
> drivers/net/wireless/libertas/wext.h | 45 +--
> 11 files changed, 79 insertions(+), 1598 deletions(-)
> delete mode 100644 drivers/net/wireless/libertas/ioctl.c
pulled
^ permalink raw reply [flat|nested] 8+ messages in thread
* Please pull 'libertas' branch of wireless-2.6
@ 2007-05-29 18:33 John W. Linville
2007-06-12 21:05 ` John W. Linville
0 siblings, 1 reply; 8+ messages in thread
From: John W. Linville @ 2007-05-29 18:33 UTC (permalink / raw)
To: jeff; +Cc: linux-wireless, netdev, Dan Williams
[-- Attachment #1: Type: text/plain, Size: 6724 bytes --]
Lots of stuff here...probably best for 2.6.23...
The following changes since commit c420bc9f09a0926b708c3edb27eacba434a4f4ba:
Linus Torvalds (1):
Linux 2.6.22-rc3
are found in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas
Chris Ball (1):
libertas: wakeup both mesh and normal wakeup when getting out of scan
Dan Williams (25):
libertas: call SET_NETDEV_DEV from common code
libertas: replace 'macaddress' with 'bssid'
libertas: correctly unregister mesh netdev on error
libertas: don't tear down netdev in libertas_activate_card
libertas: make scan result handling more flexible
libertas: fix 'keep previous scan' behavior
libertas: move channel changing into association framework
libertas: make association paths consistent
libertas: use MAC_FMT and MAC_ARG where appropriate
libertas: use compare_ether_addr() rather than memcmp() where appropriate
libertas: fix debug enter/leave prints for libertas_execute_next_command
libertas: correctly balance locking in libertas_process_rx_command
libertas: correct error report paths for wlan_fwt_list_ioctl
libertas: fix deadlock SIOCGIWSCAN handler
libertas: fix default adhoc channel
libertas: honor specific channel requests during association
libertas: send SIOCGIWSCAN event after partial scans too
libertas: debug print spacing fixes in assoc.c
libertas: add more verbose debugging to libertas_cmd_80211_authenticate
libertas: Make WPA work through supplicant handshake
libertas: sparse fixes
libertas: tweak association debug output
libertas: remove structure WLAN_802_11_SSID and libertas_escape_essid
libertas: remove WPA_SUPPLICANT structure
libertas: reduce SSID and BSSID mixed-case abuse
David Woodhouse (6):
libertas: fix character set in README
libertas: first pass at fixing up endianness issues
libertas: More endianness fixes.
libertas: more endianness fixes, in tx.c this time
libertas: don't byte-swap firmware version number. It's a byte array.
libertas: fix big-endian associate command.
Holger Schurig (23):
libertas: rename wlan_association_worker
libertas: a debug output was missing a newline
libertas: fix removal of all debugfs files
libertas: remove __FILE__ from debug output
libertas: remove unused/superfluous definitions of DEV_NAME_LEN
libertas: move vendor & product id's into if_usb.c
libertas: make libertas_wlan_data_rates static
libertas: exclude non-used code when PROC_DEBUG is not set
libertas: make debug configurable
libertas: tune debug code
libertas: single out mesh code
libertas: change debug output of libertas_interrupt()
libertas: get rid of libertas_sbi_get_priv()
libertas: fix SSID output
libertas: changed some occurences of kmalloc() + memset(&a,0,sz) to kzalloc()
libertas: move reset_device() code main.c to if_usb.c
libertas: split wlan_add_card()
libertas: indirect all hardware access via hw_XXXX functions
libertas: move contents of fw.h to decl.h
libertas: split module into two (libertas.ko and usb8xxx.ko)
libertas: fix RESET logic at unload time
libertas: let DRV_NAME be overridable
libertas: remove unused variables in wlan_dev_t
Javier Cardona (2):
libertas: fixed transmission flow control on the mesh interface
libertas: added transmission failures to mesh statistics
Luis Carlos Cobo (4):
libertas: fixed incorrect assigment of fcs errors to frag errors
libertas: add URB debug info
libertas: fixed kernel oops on module/card removal
libertas: updated mesh commands for 5.220.9.p11
Luis Carlos Cobo Rus (6):
libertas: version bump (321p0) and cmds update for new fw (5.220.10.p0)
libertas: cleanup of fwt_list_route processing
libertas: updated readme file
libertas: make mac address configuration work with mesh interface too
libertas: split wext for eth and msh
libertas: support for mesh autostart on firmware 5.220.11
Marcelo Tosatti (5):
libertas: scan two channels per scan command
libertas: remove deprecated pm_register and associated code
libertas: fix scanning from associate path
libertas: fix error handling of card initialization
libertas: fix oops on rmmod
drivers/net/wireless/Kconfig | 19 +-
drivers/net/wireless/libertas/11d.c | 152 ++--
drivers/net/wireless/libertas/11d.h | 6 +-
drivers/net/wireless/libertas/Makefile | 4 +-
drivers/net/wireless/libertas/README | 52 +-
drivers/net/wireless/libertas/assoc.c | 345 +++++---
drivers/net/wireless/libertas/assoc.h | 8 +-
drivers/net/wireless/libertas/cmd.c | 559 +++++------
drivers/net/wireless/libertas/cmdresp.c | 375 ++++----
drivers/net/wireless/libertas/debugfs.c | 432 ++++----
drivers/net/wireless/libertas/decl.h | 20 +-
drivers/net/wireless/libertas/defs.h | 101 ++-
drivers/net/wireless/libertas/dev.h | 98 +-
drivers/net/wireless/libertas/ethtool.c | 55 +-
drivers/net/wireless/libertas/fw.c | 111 +--
drivers/net/wireless/libertas/fw.h | 13 -
drivers/net/wireless/libertas/host.h | 13 +-
drivers/net/wireless/libertas/hostcmd.h | 392 ++++----
drivers/net/wireless/libertas/if_bootcmd.c | 6 +-
drivers/net/wireless/libertas/if_usb.c | 448 +++++----
drivers/net/wireless/libertas/if_usb.h | 32 +-
drivers/net/wireless/libertas/ioctl.c | 286 ++++--
drivers/net/wireless/libertas/join.c | 464 ++++-----
drivers/net/wireless/libertas/join.h | 13 +-
drivers/net/wireless/libertas/main.c | 673 ++++++-------
drivers/net/wireless/libertas/rx.c | 63 +-
drivers/net/wireless/libertas/sbi.h | 40 -
drivers/net/wireless/libertas/scan.c | 1529 +++++++++++++---------------
drivers/net/wireless/libertas/scan.h | 81 +-
drivers/net/wireless/libertas/thread.h | 8 +-
drivers/net/wireless/libertas/tx.c | 74 +-
drivers/net/wireless/libertas/types.h | 63 +-
drivers/net/wireless/libertas/wext.c | 778 ++++++++-------
drivers/net/wireless/libertas/wext.h | 13 +-
34 files changed, 3679 insertions(+), 3647 deletions(-)
delete mode 100644 drivers/net/wireless/libertas/fw.h
delete mode 100644 drivers/net/wireless/libertas/sbi.h
Omnibus patch attached as "libertas.patch.bz2" due to size concerns.
--
John W. Linville
linville@tuxdriver.com
[-- Attachment #2: libertas.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 76006 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Please pull 'libertas' branch of wireless-2.6
2007-05-29 18:33 Please pull 'libertas' " John W. Linville
@ 2007-06-12 21:05 ` John W. Linville
2007-06-12 21:06 ` Please pull 'libertas-fixes' " John W. Linville
0 siblings, 1 reply; 8+ messages in thread
From: John W. Linville @ 2007-06-12 21:05 UTC (permalink / raw)
To: jeff; +Cc: linux-wireless, netdev, Dan Williams
[-- Attachment #1: Type: text/plain, Size: 6911 bytes --]
Jeff,
This is the same as the previous pull request, only rebased on
2.6.22-rc4. Since this is a big pull already, I didn't want to
complicate it with the additional patches identified by the libertas
team as 2.6.22-worthy.
John
---
The following changes since commit 5ecd3100e695228ac5e0ce0e325e252c0f11806f:
Linus Torvalds (1):
Linux 2.6.22-rc4
are found in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas
Chris Ball (1):
libertas: wakeup both mesh and normal wakeup when getting out of scan
Dan Williams (25):
libertas: call SET_NETDEV_DEV from common code
libertas: replace 'macaddress' with 'bssid'
libertas: correctly unregister mesh netdev on error
libertas: don't tear down netdev in libertas_activate_card
libertas: make scan result handling more flexible
libertas: fix 'keep previous scan' behavior
libertas: move channel changing into association framework
libertas: make association paths consistent
libertas: use MAC_FMT and MAC_ARG where appropriate
libertas: use compare_ether_addr() rather than memcmp() where appropriate
libertas: fix debug enter/leave prints for libertas_execute_next_command
libertas: correctly balance locking in libertas_process_rx_command
libertas: correct error report paths for wlan_fwt_list_ioctl
libertas: fix deadlock SIOCGIWSCAN handler
libertas: fix default adhoc channel
libertas: honor specific channel requests during association
libertas: send SIOCGIWSCAN event after partial scans too
libertas: debug print spacing fixes in assoc.c
libertas: add more verbose debugging to libertas_cmd_80211_authenticate
libertas: Make WPA work through supplicant handshake
libertas: sparse fixes
libertas: tweak association debug output
libertas: remove structure WLAN_802_11_SSID and libertas_escape_essid
libertas: remove WPA_SUPPLICANT structure
libertas: reduce SSID and BSSID mixed-case abuse
David Woodhouse (6):
libertas: fix character set in README
libertas: first pass at fixing up endianness issues
libertas: More endianness fixes.
libertas: more endianness fixes, in tx.c this time
libertas: don't byte-swap firmware version number. It's a byte array.
libertas: fix big-endian associate command.
Holger Schurig (23):
libertas: rename wlan_association_worker
libertas: a debug output was missing a newline
libertas: fix removal of all debugfs files
libertas: remove __FILE__ from debug output
libertas: remove unused/superfluous definitions of DEV_NAME_LEN
libertas: move vendor & product id's into if_usb.c
libertas: make libertas_wlan_data_rates static
libertas: exclude non-used code when PROC_DEBUG is not set
libertas: make debug configurable
libertas: tune debug code
libertas: single out mesh code
libertas: change debug output of libertas_interrupt()
libertas: get rid of libertas_sbi_get_priv()
libertas: fix SSID output
libertas: changed some occurences of kmalloc() + memset(&a,0,sz) to kzalloc()
libertas: move reset_device() code main.c to if_usb.c
libertas: split wlan_add_card()
libertas: indirect all hardware access via hw_XXXX functions
libertas: move contents of fw.h to decl.h
libertas: split module into two (libertas.ko and usb8xxx.ko)
libertas: fix RESET logic at unload time
libertas: let DRV_NAME be overridable
libertas: remove unused variables in wlan_dev_t
Javier Cardona (2):
libertas: fixed transmission flow control on the mesh interface
libertas: added transmission failures to mesh statistics
Luis Carlos Cobo (4):
libertas: fixed incorrect assigment of fcs errors to frag errors
libertas: add URB debug info
libertas: fixed kernel oops on module/card removal
libertas: updated mesh commands for 5.220.9.p11
Luis Carlos Cobo Rus (6):
libertas: version bump (321p0) and cmds update for new fw (5.220.10.p0)
libertas: cleanup of fwt_list_route processing
libertas: updated readme file
libertas: make mac address configuration work with mesh interface too
libertas: split wext for eth and msh
libertas: support for mesh autostart on firmware 5.220.11
Marcelo Tosatti (5):
libertas: scan two channels per scan command
libertas: remove deprecated pm_register and associated code
libertas: fix scanning from associate path
libertas: fix error handling of card initialization
libertas: fix oops on rmmod
drivers/net/wireless/Kconfig | 19 +-
drivers/net/wireless/libertas/11d.c | 152 ++--
drivers/net/wireless/libertas/11d.h | 6 +-
drivers/net/wireless/libertas/Makefile | 4 +-
drivers/net/wireless/libertas/README | 52 +-
drivers/net/wireless/libertas/assoc.c | 345 +++++---
drivers/net/wireless/libertas/assoc.h | 8 +-
drivers/net/wireless/libertas/cmd.c | 559 +++++------
drivers/net/wireless/libertas/cmdresp.c | 375 ++++----
drivers/net/wireless/libertas/debugfs.c | 432 ++++----
drivers/net/wireless/libertas/decl.h | 20 +-
drivers/net/wireless/libertas/defs.h | 101 ++-
drivers/net/wireless/libertas/dev.h | 98 +-
drivers/net/wireless/libertas/ethtool.c | 55 +-
drivers/net/wireless/libertas/fw.c | 111 +--
drivers/net/wireless/libertas/fw.h | 13 -
drivers/net/wireless/libertas/host.h | 13 +-
drivers/net/wireless/libertas/hostcmd.h | 392 ++++----
drivers/net/wireless/libertas/if_bootcmd.c | 6 +-
drivers/net/wireless/libertas/if_usb.c | 448 +++++----
drivers/net/wireless/libertas/if_usb.h | 32 +-
drivers/net/wireless/libertas/ioctl.c | 286 ++++--
drivers/net/wireless/libertas/join.c | 464 ++++-----
drivers/net/wireless/libertas/join.h | 13 +-
drivers/net/wireless/libertas/main.c | 673 ++++++-------
drivers/net/wireless/libertas/rx.c | 63 +-
drivers/net/wireless/libertas/sbi.h | 40 -
drivers/net/wireless/libertas/scan.c | 1529 +++++++++++++---------------
drivers/net/wireless/libertas/scan.h | 81 +-
drivers/net/wireless/libertas/thread.h | 8 +-
drivers/net/wireless/libertas/tx.c | 74 +-
drivers/net/wireless/libertas/types.h | 63 +-
drivers/net/wireless/libertas/wext.c | 778 ++++++++-------
drivers/net/wireless/libertas/wext.h | 13 +-
34 files changed, 3679 insertions(+), 3647 deletions(-)
delete mode 100644 drivers/net/wireless/libertas/fw.h
delete mode 100644 drivers/net/wireless/libertas/sbi.h
Omnibus patch attached as "libertas.diff.bz2" due to size concerns.
--
John W. Linville
linville@tuxdriver.com
[-- Attachment #2: libertas.diff.bz2 --]
[-- Type: application/x-bzip2, Size: 75879 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread* Please pull 'libertas-fixes' branch of wireless-2.6
2007-06-12 21:05 ` John W. Linville
@ 2007-06-12 21:06 ` John W. Linville
[not found] ` <20070612210658.GG310-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: John W. Linville @ 2007-06-12 21:06 UTC (permalink / raw)
To: jeff; +Cc: linux-wireless, netdev, Dan Williams
Fixes identified by the libertas team as important for 2.6.22...
---
The following changes since commit 717c9339202a42ae7bec7d3c4b84deecdcae9f81:
Dan Williams (1):
libertas: reduce SSID and BSSID mixed-case abuse
are found in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git libertas-fixes
Dan Williams (1):
libertas: actually send mesh frames to mesh netdev
Luis Carlos (1):
libertas: convert libertas_mpp into anycast_mask
Luis Carlos Cobo Rus (2):
libertas: pull current channel from firmware on mesh autostart
libertas: deauthenticate from AP in channel switch
drivers/net/wireless/libertas/assoc.c | 13 +++++++++++++
drivers/net/wireless/libertas/assoc.h | 2 ++
drivers/net/wireless/libertas/cmdresp.c | 1 +
drivers/net/wireless/libertas/dev.h | 1 +
drivers/net/wireless/libertas/host.h | 4 ++--
drivers/net/wireless/libertas/main.c | 27 ++++++++++++++-------------
drivers/net/wireless/libertas/rx.c | 5 ++---
7 files changed, 35 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index ee82413..f67efa0 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -200,6 +200,14 @@ static int update_channel(wlan_private * priv)
cmd_option_waitforrsp, 0, NULL);
}
+void libertas_sync_channel(struct work_struct *work)
+{
+ wlan_private *priv = container_of(work, wlan_private, sync_channel);
+
+ if (update_channel(priv) != 0)
+ lbs_pr_info("Channel synchronization failed.");
+}
+
static int assoc_helper_channel(wlan_private *priv,
struct assoc_request * assoc_req)
{
@@ -403,6 +411,11 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
return 1;
}
+ if (test_bit(ASSOC_FLAG_CHANNEL, &assoc_req->flags)) {
+ lbs_deb_assoc("Deauthenticating due to channel switch.\n");
+ return 1;
+ }
+
/* FIXME: deal with 'auto' mode somehow */
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
if (assoc_req->mode != IW_MODE_INFRA)
diff --git a/drivers/net/wireless/libertas/assoc.h b/drivers/net/wireless/libertas/assoc.h
index b5eddf8..5e9c31f 100644
--- a/drivers/net/wireless/libertas/assoc.h
+++ b/drivers/net/wireless/libertas/assoc.h
@@ -9,6 +9,8 @@ void libertas_association_worker(struct work_struct *work);
struct assoc_request * wlan_get_association_request(wlan_adapter *adapter);
+void libertas_sync_channel(struct work_struct *work);
+
#define ASSOC_DELAY (HZ / 2)
static inline void wlan_postpone_association_work(wlan_private *priv)
{
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index ebedd63..0c3b9a5 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -987,6 +987,7 @@ int libertas_process_event(wlan_private * priv)
netif_carrier_on(priv->mesh_dev) ;
}
adapter->mode = IW_MODE_ADHOC ;
+ schedule_work(&priv->sync_channel);
break;
default:
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index d6c340a..785192b 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -150,6 +150,7 @@ struct _wlan_private {
struct delayed_work assoc_work;
struct workqueue_struct *assoc_thread;
+ struct work_struct sync_channel;
/** Hardware access */
int (*hw_register_dev) (wlan_private * priv);
diff --git a/drivers/net/wireless/libertas/host.h b/drivers/net/wireless/libertas/host.h
index cedf1db..7509cc1 100644
--- a/drivers/net/wireless/libertas/host.h
+++ b/drivers/net/wireless/libertas/host.h
@@ -310,8 +310,8 @@ enum cmd_mesh_access_opts {
cmd_act_mesh_get_ttl = 1,
cmd_act_mesh_set_ttl,
cmd_act_mesh_get_stats,
- cmd_act_mesh_get_mpp,
- cmd_act_mesh_set_mpp,
+ cmd_act_mesh_get_anycast,
+ cmd_act_mesh_set_anycast,
};
/** Card Event definition */
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index ec9be0c..623ab4b 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -178,45 +178,45 @@ u16 libertas_region_code_to_index[MRVDRV_MAX_REGION_CODE] =
*/
/**
- * @brief Get function for sysfs attribute libertas_mpp
+ * @brief Get function for sysfs attribute anycast_mask
*/
-static ssize_t libertas_mpp_get(struct device * dev,
+static ssize_t libertas_anycast_get(struct device * dev,
struct device_attribute *attr, char * buf) {
struct cmd_ds_mesh_access mesh_access;
memset(&mesh_access, 0, sizeof(mesh_access));
libertas_prepare_and_send_command(to_net_dev(dev)->priv,
cmd_mesh_access,
- cmd_act_mesh_get_mpp,
+ cmd_act_mesh_get_anycast,
cmd_option_waitforrsp, 0, (void *)&mesh_access);
- return snprintf(buf, 3, "%d\n", le32_to_cpu(mesh_access.data[0]));
+ return snprintf(buf, 12, "0x%X\n", le32_to_cpu(mesh_access.data[0]));
}
/**
- * @brief Set function for sysfs attribute libertas_mpp
+ * @brief Set function for sysfs attribute anycast_mask
*/
-static ssize_t libertas_mpp_set(struct device * dev,
+static ssize_t libertas_anycast_set(struct device * dev,
struct device_attribute *attr, const char * buf, size_t count) {
struct cmd_ds_mesh_access mesh_access;
uint32_t datum;
memset(&mesh_access, 0, sizeof(mesh_access));
- sscanf(buf, "%d", &datum);
+ sscanf(buf, "%x", &datum);
mesh_access.data[0] = cpu_to_le32(datum);
libertas_prepare_and_send_command((to_net_dev(dev))->priv,
cmd_mesh_access,
- cmd_act_mesh_set_mpp,
+ cmd_act_mesh_set_anycast,
cmd_option_waitforrsp, 0, (void *)&mesh_access);
return strlen(buf);
}
/**
- * libertas_mpp attribute to be exported per mshX interface
- * through sysfs (/sys/class/net/mshX/libertas-mpp)
+ * anycast_mask attribute to be exported per mshX interface
+ * through sysfs (/sys/class/net/mshX/anycast_mask)
*/
-static DEVICE_ATTR(libertas_mpp, 0644, libertas_mpp_get, libertas_mpp_set );
+static DEVICE_ATTR(anycast_mask, 0644, libertas_anycast_get, libertas_anycast_set);
/**
* @brief Check if the device can be open and wait if necessary.
@@ -847,6 +847,7 @@ int libertas_activate_card(wlan_private *priv, char *fw_name)
priv->assoc_thread =
create_singlethread_workqueue("libertas_assoc");
INIT_DELAYED_WORK(&priv->assoc_work, libertas_association_worker);
+ INIT_WORK(&priv->sync_channel, libertas_sync_channel);
/*
* Register the device. Fillup the private data structure with
@@ -938,7 +939,7 @@ int libertas_add_mesh(wlan_private *priv, struct device *dev)
goto err_free;
}
- ret = device_create_file(&(mesh_dev->dev), &dev_attr_libertas_mpp);
+ ret = device_create_file(&(mesh_dev->dev), &dev_attr_anycast_mask);
if (ret)
goto err_unregister;
@@ -1048,7 +1049,7 @@ void libertas_remove_mesh(wlan_private *priv)
netif_stop_queue(mesh_dev);
netif_carrier_off(priv->mesh_dev);
- device_remove_file(&(mesh_dev->dev), &dev_attr_libertas_mpp);
+ device_remove_file(&(mesh_dev->dev), &dev_attr_anycast_mask);
unregister_netdev(mesh_dev);
priv->mesh_dev = NULL ;
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index 5d70a76..88d9d2d 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -141,10 +141,9 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
lbs_deb_rx("skb->data %p\n", skb->data);
if (priv->mesh_dev && IS_MESH_FRAME(skb))
- skb->dev = priv->mesh_dev;
+ skb->protocol = eth_type_trans(skb, priv->mesh_dev);
else
- skb->dev = priv->dev;
- skb->protocol = eth_type_trans(skb, priv->dev);
+ skb->protocol = eth_type_trans(skb, priv->dev);
skb->ip_summed = CHECKSUM_UNNECESSARY;
netif_rx(skb);
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-07-03 18:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-03 18:48 Please pull 'libertas-fixes' branch of wireless-2.6 John W. Linville
-- strict thread matches above, loose matches on Subject: below --
2007-06-27 20:55 John W. Linville
[not found] ` <20070627205539.GB13617-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-07-02 11:07 ` Dan Williams
2007-07-02 12:14 ` Jeff Garzik
2007-05-29 18:33 Please pull 'libertas' " John W. Linville
2007-06-12 21:05 ` John W. Linville
2007-06-12 21:06 ` Please pull 'libertas-fixes' " John W. Linville
[not found] ` <20070612210658.GG310-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
2007-06-12 22:54 ` Jeff Garzik
2007-06-13 0:03 ` John W. Linville
2007-06-13 2:28 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).