Commit 17cf8cc9 authored by Jeff Garzik's avatar Jeff Garzik

Merge branch 'libertas' of...

Merge branch 'libertas' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream
parents 12414db1 4269e2ad
# EXTRA_CFLAGS += -Wpacked
usb8xxx-objs := main.o fw.o wext.o \
rx.o tx.o cmd.o \
cmdresp.o scan.o \
......@@ -7,13 +5,6 @@ usb8xxx-objs := main.o fw.o wext.o \
ioctl.o debugfs.o \
ethtool.o assoc.o
ifeq ($(CONFIG_LIBERTAS_USB_DEBUG), y)
EXTRA_CFLAGS += -DDEBUG -DPROC_DEBUG
endif
# This is needed to support the newer boot2 bootloader (v >= 3104)
EXTRA_CFLAGS += -DSUPPORT_BOOT_COMMAND
usb8xxx-objs += if_bootcmd.o
usb8xxx-objs += if_usb.o
......
This diff is collapsed.
......@@ -23,13 +23,13 @@ static int assoc_helper_essid(wlan_private *priv,
ENTER();
lbs_pr_debug(1, "New SSID requested: %s\n", assoc_req->ssid.ssid);
if (assoc_req->mode == wlan802_11infrastructure) {
if (assoc_req->mode == IW_MODE_INFRA) {
if (adapter->prescan) {
libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1);
}
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid,
NULL, wlan802_11infrastructure);
NULL, IW_MODE_INFRA);
if (i >= 0) {
lbs_pr_debug(1,
"SSID found in scan list ... associating...\n");
......@@ -44,7 +44,7 @@ static int assoc_helper_essid(wlan_private *priv,
lbs_pr_debug(1, "SSID '%s' not found; cannot associate\n",
assoc_req->ssid.ssid);
}
} else if (assoc_req->mode == wlan802_11ibss) {
} else if (assoc_req->mode == IW_MODE_ADHOC) {
/* Scan for the network, do not save previous results. Stale
* scan data will cause us to join a non-existant adhoc network
*/
......@@ -52,7 +52,7 @@ static int assoc_helper_essid(wlan_private *priv,
/* Search for the requested SSID in the scan table */
i = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL,
wlan802_11ibss);
IW_MODE_ADHOC);
if (i >= 0) {
lbs_pr_debug(1, "SSID found at %d in List, so join\n", ret);
libertas_join_adhoc_network(priv, &adapter->scantable[i]);
......@@ -90,10 +90,10 @@ static int assoc_helper_bssid(wlan_private *priv,
goto out;
}
if (assoc_req->mode == wlan802_11infrastructure) {
if (assoc_req->mode == IW_MODE_INFRA) {
ret = wlan_associate(priv, &adapter->scantable[i]);
lbs_pr_debug(1, "ASSOC: return from wlan_associate(bssd) was %d\n", ret);
} else if (assoc_req->mode == wlan802_11ibss) {
} else if (assoc_req->mode == IW_MODE_ADHOC) {
libertas_join_adhoc_network(priv, &adapter->scantable[i]);
}
memcpy(&assoc_req->ssid, &adapter->scantable[i].ssid,
......@@ -142,23 +142,23 @@ static int assoc_helper_mode(wlan_private *priv,
ENTER();
if (assoc_req->mode == adapter->inframode) {
if (assoc_req->mode == adapter->mode) {
LEAVE();
return 0;
}
if (assoc_req->mode == wlan802_11infrastructure) {
if (assoc_req->mode == IW_MODE_INFRA) {
if (adapter->psstate != PS_STATE_FULL_POWER)
libertas_ps_wakeup(priv, cmd_option_waitforrsp);
adapter->psmode = wlan802_11powermodecam;
}
adapter->inframode = assoc_req->mode;
adapter->mode = assoc_req->mode;
ret = libertas_prepare_and_send_command(priv,
cmd_802_11_snmp_mib,
0, cmd_option_waitforrsp,
OID_802_11_INFRASTRUCTURE_MODE,
(void *) assoc_req->mode);
(void *) (size_t) assoc_req->mode);
LEAVE();
return ret;
......@@ -196,7 +196,7 @@ static int assoc_helper_wep_keys(wlan_private *priv,
goto out;
/* enable/disable the MAC's WEP packet filter */
if (assoc_req->secinfo.WEPstatus == wlan802_11WEPenabled)
if (assoc_req->secinfo.wep_enabled)
adapter->currentpacketfilter |= cmd_act_mac_wep_enable;
else
adapter->currentpacketfilter &= ~cmd_act_mac_wep_enable;
......@@ -300,8 +300,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
}
if (test_bit(ASSOC_FLAG_SECINFO, &assoc_req->flags)) {
if (adapter->secinfo.authmode !=
assoc_req->secinfo.authmode) {
if (adapter->secinfo.auth_mode != assoc_req->secinfo.auth_mode) {
lbs_pr_debug(1, "Deauthenticating due to updated security "
"info in configuration request.\n");
return 1;
......@@ -316,7 +315,7 @@ static int should_deauth_infrastructure(wlan_adapter *adapter,
/* FIXME: deal with 'auto' mode somehow */
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
if (assoc_req->mode != wlan802_11infrastructure)
if (assoc_req->mode != IW_MODE_INFRA)
return 1;
}
......@@ -333,12 +332,12 @@ static int should_stop_adhoc(wlan_adapter *adapter,
if (adapter->curbssparams.ssid.ssidlength != assoc_req->ssid.ssidlength)
return 1;
if (memcmp(adapter->curbssparams.ssid.ssid, assoc_req->ssid.ssid,
sizeof(struct WLAN_802_11_SSID)))
adapter->curbssparams.ssid.ssidlength))
return 1;
/* FIXME: deal with 'auto' mode somehow */
if (test_bit(ASSOC_FLAG_MODE, &assoc_req->flags)) {
if (assoc_req->mode != wlan802_11ibss)
if (assoc_req->mode != IW_MODE_ADHOC)
return 1;
}
......@@ -382,7 +381,7 @@ void wlan_association_worker(struct work_struct *work)
}
if (find_any_ssid) {
enum WLAN_802_11_NETWORK_INFRASTRUCTURE new_mode;
u8 new_mode;
ret = libertas_find_best_network_SSID(priv, &assoc_req->ssid,
assoc_req->mode, &new_mode);
......@@ -393,7 +392,7 @@ void wlan_association_worker(struct work_struct *work)
}
/* Ensure we switch to the mode of the AP */
if (assoc_req->mode == wlan802_11autounknown) {
if (assoc_req->mode == IW_MODE_AUTO) {
set_bit(ASSOC_FLAG_MODE, &assoc_req->flags);
assoc_req->mode = new_mode;
}
......@@ -403,7 +402,7 @@ void wlan_association_worker(struct work_struct *work)
* Check if the attributes being changing require deauthentication
* from the currently associated infrastructure access point.
*/
if (adapter->inframode == wlan802_11infrastructure) {
if (adapter->mode == IW_MODE_INFRA) {
if (should_deauth_infrastructure(adapter, assoc_req)) {
ret = libertas_send_deauthentication(priv);
if (ret) {
......@@ -412,7 +411,7 @@ void wlan_association_worker(struct work_struct *work)
ret);
}
}
} else if (adapter->inframode == wlan802_11ibss) {
} else if (adapter->mode == IW_MODE_ADHOC) {
if (should_stop_adhoc(adapter, assoc_req)) {
ret = libertas_stop_adhoc_network(priv);
if (ret) {
......@@ -543,7 +542,7 @@ struct assoc_request * wlan_get_association_request(wlan_adapter *adapter)
assoc_req->channel = adapter->curbssparams.channel;
if (!test_bit(ASSOC_FLAG_MODE, &assoc_req->flags))
assoc_req->mode = adapter->inframode;
assoc_req->mode = adapter->mode;
if (!test_bit(ASSOC_FLAG_BSSID, &assoc_req->flags)) {
memcpy(&assoc_req->bssid, adapter->curbssparams.bssid,
......
......@@ -381,15 +381,16 @@ static int wlan_cmd_802_11_snmp_mib(wlan_private * priv,
switch (cmd_oid) {
case OID_802_11_INFRASTRUCTURE_MODE:
{
enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode =
(enum WLAN_802_11_NETWORK_INFRASTRUCTURE) pdata_buf;
u8 mode = (u8) (size_t) pdata_buf;
pSNMPMIB->querytype = cpu_to_le16(cmd_act_set);
pSNMPMIB->oid = cpu_to_le16((u16) desired_bsstype_i);
pSNMPMIB->bufsize = sizeof(u8);
if (mode == wlan802_11infrastructure)
ucTemp = SNMP_MIB_VALUE_INFRA;
else
if (mode == IW_MODE_ADHOC) {
ucTemp = SNMP_MIB_VALUE_ADHOC;
} else {
/* Infra and Auto modes */
ucTemp = SNMP_MIB_VALUE_INFRA;
}
memmove(pSNMPMIB->value, &ucTemp, sizeof(u8));
......@@ -947,8 +948,8 @@ void libertas_queue_cmd(wlan_adapter * adapter, struct cmd_ctrl_node *cmdnode, u
spin_unlock_irqrestore(&adapter->driver_lock, flags);
lbs_pr_debug(1, "QUEUE_CMD: Inserted node=0x%x, cmd=0x%x in cmdpendingq\n",
(u32) cmdnode,
lbs_pr_debug(1, "QUEUE_CMD: Inserted node=%p, cmd=0x%x in cmdpendingq\n",
cmdnode,
((struct cmd_ds_gen*)cmdnode->bufvirtualaddr)->command);
done:
......@@ -976,8 +977,8 @@ static int DownloadcommandToStation(wlan_private * priv,
ENTER();
if (!adapter || !cmdnode) {
lbs_pr_debug(1, "DNLD_CMD: adapter = %#x, cmdnode = %#x\n",
(int)adapter, (int)cmdnode);
lbs_pr_debug(1, "DNLD_CMD: adapter = %p, cmdnode = %p\n",
adapter, cmdnode);
if (cmdnode) {
spin_lock_irqsave(&adapter->driver_lock, flags);
__libertas_cleanup_and_insert_cmd(priv, cmdnode);
......@@ -1174,8 +1175,8 @@ int libertas_prepare_and_send_command(wlan_private * priv,
cmdptr = (struct cmd_ds_command *)cmdnode->bufvirtualaddr;
lbs_pr_debug(1, "PREP_CMD: Val of cmd ptr =0x%x, command=0x%X\n",
(u32) cmdptr, cmd_no);
lbs_pr_debug(1, "PREP_CMD: Val of cmd ptr=%p, command=0x%X\n",
cmdptr, cmd_no);
if (!cmdptr) {
lbs_pr_debug(1, "PREP_CMD: bufvirtualaddr of cmdnode is NULL\n");
......
......@@ -72,8 +72,6 @@ void libertas_mac_event_disconnected(wlan_private * priv)
adapter->secinfo.WPAenabled = 0;
adapter->secinfo.WPA2enabled = 0;
adapter->wpa_ie_len = 0;
adapter->secinfo.auth1xalg = WLAN_1X_AUTH_ALG_NONE;
adapter->secinfo.Encryptionmode = CIPHER_NONE;
adapter->connect_status = libertas_disconnected;
......@@ -811,7 +809,7 @@ int libertas_process_rx_command(wlan_private * priv)
if (result) {
lbs_pr_debug(1, "CMD_RESP: PS command failed- %#x \n",
resp->result);
if (adapter->inframode == wlan802_11ibss) {
if (adapter->mode == IW_MODE_ADHOC) {
/*
* We should not re-try enter-ps command in
* ad-hoc mode. It takes place in
......
......@@ -7,6 +7,7 @@
#include "dev.h"
#include "decl.h"
#include "host.h"
#include "debugfs.h"
static struct dentry *libertas_dir = NULL;
static char *szStates[] = {
......@@ -276,7 +277,7 @@ static void libertas_parse_ssid(char *buf, size_t count,
if (!end)
end = buf + count - 1;
size = min(IW_ESSID_MAX_SIZE, end - hold);
size = min((size_t)IW_ESSID_MAX_SIZE, (size_t) (end - hold));
strncpy(scan_cfg->specificSSID, hold, size);
return;
......@@ -1648,7 +1649,7 @@ struct libertas_debugfs_files {
struct file_operations fops;
};
struct libertas_debugfs_files debugfs_files[] = {
static struct libertas_debugfs_files debugfs_files[] = {
{ "info", 0444, FOPS(libertas_dev_info, write_file_dummy), },
{ "getscantable", 0444, FOPS(libertas_getscantable,
write_file_dummy), },
......@@ -1658,7 +1659,7 @@ struct libertas_debugfs_files debugfs_files[] = {
{ "setuserscan", 0600, FOPS(NULL, libertas_setuserscan), },
};
struct libertas_debugfs_files debugfs_events_files[] = {
static struct libertas_debugfs_files debugfs_events_files[] = {
{"low_rssi", 0644, FOPS(libertas_lowrssi_read,
libertas_lowrssi_write), },
{"low_snr", 0644, FOPS(libertas_lowsnr_read,
......@@ -1673,7 +1674,7 @@ struct libertas_debugfs_files debugfs_events_files[] = {
libertas_highsnr_write), },
};
struct libertas_debugfs_files debugfs_regs_files[] = {
static struct libertas_debugfs_files debugfs_regs_files[] = {
{"rdmac", 0644, FOPS(libertas_rdmac_read, libertas_rdmac_write), },
{"wrmac", 0600, FOPS(NULL, libertas_wrmac_write), },
{"rdbbp", 0644, FOPS(libertas_rdbbp_read, libertas_rdbbp_write), },
......@@ -1778,7 +1779,7 @@ void libertas_debugfs_remove_one(wlan_private *priv)
struct debug_data {
char name[32];
u32 size;
u32 addr;
size_t addr;
};
/* To debug any member of wlan_adapter, simply add one line here.
......@@ -1825,6 +1826,8 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf,
val = *((u16 *) d[i].addr);
else if (d[i].size == 4)
val = *((u32 *) d[i].addr);
else if (d[i].size == 8)
val = *((u64 *) d[i].addr);
pos += sprintf(p + pos, "%s=%d\n", d[i].name, val);
}
......@@ -1844,7 +1847,7 @@ static ssize_t wlan_debugfs_read(struct file *file, char __user *userbuf,
* @param data data to write
* @return number of data
*/
static int wlan_debugfs_write(struct file *f, const char __user *buf,
static ssize_t wlan_debugfs_write(struct file *f, const char __user *buf,
size_t cnt, loff_t *ppos)
{
int r, i;
......@@ -1886,12 +1889,14 @@ static int wlan_debugfs_write(struct file *f, const char __user *buf,
*((u16 *) d[i].addr) = (u16) r;
else if (d[i].size == 4)
*((u32 *) d[i].addr) = (u32) r;
else if (d[i].size == 8)
*((u64 *) d[i].addr) = (u64) r;
break;
} while (1);
}
kfree(pdata);
return cnt;
return (ssize_t)cnt;
}
static struct file_operations libertas_debug_fops = {
......@@ -1916,20 +1921,10 @@ void libertas_debug_init(wlan_private * priv, struct net_device *dev)
return;
for (i = 0; i < num_of_items; i++)
items[i].addr += (u32) priv->adapter;
items[i].addr += (size_t) priv->adapter;
priv->debugfs_debug = debugfs_create_file("debug", 0644,
priv->debugfs_dir, &items[0],
&libertas_debug_fops);
}
/**
* @brief remove proc file
*
* @param priv pointer wlan_private
* @return N/A
*/
void libertas_debug_remove(wlan_private * priv)
{
debugfs_remove(priv->debugfs_debug);
}
......@@ -9,6 +9,11 @@
extern unsigned int libertas_debug;
#ifdef CONFIG_LIBERTAS_DEBUG
#define DEBUG
#define PROC_DEBUG
#endif
#define DRV_NAME "usb8xxx"
#define lbs_pr_info(format, args...) \
......@@ -223,31 +228,6 @@ enum SNRNF_DATA {
MAX_TYPE_AVG
};
/** WLAN_802_11_AUTH_ALG*/
enum WLAN_802_11_AUTH_ALG {
AUTH_ALG_OPEN_SYSTEM = 1,
AUTH_ALG_SHARED_KEY = 2,
AUTH_ALG_NETWORK_EAP = 8,
};
/** WLAN_802_1X_AUTH_ALG */
enum WLAN_802_1X_AUTH_ALG {
WLAN_1X_AUTH_ALG_NONE = 1,
WLAN_1X_AUTH_ALG_LEAP = 2,
WLAN_1X_AUTH_ALG_TLS = 4,
WLAN_1X_AUTH_ALG_TTLS = 8,
WLAN_1X_AUTH_ALG_MD5 = 16,
};
/** WLAN_802_11_ENCRYPTION_MODE */
enum WLAN_802_11_ENCRYPTION_MODE {
CIPHER_NONE,
CIPHER_WEP40,
CIPHER_TKIP,
CIPHER_CCMP,
CIPHER_WEP104,
};
/** WLAN_802_11_POWER_MODE */
enum WLAN_802_11_POWER_MODE {
wlan802_11powermodecam,
......@@ -292,28 +272,6 @@ enum mv_ms_type {
MVMS_EVENT
};
/** WLAN_802_11_NETWORK_INFRASTRUCTURE */
enum WLAN_802_11_NETWORK_INFRASTRUCTURE {
wlan802_11ibss,
wlan802_11infrastructure,
wlan802_11autounknown,
/*defined as upper bound */
wlan802_11infrastructuremax
};
/** WLAN_802_11_AUTHENTICATION_MODE */
enum WLAN_802_11_AUTHENTICATION_MODE {
wlan802_11authmodeopen = 0x00,
wlan802_11authmodeshared = 0x01,
wlan802_11authmodenetworkEAP = 0x80,
};
/** WLAN_802_11_WEP_STATUS */
enum WLAN_802_11_WEP_STATUS {
wlan802_11WEPenabled,
wlan802_11WEPdisabled,
};
/** SNMP_MIB_INDEX_e */
enum SNMP_MIB_INDEX_e {
desired_bsstype_i = 0,
......
......@@ -10,6 +10,7 @@
#include <linux/wireless.h>
#include <linux/ethtool.h>
#include <linux/debugfs.h>
#include <net/ieee80211.h>
#include "defs.h"
#include "scan.h"
......@@ -56,10 +57,8 @@ struct region_channel {
struct wlan_802_11_security {
u8 WPAenabled;
u8 WPA2enabled;
enum WLAN_802_11_WEP_STATUS WEPstatus;
enum WLAN_802_11_AUTHENTICATION_MODE authmode;
enum WLAN_802_1X_AUTH_ALG auth1xalg;
enum WLAN_802_11_ENCRYPTION_MODE Encryptionmode;
u8 wep_enabled;
u8 auth_mode;
};
/** Current Basic Service Set State Structure */
......@@ -184,7 +183,7 @@ struct assoc_request {
struct WLAN_802_11_SSID ssid;
u8 channel;
enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode;
u8 mode;
u8 bssid[ETH_ALEN];
/** WEP keys */
......@@ -198,7 +197,6 @@ struct assoc_request {
struct wlan_802_11_security secinfo;
/** WPA Information Elements*/
#define MAX_WPA_IE_LEN 64
u8 wpa_ie[MAX_WPA_IE_LEN];
u8 wpa_ie_len;
};
......@@ -254,7 +252,8 @@ struct _wlan_adapter {
/** current ssid/bssid related parameters*/
struct current_bss_params curbssparams;
enum WLAN_802_11_NETWORK_INFRASTRUCTURE inframode;
/* IW_MODE_* */
u8 mode;
struct bss_descriptor *pattemptedbssdesc;
......@@ -339,7 +338,6 @@ struct _wlan_adapter {
struct WLAN_802_11_KEY wpa_unicast_key;
/** WPA Information Elements*/
#define MAX_WPA_IE_LEN 64
u8 wpa_ie[MAX_WPA_IE_LEN];
u8 wpa_ie_len;
......
......@@ -194,16 +194,13 @@ static void wlan_init_adapter(wlan_private * priv)
adapter->scanmode = cmd_bss_type_any;
/* 802.11 specific */
adapter->secinfo.WEPstatus = wlan802_11WEPdisabled;
adapter->secinfo.wep_enabled = 0;
for (i = 0; i < sizeof(adapter->wep_keys) / sizeof(adapter->wep_keys[0]);
i++)
memset(&adapter->wep_keys[i], 0, sizeof(struct WLAN_802_11_KEY));
adapter->wep_tx_keyidx = 0;
adapter->secinfo.WEPstatus = wlan802_11WEPdisabled;
adapter->secinfo.authmode = wlan802_11authmodeopen;
adapter->secinfo.auth1xalg = WLAN_1X_AUTH_ALG_NONE;
adapter->secinfo.Encryptionmode = CIPHER_NONE;
adapter->inframode = wlan802_11infrastructure;
adapter->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
adapter->mode = IW_MODE_INFRA;
adapter->assoc_req = NULL;
......
......@@ -388,7 +388,7 @@ static int __if_usb_submit_rx_urb(wlan_private * priv,
usb_fill_bulk_urb(cardp->rx_urb, cardp->udev,
usb_rcvbulkpipe(cardp->udev,
cardp->bulk_in_endpointAddr),
skb->tail + IPFIELD_ALIGN_OFFSET,
(void *) (skb->tail + (size_t) IPFIELD_ALIGN_OFFSET),
MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn,
rinfo);
......@@ -626,6 +626,7 @@ static void if_usb_receive(struct urb *urb)
cardp->usb_event_cause);
if (cardp->usb_event_cause & 0xffff0000) {
libertas_send_tx_feedback(priv);
spin_unlock(&priv->adapter->driver_lock);
break;
}
cardp->usb_event_cause = le32_to_cpu(cardp->usb_event_cause) << 3;
......@@ -775,7 +776,6 @@ int libertas_sbi_prog_firmware(wlan_private * priv)
return -1;
}
#ifdef SUPPORT_BOOT_COMMAND
cardp->bootcmdresp = 0;
do {
int j = 0;
......@@ -796,7 +796,6 @@ int libertas_sbi_prog_firmware(wlan_private * priv)
}
return -1;
}
#endif
i = 0;
priv->adapter->fw_ready = 0;
......
......@@ -12,7 +12,6 @@
#define USB8388_VID_2 0x05a3
#define USB8388_PID_2 0x8388
#ifdef SUPPORT_BOOT_COMMAND
#define BOOT_CMD_FW_BY_USB 0x01
#define BOOT_CMD_FW_IN_EEPROM 0x02
#define BOOT_CMD_UPDATE_BOOT2 0x03
......@@ -36,7 +35,6 @@ struct bootcmdrespStr
u8 u8result;
u8 au8dumy[2];
};
#endif /* SUPPORT_BOOT_COMMAND */
/* read callback private data */
struct read_cb_info {
......
This diff is collapsed.
......@@ -15,6 +15,8 @@
#include "join.h"
#include "dev.h"
#define AD_HOC_CAP_PRIVACY_ON 1
/**
* @brief This function finds out the common rates between rate1 and rate2.
*
......@@ -85,7 +87,7 @@ int libertas_send_deauth(wlan_private * priv)
wlan_adapter *adapter = priv->adapter;
int ret = 0;
if (adapter->inframode == wlan802_11infrastructure &&
if (adapter->mode == IW_MODE_INFRA &&
adapter->connect_status == libertas_connected)
ret = libertas_send_deauthentication(priv);
else
......@@ -94,20 +96,6 @@ int libertas_send_deauth(wlan_private * priv)
return ret;
}
int libertas_do_adhocstop_ioctl(wlan_private * priv)
{
wlan_adapter *adapter = priv->adapter;
int ret = 0;
if (adapter->inframode == wlan802_11ibss &&
adapter->connect_status == libertas_connected)
ret = libertas_stop_adhoc_network(priv);
else
ret = -ENOTSUPP;
return ret;
}
/**
* @brief Associate to a specific BSS discovered in a scan
*
......@@ -207,8 +195,7 @@ int libertas_join_adhoc_network(wlan_private * priv, struct bss_descriptor * pbs
/* check if the requested SSID is already joined */
if (adapter->curbssparams.ssid.ssidlength
&& !libertas_SSID_cmp(&pbssdesc->ssid, &adapter->curbssparams.ssid)
&& (adapter->curbssparams.bssdescriptor.inframode ==
wlan802_11ibss)) {
&& (adapter->mode == IW_MODE_ADHOC)) {
lbs_pr_debug(1,
"ADHOC_J_CMD: New ad-hoc SSID is the same as current, "
......@@ -260,130 +247,6 @@ int libertas_send_deauthentication(wlan_private * priv)
0, cmd_option_waitforrsp, 0, NULL);
}
/**
* @brief Set Idle Off
*
* @param priv A pointer to wlan_private structure
* @return 0 --success, otherwise fail
*/
int libertas_idle_off(wlan_private * priv)
{
wlan_adapter *adapter = priv->adapter;
int ret = 0;
const u8 zeromac[] = { 0, 0, 0, 0, 0, 0 };
int i;
ENTER();
if (adapter->connect_status == libertas_disconnected) {
if (adapter->inframode == wlan802_11infrastructure) {
if (memcmp(adapter->previousbssid, zeromac,
sizeof(zeromac)) != 0) {
lbs_pr_debug(1, "Previous SSID = %s\n",
adapter->previousssid.ssid);
lbs_pr_debug(1, "Previous BSSID = "
"%02x:%02x:%02x:%02x:%02x:%02x:\n",
adapter->previousbssid[0],
adapter->previousbssid[1],
adapter->previousbssid[2],
adapter->previousbssid[3],
adapter->previousbssid[4],
adapter->previousbssid[5]);
i = libertas_find_SSID_in_list(adapter,
&adapter->previousssid,
adapter->previousbssid,
adapter->inframode);
if (i < 0) {
libertas_send_specific_BSSID_scan(priv,
adapter->
previousbssid,
1);
i = libertas_find_SSID_in_list(adapter,
&adapter->
previousssid,
adapter->
previousbssid,
adapter->
inframode);
}
if (i < 0) {
/* If the BSSID could not be found, try just the SSID */
i = libertas_find_SSID_in_list(adapter,
&adapter->
previousssid, NULL,
adapter->
inframode);
}
if (i < 0) {
libertas_send_specific_SSID_scan(priv,
&adapter->
previousssid,
1);
i = libertas_find_SSID_in_list(adapter,
&adapter->
previousssid, NULL,
adapter->
inframode);
}
if (i >= 0) {
ret =
wlan_associate(priv,
&adapter->
scantable[i]);
}
}
} else if (adapter->inframode == wlan802_11ibss) {
ret = libertas_prepare_and_send_command(priv,
cmd_802_11_ad_hoc_start,
0,
cmd_option_waitforrsp,
0, &adapter->previousssid);
}
}
/* else it is connected */
lbs_pr_debug(1, "\nwlanidle is off");
LEAVE();
return ret;
}
/**
* @brief Set Idle On
*
* @param priv A pointer to wlan_private structure
* @return 0 --success, otherwise fail
*/
int libertas_idle_on(wlan_private * priv)
{
wlan_adapter *adapter = priv->adapter;
int ret = 0;
if (adapter->connect_status == libertas_connected) {
if (adapter->inframode == wlan802_11infrastructure) {
lbs_pr_debug(1, "Previous SSID = %s\n",
adapter->previousssid.ssid);
memmove(&adapter->previousssid,
&adapter->curbssparams.ssid,
sizeof(struct WLAN_802_11_SSID));
libertas_send_deauth(priv);
} else if (adapter->inframode == wlan802_11ibss) {
ret = libertas_stop_adhoc_network(priv);
}
}
lbs_pr_debug(1, "\nwlanidle is on");
return ret;
}
/**
* @brief This function prepares command of authenticate.
*
......@@ -398,22 +261,39 @@ int libertas_cmd_80211_authenticate(wlan_private * priv,
void *pdata_buf)
{
wlan_adapter *adapter = priv->adapter;
struct cmd_ds_802_11_authenticate *pauthenticate =
&cmd->params.auth;
struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth;
int ret = -1;
u8 *bssid = pdata_buf;
cmd->command = cpu_to_le16(cmd_802_11_authenticate);
cmd->size =
cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate)
cmd->size = cpu_to_le16(sizeof(struct cmd_ds_802_11_authenticate)
+ S_DS_GEN);
pauthenticate->authtype = adapter->secinfo.authmode;
/* translate auth mode to 802.11 defined wire value */
switch (adapter->secinfo.auth_mode) {
case IW_AUTH_ALG_OPEN_SYSTEM:
pauthenticate->authtype = 0x00;
break;
case IW_AUTH_ALG_SHARED_KEY:
pauthenticate->authtype = 0x01;
break;
case IW_AUTH_ALG_LEAP:
pauthenticate->authtype = 0x80;
break;
default:
lbs_pr_debug(1, "AUTH_CMD: invalid auth alg 0x%X\n",
adapter->secinfo.auth_mode);
goto out;
}
memcpy(pauthenticate->macaddr, bssid, ETH_ALEN);
lbs_pr_debug(1, "AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n",
bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
ret = 0;
return 0;
out:
return ret;
}
int libertas_cmd_80211_deauthenticate(wlan_private * priv,
......@@ -550,7 +430,7 @@ int libertas_cmd_80211_associate(wlan_private * priv,
lbs_pr_debug(1, "ASSOC_CMD: rates->header.len = %d\n", rates->header.len);
/* set IBSS field */
if (pbssdesc->inframode == wlan802_11infrastructure) {
if (pbssdesc->mode == IW_MODE_INFRA) {
#define CAPINFO_ESS_MODE 1
passo->capinfo.ess = CAPINFO_ESS_MODE;
}
......@@ -624,7 +504,7 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
/* set the BSS type */
adhs->bsstype = cmd_bss_type_ibss;
pbssdesc->inframode = wlan802_11ibss;
pbssdesc->mode = IW_MODE_ADHOC;
adhs->beaconperiod = adapter->beaconperiod;
/* set Physical param set */
......@@ -666,15 +546,12 @@ int libertas_cmd_80211_ad_hoc_start(wlan_private * priv,
adhs->probedelay = cpu_to_le16(cmd_scan_probe_delay_time);
/* set up privacy in adapter->scantable[i] */
if (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) {
#define AD_HOC_CAP_PRIVACY_ON 1
lbs_pr_debug(1, "ADHOC_S_CMD: WEPstatus set, privacy to WEP\n");
if (adapter->secinfo.wep_enabled) {
lbs_pr_debug(1, "ADHOC_S_CMD: WEP enabled, setting privacy on\n");
pbssdesc->privacy = wlan802_11privfilter8021xWEP;
adhs->cap.privacy = AD_HOC_CAP_PRIVACY_ON;
} else {
lbs_pr_debug(1, "ADHOC_S_CMD: WEPstatus NOT set, Setting "
"privacy to ACCEPT ALL\n");
lbs_pr_debug(1, "ADHOC_S_CMD: WEP disabled, setting privacy off\n");
pbssdesc->privacy = wlan802_11privfilteracceptall;
}
......@@ -786,9 +663,6 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
padhocjoin->bssdescriptor.BSSID[5],
padhocjoin->bssdescriptor.SSID);
lbs_pr_debug(1, "ADHOC_J_CMD: Data Rate = %x\n",
(u32) padhocjoin->bssdescriptor.datarates);
/* failtimeout */
padhocjoin->failtimeout = cpu_to_le16(MRVDRV_ASSOCIATION_TIME_OUT);
......@@ -832,7 +706,7 @@ int libertas_cmd_80211_ad_hoc_join(wlan_private * priv,
padhocjoin->bssdescriptor.ssparamset.ibssparamset.atimwindow =
cpu_to_le16(pbssdesc->atimwindow);
if (adapter->secinfo.WEPstatus == wlan802_11WEPenabled) {
if (adapter->secinfo.wep_enabled) {
padhocjoin->bssdescriptor.cap.privacy = AD_HOC_CAP_PRIVACY_ON;
}
......
/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
/* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */
/**
* Interface for the wlan infrastructure and adhoc join routines
*
......@@ -40,10 +37,6 @@ extern int libertas_ret_80211_disassociate(wlan_private * priv,
extern int libertas_ret_80211_associate(wlan_private * priv,
struct cmd_ds_command *resp);
extern int libertas_idle_on(wlan_private * priv);
extern int libertas_idle_off(wlan_private * priv);
extern int libertas_do_adhocstop_ioctl(wlan_private * priv);
extern int libertas_reassociation_thread(void *data);
struct WLAN_802_11_SSID;
......
......@@ -21,6 +21,13 @@
#include "debugfs.h"
#include "assoc.h"
#define DRIVER_RELEASE_VERSION "320.p0"
const char libertas_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION
#ifdef DEBUG
"-dbg"
#endif
"";
#ifdef ENABLE_PM
static struct pm_dev *wlan_pm_dev = NULL;
#endif
......
......@@ -210,7 +210,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
goto done;
}
lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %d = %d\n",
lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n",
skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd));
lbs_dbg_hex("RX Data: Dest", p_rx_pkt->eth803_hdr.dest_addr,
......@@ -364,7 +364,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
priv->stats.rx_errors++;
}
lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %d = %d\n",
lbs_pr_debug(1, "RX Data: skb->len - sizeof(RxPd) = %d - %zd = %zd\n",
skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd));
/* create the exported radio header */
......
This diff is collapsed.
/* -*- mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
/* vi: set expandtab shiftwidth=4 tabstop=4 textwidth=78: */
/**
* Interface for the wlan network scan routines
*
......@@ -10,6 +7,7 @@
#ifndef _WLAN_SCAN_H
#define _WLAN_SCAN_H
#include <net/ieee80211.h>
#include "hostcmd.h"
/**
......@@ -155,7 +153,7 @@ struct bss_descriptor {
u32 atimwindow;
enum WLAN_802_11_NETWORK_INFRASTRUCTURE inframode;
u8 mode;
u8 libertas_supported_rates[WLAN_SUPPORTED_RATES];
int extra_ie;
......@@ -170,22 +168,22 @@ struct bss_descriptor {
struct ieeetypes_countryinfofullset countryinfo;
struct WPA_SUPPLICANT wpa_supplicant;
struct WPA_SUPPLICANT wpa2_supplicant;
u8 wpa_ie[MAX_WPA_IE_LEN];
size_t wpa_ie_len;
u8 rsn_ie[MAX_WPA_IE_LEN];
size_t rsn_ie_len;
};
extern int libertas_SSID_cmp(struct WLAN_802_11_SSID *ssid1,
struct WLAN_802_11_SSID *ssid2);
extern int libertas_find_SSID_in_list(wlan_adapter * adapter, struct WLAN_802_11_SSID *ssid,
u8 * bssid, int mode);
int libertas_find_best_SSID_in_list(wlan_adapter * adapter, enum WLAN_802_11_NETWORK_INFRASTRUCTURE mode);
extern int libertas_find_BSSID_in_list(wlan_adapter * adapter, u8 * bssid, int mode);
u8 * bssid, u8 mode);
int libertas_find_best_SSID_in_list(wlan_adapter * adapter, u8 mode);
extern int libertas_find_BSSID_in_list(wlan_adapter * adapter, u8 * bssid, u8 mode);
int libertas_find_best_network_SSID(wlan_private * priv,
struct WLAN_802_11_SSID *pSSID,
enum WLAN_802_11_NETWORK_INFRASTRUCTURE preferred_mode,
enum WLAN_802_11_NETWORK_INFRASTRUCTURE *out_mode);
u8 preferred_mode, u8 *out_mode);
extern int libertas_send_specific_SSID_scan(wlan_private * priv,
struct WLAN_802_11_SSID *prequestedssid,
......
......@@ -78,7 +78,7 @@ static int SendSinglePacket(wlan_private * priv, struct sk_buff *skb)
min_t(unsigned int, skb->len, 100));
if (!skb->len || (skb->len > MRVDRV_ETH_TX_PACKET_BUFFER_SIZE)) {
lbs_pr_debug(1, "Tx error: Bad skb length %d : %d\n",
lbs_pr_debug(1, "Tx error: Bad skb length %d : %zd\n",
skb->len, MRVDRV_ETH_TX_PACKET_BUFFER_SIZE);
ret = -1;
goto done;
......
#define DRIVER_RELEASE_VERSION "320.p0"
const char libertas_driver_version[] = "COMM-USB8388-" DRIVER_RELEASE_VERSION
#ifdef DEBUG
"-dbg"
#endif
"";
This diff is collapsed.
......@@ -10,88 +10,22 @@
/** PRIVATE CMD ID */
#define WLANIOCTL SIOCIWFIRSTPRIV
#define WLANSETWPAIE (WLANIOCTL + 0)
#define WLAN_SETINT_GETINT (WLANIOCTL + 7)
#define WLANNF 1
#define WLANRSSI 2
#define WLANENABLE11D 5
#define WLANADHOCGRATE 6
#define WLAN_SUBCMD_SET_PRESCAN 11
#define WLAN_SETNONE_GETNONE (WLANIOCTL + 8)
#define WLANDEAUTH 1
#define WLANRADIOON 2
#define WLANRADIOOFF 3
#define WLANREMOVEADHOCAES 4
#define WLANADHOCSTOP 5
#define WLANCIPHERTEST 6
#define WLANCRYPTOTEST 7
#define WLANWLANIDLEON 10
#define WLANWLANIDLEOFF 11
#define WLAN_SUBCMD_BT_RESET 13
#define WLAN_SUBCMD_FWT_RESET 14
#define WLANGETLOG (WLANIOCTL + 9)
#define GETLOG_BUFSIZE 300
#define WLANSCAN_TYPE (WLANIOCTL + 11)
#define WLAN_SETNONE_GETONEINT (WLANIOCTL + 15)
#define WLANGETREGION 1
#define WLAN_GET_LISTEN_INTERVAL 2
#define WLAN_GET_MULTIPLE_DTIM 3
#define WLAN_GET_TX_RATE 4
#define WLANGETBCNAVG 5
#define WLAN_GET_LINKMODE 6
#define WLAN_GET_RADIOMODE 7
#define WLAN_GET_DEBUGMODE 8
#define WLAN_SUBCMD_FWT_CLEANUP 15
#define WLAN_SUBCMD_FWT_TIME 16
#define WLAN_SUBCMD_MESH_GET_TTL 17
#define WLANREGCFRDWR (WLANIOCTL + 18)
#define WLAN_SETNONE_GETTWELVE_CHAR (WLANIOCTL + 19)
#define WLAN_SUBCMD_GETRXANTENNA 1
#define WLAN_SUBCMD_GETTXANTENNA 2
#define WLAN_GET_TSF 3
#define WLAN_SETNONE_GETWORDCHAR (WLANIOCTL + 21)
#define WLANGETADHOCAES 1
#define WLAN_SETONEINT_GETONEINT (WLANIOCTL + 23)
#define WLAN_BEACON_INTERVAL 1
#define WLAN_LISTENINTRVL 4
#define WLAN_TXCONTROL 6
#define WLAN_NULLPKTINTERVAL 7
#define WLAN_SETONEINT_GETNONE (WLANIOCTL + 24)
#define WLAN_SUBCMD_SETRXANTENNA 1
#define WLAN_SUBCMD_SETTXANTENNA 2
#define WLANSETAUTHALG 5
#define WLANSET8021XAUTHALG 6
#define WLANSETENCRYPTIONMODE 7
#define WLANSETREGION 8
#define WLAN_SET_LISTEN_INTERVAL 9
#define WLAN_SET_MULTIPLE_DTIM 10
#define WLAN_SET_ATIM_WINDOW 11
#define WLANSETBCNAVG 13
#define WLANSETDATAAVG 14
#define WLAN_SET_LINKMODE 15
#define WLAN_SET_RADIOMODE 16
#define WLAN_SET_DEBUGMODE 17
#define WLAN_SUBCMD_MESH_SET_TTL 18
#define WLAN_SET128CHAR_GET128CHAR (WLANIOCTL + 25)
#define WLANSCAN_MODE 6
#define WLAN_GET_ADHOC_STATUS 9
#define WLAN_SUBCMD_BT_ADD 18
#define WLAN_SUBCMD_BT_DEL 19
#define WLAN_SUBCMD_BT_LIST 20
......@@ -103,27 +37,8 @@
#define WLAN_SUBCMD_FWT_LIST_ROUTE 26
#define WLAN_SET_GET_SIXTEEN_INT (WLANIOCTL + 29)
#define WLAN_TPCCFG 1
#define WLAN_POWERCFG 2
#define WLAN_AUTO_FREQ_SET 3
#define WLAN_AUTO_FREQ_GET 4
#define WLAN_LED_GPIO_CTRL 5
#define WLAN_SCANPROBES 6
#define WLAN_ADAPT_RATESET 8
#define WLAN_INACTIVITY_TIMEOUT 9
#define WLANSNR 10
#define WLAN_GET_RATE 11
#define WLAN_GET_RXINFO 12
#define WLANCMD52RDWR (WLANIOCTL + 30)
#define WLANCMD53RDWR (WLANIOCTL + 31)
#define CMD53BUFLEN 32
#define REG_MAC 0x19
#define REG_BBP 0x1a
#define REG_RF 0x1b
#define REG_EEPROM 0x59
#define WLAN_LINKMODE_802_3 0
#define WLAN_LINKMODE_802_11 2
#define WLAN_RADIOMODE_NONE 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment