aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:04:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:04:44 -0400
commitf8965467f366fd18f01feafb5db10512d7b4422c (patch)
tree3706a9cd779859271ca61b85c63a1bc3f82d626e /drivers/net/wireless/libertas
parenta26272e5200765691e67d6780e52b32498fdb659 (diff)
parent2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits) qlcnic: adding co maintainer ixgbe: add support for active DA cables ixgbe: dcb, do not tag tc_prio_control frames ixgbe: fix ixgbe_tx_is_paused logic ixgbe: always enable vlan strip/insert when DCB is enabled ixgbe: remove some redundant code in setting FCoE FIP filter ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp ixgbe: fix header len when unsplit packet overflows to data buffer ipv6: Never schedule DAD timer on dead address ipv6: Use POSTDAD state ipv6: Use state_lock to protect ifa state ipv6: Replace inet6_ifaddr->dead with state cxgb4: notify upper drivers if the device is already up when they load cxgb4: keep interrupts available when the ports are brought down cxgb4: fix initial addition of MAC address cnic: Return SPQ credit to bnx2x after ring setup and shutdown. cnic: Convert cnic_local_flags to atomic ops. can: Fix SJA1000 command register writes on SMP systems bridge: fix build for CONFIG_SYSFS disabled ARCNET: Limit com20020 PCI ID matches for SOHARD cards ... Fix up various conflicts with pcmcia tree drivers/net/ {pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and wireless/orinoco/spectrum_cs.c} and feature removal (Documentation/feature-removal-schedule.txt). Also fix a non-content conflict due to pm_qos_requirement getting renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/assoc.c22
-rw-r--r--drivers/net/wireless/libertas/cfg.c1
-rw-r--r--drivers/net/wireless/libertas/debugfs.c5
-rw-r--r--drivers/net/wireless/libertas/dev.h1
-rw-r--r--drivers/net/wireless/libertas/if_sdio.c127
-rw-r--r--drivers/net/wireless/libertas/if_usb.c4
-rw-r--r--drivers/net/wireless/libertas/main.c15
-rw-r--r--drivers/net/wireless/libertas/rx.c51
-rw-r--r--drivers/net/wireless/libertas/tx.c2
-rw-r--r--drivers/net/wireless/libertas/wext.c4
10 files changed, 125 insertions, 107 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 12a2ef9dacea..aa06070e5eab 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -32,6 +32,9 @@ u8 lbs_bg_rates[MAX_RATES] =
320x00, 0x00 }; 320x00, 0x00 };
33 33
34 34
35static int assoc_helper_wep_keys(struct lbs_private *priv,
36 struct assoc_request *assoc_req);
37
35/** 38/**
36 * @brief This function finds common rates between rates and card rates. 39 * @brief This function finds common rates between rates and card rates.
37 * 40 *
@@ -611,7 +614,7 @@ static int lbs_assoc_post(struct lbs_private *priv,
611 614
612 if (status_code) { 615 if (status_code) {
613 lbs_mac_event_disconnected(priv); 616 lbs_mac_event_disconnected(priv);
614 ret = -1; 617 ret = status_code;
615 goto done; 618 goto done;
616 } 619 }
617 620
@@ -814,7 +817,24 @@ static int lbs_try_associate(struct lbs_private *priv,
814 goto out; 817 goto out;
815 818
816 ret = lbs_associate(priv, assoc_req, CMD_802_11_ASSOCIATE); 819 ret = lbs_associate(priv, assoc_req, CMD_802_11_ASSOCIATE);
820 /* If the association fails with current auth mode, let's
821 * try by changing the auth mode
822 */
823 if ((priv->authtype_auto) &&
824 (ret == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) &&
825 (assoc_req->secinfo.wep_enabled) &&
826 (priv->connect_status != LBS_CONNECTED)) {
827 if (priv->secinfo.auth_mode == IW_AUTH_ALG_OPEN_SYSTEM)
828 priv->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
829 else
830 priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
831 if (!assoc_helper_wep_keys(priv, assoc_req))
832 ret = lbs_associate(priv, assoc_req,
833 CMD_802_11_ASSOCIATE);
834 }
817 835
836 if (ret)
837 ret = -1;
818out: 838out:
819 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret); 839 lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
820 return ret; 840 return ret;
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index ce7bec402a33..9d5d3ccf08c8 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -79,6 +79,7 @@ static const u32 cipher_suites[] = {
79 79
80 80
81static int lbs_cfg_set_channel(struct wiphy *wiphy, 81static int lbs_cfg_set_channel(struct wiphy *wiphy,
82 struct net_device *netdev,
82 struct ieee80211_channel *chan, 83 struct ieee80211_channel *chan,
83 enum nl80211_channel_type channel_type) 84 enum nl80211_channel_type channel_type)
84{ 85{
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index a48ccaffb288..de2caac11dd6 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -75,7 +75,7 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
75 return -ENOMEM; 75 return -ENOMEM;
76 76
77 pos += snprintf(buf+pos, len-pos, 77 pos += snprintf(buf+pos, len-pos,
78 "# | ch | rssi | bssid | cap | Qual | SSID \n"); 78 "# | ch | rssi | bssid | cap | Qual | SSID\n");
79 79
80 mutex_lock(&priv->lock); 80 mutex_lock(&priv->lock);
81 list_for_each_entry (iter_bss, &priv->network_list, list) { 81 list_for_each_entry (iter_bss, &priv->network_list, list) {
@@ -757,15 +757,12 @@ void lbs_debugfs_init(void)
757{ 757{
758 if (!lbs_dir) 758 if (!lbs_dir)
759 lbs_dir = debugfs_create_dir("lbs_wireless", NULL); 759 lbs_dir = debugfs_create_dir("lbs_wireless", NULL);
760
761 return;
762} 760}
763 761
764void lbs_debugfs_remove(void) 762void lbs_debugfs_remove(void)
765{ 763{
766 if (lbs_dir) 764 if (lbs_dir)
767 debugfs_remove(lbs_dir); 765 debugfs_remove(lbs_dir);
768 return;
769} 766}
770 767
771void lbs_debugfs_init_one(struct lbs_private *priv, struct net_device *dev) 768void lbs_debugfs_init_one(struct lbs_private *priv, struct net_device *dev)
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index 6875e1498bd5..a54880e4ad2b 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -134,6 +134,7 @@ struct lbs_private {
134 u8 wpa_ie_len; 134 u8 wpa_ie_len;
135 u16 wep_tx_keyidx; 135 u16 wep_tx_keyidx;
136 struct enc_key wep_keys[4]; 136 struct enc_key wep_keys[4];
137 u8 authtype_auto;
137 138
138 /* Wake On LAN */ 139 /* Wake On LAN */
139 uint32_t wol_criteria; 140 uint32_t wol_criteria;
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 7d1a3c6b6ce0..64dd345d30f5 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -35,6 +35,8 @@
35#include <linux/mmc/card.h> 35#include <linux/mmc/card.h>
36#include <linux/mmc/sdio_func.h> 36#include <linux/mmc/sdio_func.h>
37#include <linux/mmc/sdio_ids.h> 37#include <linux/mmc/sdio_ids.h>
38#include <linux/mmc/sdio.h>
39#include <linux/mmc/host.h>
38 40
39#include "host.h" 41#include "host.h"
40#include "decl.h" 42#include "decl.h"
@@ -313,12 +315,30 @@ out:
313 return ret; 315 return ret;
314} 316}
315 317
318static int if_sdio_wait_status(struct if_sdio_card *card, const u8 condition)
319{
320 u8 status;
321 unsigned long timeout;
322 int ret = 0;
323
324 timeout = jiffies + HZ;
325 while (1) {
326 status = sdio_readb(card->func, IF_SDIO_STATUS, &ret);
327 if (ret)
328 return ret;
329 if ((status & condition) == condition)
330 break;
331 if (time_after(jiffies, timeout))
332 return -ETIMEDOUT;
333 mdelay(1);
334 }
335 return ret;
336}
337
316static int if_sdio_card_to_host(struct if_sdio_card *card) 338static int if_sdio_card_to_host(struct if_sdio_card *card)
317{ 339{
318 int ret; 340 int ret;
319 u8 status;
320 u16 size, type, chunk; 341 u16 size, type, chunk;
321 unsigned long timeout;
322 342
323 lbs_deb_enter(LBS_DEB_SDIO); 343 lbs_deb_enter(LBS_DEB_SDIO);
324 344
@@ -333,19 +353,9 @@ static int if_sdio_card_to_host(struct if_sdio_card *card)
333 goto out; 353 goto out;
334 } 354 }
335 355
336 timeout = jiffies + HZ; 356 ret = if_sdio_wait_status(card, IF_SDIO_IO_RDY);
337 while (1) { 357 if (ret)
338 status = sdio_readb(card->func, IF_SDIO_STATUS, &ret); 358 goto out;
339 if (ret)
340 goto out;
341 if (status & IF_SDIO_IO_RDY)
342 break;
343 if (time_after(jiffies, timeout)) {
344 ret = -ETIMEDOUT;
345 goto out;
346 }
347 mdelay(1);
348 }
349 359
350 /* 360 /*
351 * The transfer must be in one transaction or the firmware 361 * The transfer must be in one transaction or the firmware
@@ -412,8 +422,6 @@ static void if_sdio_host_to_card_worker(struct work_struct *work)
412{ 422{
413 struct if_sdio_card *card; 423 struct if_sdio_card *card;
414 struct if_sdio_packet *packet; 424 struct if_sdio_packet *packet;
415 unsigned long timeout;
416 u8 status;
417 int ret; 425 int ret;
418 unsigned long flags; 426 unsigned long flags;
419 427
@@ -433,25 +441,15 @@ static void if_sdio_host_to_card_worker(struct work_struct *work)
433 441
434 sdio_claim_host(card->func); 442 sdio_claim_host(card->func);
435 443
436 timeout = jiffies + HZ; 444 ret = if_sdio_wait_status(card, IF_SDIO_IO_RDY);
437 while (1) { 445 if (ret == 0) {
438 status = sdio_readb(card->func, IF_SDIO_STATUS, &ret); 446 ret = sdio_writesb(card->func, card->ioport,
439 if (ret) 447 packet->buffer, packet->nb);
440 goto release;
441 if (status & IF_SDIO_IO_RDY)
442 break;
443 if (time_after(jiffies, timeout)) {
444 ret = -ETIMEDOUT;
445 goto release;
446 }
447 mdelay(1);
448 } 448 }
449 449
450 ret = sdio_writesb(card->func, card->ioport,
451 packet->buffer, packet->nb);
452 if (ret) 450 if (ret)
453 goto release; 451 lbs_pr_err("error %d sending packet to firmware\n", ret);
454release: 452
455 sdio_release_host(card->func); 453 sdio_release_host(card->func);
456 454
457 kfree(packet); 455 kfree(packet);
@@ -464,10 +462,11 @@ release:
464/* Firmware */ 462/* Firmware */
465/********************************************************************/ 463/********************************************************************/
466 464
465#define FW_DL_READY_STATUS (IF_SDIO_IO_RDY | IF_SDIO_DL_RDY)
466
467static int if_sdio_prog_helper(struct if_sdio_card *card) 467static int if_sdio_prog_helper(struct if_sdio_card *card)
468{ 468{
469 int ret; 469 int ret;
470 u8 status;
471 const struct firmware *fw; 470 const struct firmware *fw;
472 unsigned long timeout; 471 unsigned long timeout;
473 u8 *chunk_buffer; 472 u8 *chunk_buffer;
@@ -499,20 +498,14 @@ static int if_sdio_prog_helper(struct if_sdio_card *card)
499 size = fw->size; 498 size = fw->size;
500 499
501 while (size) { 500 while (size) {
502 timeout = jiffies + HZ; 501 ret = if_sdio_wait_status(card, FW_DL_READY_STATUS);
503 while (1) { 502 if (ret)
504 status = sdio_readb(card->func, IF_SDIO_STATUS, &ret); 503 goto release;
505 if (ret) 504
506 goto release; 505 /* On some platforms (like Davinci) the chip needs more time
507 if ((status & IF_SDIO_IO_RDY) && 506 * between helper blocks.
508 (status & IF_SDIO_DL_RDY)) 507 */
509 break; 508 mdelay(2);
510 if (time_after(jiffies, timeout)) {
511 ret = -ETIMEDOUT;
512 goto release;
513 }
514 mdelay(1);
515 }
516 509
517 chunk_size = min(size, (size_t)60); 510 chunk_size = min(size, (size_t)60);
518 511
@@ -582,7 +575,6 @@ out:
582static int if_sdio_prog_real(struct if_sdio_card *card) 575static int if_sdio_prog_real(struct if_sdio_card *card)
583{ 576{
584 int ret; 577 int ret;
585 u8 status;
586 const struct firmware *fw; 578 const struct firmware *fw;
587 unsigned long timeout; 579 unsigned long timeout;
588 u8 *chunk_buffer; 580 u8 *chunk_buffer;
@@ -614,20 +606,9 @@ static int if_sdio_prog_real(struct if_sdio_card *card)
614 size = fw->size; 606 size = fw->size;
615 607
616 while (size) { 608 while (size) {
617 timeout = jiffies + HZ; 609 ret = if_sdio_wait_status(card, FW_DL_READY_STATUS);
618 while (1) { 610 if (ret)
619 status = sdio_readb(card->func, IF_SDIO_STATUS, &ret); 611 goto release;
620 if (ret)
621 goto release;
622 if ((status & IF_SDIO_IO_RDY) &&
623 (status & IF_SDIO_DL_RDY))
624 break;
625 if (time_after(jiffies, timeout)) {
626 ret = -ETIMEDOUT;
627 goto release;
628 }
629 mdelay(1);
630 }
631 612
632 req_size = sdio_readb(card->func, IF_SDIO_RD_BASE, &ret); 613 req_size = sdio_readb(card->func, IF_SDIO_RD_BASE, &ret);
633 if (ret) 614 if (ret)
@@ -943,6 +924,7 @@ static int if_sdio_probe(struct sdio_func *func,
943 int ret, i; 924 int ret, i;
944 unsigned int model; 925 unsigned int model;
945 struct if_sdio_packet *packet; 926 struct if_sdio_packet *packet;
927 struct mmc_host *host = func->card->host;
946 928
947 lbs_deb_enter(LBS_DEB_SDIO); 929 lbs_deb_enter(LBS_DEB_SDIO);
948 930
@@ -1023,6 +1005,25 @@ static int if_sdio_probe(struct sdio_func *func,
1023 if (ret) 1005 if (ret)
1024 goto disable; 1006 goto disable;
1025 1007
1008 /* For 1-bit transfers to the 8686 model, we need to enable the
1009 * interrupt flag in the CCCR register. Set the MMC_QUIRK_LENIENT_FN0
1010 * bit to allow access to non-vendor registers. */
1011 if ((card->model == IF_SDIO_MODEL_8686) &&
1012 (host->caps & MMC_CAP_SDIO_IRQ) &&
1013 (host->ios.bus_width == MMC_BUS_WIDTH_1)) {
1014 u8 reg;
1015
1016 func->card->quirks |= MMC_QUIRK_LENIENT_FN0;
1017 reg = sdio_f0_readb(func, SDIO_CCCR_IF, &ret);
1018 if (ret)
1019 goto release_int;
1020
1021 reg |= SDIO_BUS_ECSI;
1022 sdio_f0_writeb(func, reg, SDIO_CCCR_IF, &ret);
1023 if (ret)
1024 goto release_int;
1025 }
1026
1026 card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret); 1027 card->ioport = sdio_readb(func, IF_SDIO_IOPORT, &ret);
1027 if (ret) 1028 if (ret)
1028 goto release_int; 1029 goto release_int;
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index fcea5741ba62..f41594c7ac16 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -133,8 +133,6 @@ static void if_usb_write_bulk_callback(struct urb *urb)
133 /* print the failure status number for debug */ 133 /* print the failure status number for debug */
134 lbs_pr_info("URB in failure status: %d\n", urb->status); 134 lbs_pr_info("URB in failure status: %d\n", urb->status);
135 } 135 }
136
137 return;
138} 136}
139 137
140/** 138/**
@@ -651,8 +649,6 @@ static void if_usb_receive_fwload(struct urb *urb)
651 if_usb_submit_rx_urb_fwload(cardp); 649 if_usb_submit_rx_urb_fwload(cardp);
652 650
653 kfree(syncfwheader); 651 kfree(syncfwheader);
654
655 return;
656} 652}
657 653
658#define MRVDRV_MIN_PKT_LEN 30 654#define MRVDRV_MIN_PKT_LEN 30
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 598080414b17..d9b8ee130c45 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -229,7 +229,7 @@ static void lbs_tx_timeout(struct net_device *dev)
229 229
230 lbs_pr_err("tx watch dog timeout\n"); 230 lbs_pr_err("tx watch dog timeout\n");
231 231
232 dev->trans_start = jiffies; 232 dev->trans_start = jiffies; /* prevent tx timeout */
233 233
234 if (priv->currenttxskb) 234 if (priv->currenttxskb)
235 lbs_send_tx_feedback(priv, 0); 235 lbs_send_tx_feedback(priv, 0);
@@ -319,7 +319,7 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
319 struct net_device *dev, int nr_addrs) 319 struct net_device *dev, int nr_addrs)
320{ 320{
321 int i = nr_addrs; 321 int i = nr_addrs;
322 struct dev_mc_list *mc_list; 322 struct netdev_hw_addr *ha;
323 int cnt; 323 int cnt;
324 324
325 if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST)) 325 if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST))
@@ -327,19 +327,19 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
327 327
328 netif_addr_lock_bh(dev); 328 netif_addr_lock_bh(dev);
329 cnt = netdev_mc_count(dev); 329 cnt = netdev_mc_count(dev);
330 netdev_for_each_mc_addr(mc_list, dev) { 330 netdev_for_each_mc_addr(ha, dev) {
331 if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) { 331 if (mac_in_list(cmd->maclist, nr_addrs, ha->addr)) {
332 lbs_deb_net("mcast address %s:%pM skipped\n", dev->name, 332 lbs_deb_net("mcast address %s:%pM skipped\n", dev->name,
333 mc_list->dmi_addr); 333 ha->addr);
334 cnt--; 334 cnt--;
335 continue; 335 continue;
336 } 336 }
337 337
338 if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE) 338 if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE)
339 break; 339 break;
340 memcpy(&cmd->maclist[6*i], mc_list->dmi_addr, ETH_ALEN); 340 memcpy(&cmd->maclist[6*i], ha->addr, ETH_ALEN);
341 lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name, 341 lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name,
342 mc_list->dmi_addr); 342 ha->addr);
343 i++; 343 i++;
344 cnt--; 344 cnt--;
345 } 345 }
@@ -836,6 +836,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
836 priv->is_auto_deep_sleep_enabled = 0; 836 priv->is_auto_deep_sleep_enabled = 0;
837 priv->wakeup_dev_required = 0; 837 priv->wakeup_dev_required = 0;
838 init_waitqueue_head(&priv->ds_awake_q); 838 init_waitqueue_head(&priv->ds_awake_q);
839 priv->authtype_auto = 1;
839 840
840 mutex_init(&priv->lock); 841 mutex_init(&priv->lock);
841 842
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index 784dae714705..a115bfa9513a 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -39,10 +39,10 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
39 struct sk_buff *skb); 39 struct sk_buff *skb);
40 40
41/** 41/**
42 * @brief This function computes the avgSNR . 42 * @brief This function computes the avgSNR .
43 * 43 *
44 * @param priv A pointer to struct lbs_private structure 44 * @param priv A pointer to struct lbs_private structure
45 * @return avgSNR 45 * @return avgSNR
46 */ 46 */
47static u8 lbs_getavgsnr(struct lbs_private *priv) 47static u8 lbs_getavgsnr(struct lbs_private *priv)
48{ 48{
@@ -57,10 +57,10 @@ static u8 lbs_getavgsnr(struct lbs_private *priv)
57} 57}
58 58
59/** 59/**
60 * @brief This function computes the AvgNF 60 * @brief This function computes the AvgNF
61 * 61 *
62 * @param priv A pointer to struct lbs_private structure 62 * @param priv A pointer to struct lbs_private structure
63 * @return AvgNF 63 * @return AvgNF
64 */ 64 */
65static u8 lbs_getavgnf(struct lbs_private *priv) 65static u8 lbs_getavgnf(struct lbs_private *priv)
66{ 66{
@@ -75,11 +75,11 @@ static u8 lbs_getavgnf(struct lbs_private *priv)
75} 75}
76 76
77/** 77/**
78 * @brief This function save the raw SNR/NF to our internel buffer 78 * @brief This function save the raw SNR/NF to our internel buffer
79 * 79 *
80 * @param priv A pointer to struct lbs_private structure 80 * @param priv A pointer to struct lbs_private structure
81 * @param prxpd A pointer to rxpd structure of received packet 81 * @param prxpd A pointer to rxpd structure of received packet
82 * @return n/a 82 * @return n/a
83 */ 83 */
84static void lbs_save_rawSNRNF(struct lbs_private *priv, struct rxpd *p_rx_pd) 84static void lbs_save_rawSNRNF(struct lbs_private *priv, struct rxpd *p_rx_pd)
85{ 85{
@@ -90,15 +90,14 @@ static void lbs_save_rawSNRNF(struct lbs_private *priv, struct rxpd *p_rx_pd)
90 priv->nextSNRNF++; 90 priv->nextSNRNF++;
91 if (priv->nextSNRNF >= DEFAULT_DATA_AVG_FACTOR) 91 if (priv->nextSNRNF >= DEFAULT_DATA_AVG_FACTOR)
92 priv->nextSNRNF = 0; 92 priv->nextSNRNF = 0;
93 return;
94} 93}
95 94
96/** 95/**
97 * @brief This function computes the RSSI in received packet. 96 * @brief This function computes the RSSI in received packet.
98 * 97 *
99 * @param priv A pointer to struct lbs_private structure 98 * @param priv A pointer to struct lbs_private structure
100 * @param prxpd A pointer to rxpd structure of received packet 99 * @param prxpd A pointer to rxpd structure of received packet
101 * @return n/a 100 * @return n/a
102 */ 101 */
103static void lbs_compute_rssi(struct lbs_private *priv, struct rxpd *p_rx_pd) 102static void lbs_compute_rssi(struct lbs_private *priv, struct rxpd *p_rx_pd)
104{ 103{
@@ -135,9 +134,9 @@ static void lbs_compute_rssi(struct lbs_private *priv, struct rxpd *p_rx_pd)
135 * @brief This function processes received packet and forwards it 134 * @brief This function processes received packet and forwards it
136 * to kernel/upper layer 135 * to kernel/upper layer
137 * 136 *
138 * @param priv A pointer to struct lbs_private 137 * @param priv A pointer to struct lbs_private
139 * @param skb A pointer to skb which includes the received packet 138 * @param skb A pointer to skb which includes the received packet
140 * @return 0 or -1 139 * @return 0 or -1
141 */ 140 */
142int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) 141int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
143{ 142{
@@ -197,7 +196,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
197 * before the snap_type. 196 * before the snap_type.
198 */ 197 */
199 p_ethhdr = (struct ethhdr *) 198 p_ethhdr = (struct ethhdr *)
200 ((u8 *) & p_rx_pkt->eth803_hdr 199 ((u8 *) &p_rx_pkt->eth803_hdr
201 + sizeof(p_rx_pkt->eth803_hdr) + sizeof(p_rx_pkt->rfc1042_hdr) 200 + sizeof(p_rx_pkt->eth803_hdr) + sizeof(p_rx_pkt->rfc1042_hdr)
202 - sizeof(p_rx_pkt->eth803_hdr.dest_addr) 201 - sizeof(p_rx_pkt->eth803_hdr.dest_addr)
203 - sizeof(p_rx_pkt->eth803_hdr.src_addr) 202 - sizeof(p_rx_pkt->eth803_hdr.src_addr)
@@ -214,7 +213,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
214 hdrchop = (u8 *)p_ethhdr - (u8 *)p_rx_pd; 213 hdrchop = (u8 *)p_ethhdr - (u8 *)p_rx_pd;
215 } else { 214 } else {
216 lbs_deb_hex(LBS_DEB_RX, "RX Data: LLC/SNAP", 215 lbs_deb_hex(LBS_DEB_RX, "RX Data: LLC/SNAP",
217 (u8 *) & p_rx_pkt->rfc1042_hdr, 216 (u8 *) &p_rx_pkt->rfc1042_hdr,
218 sizeof(p_rx_pkt->rfc1042_hdr)); 217 sizeof(p_rx_pkt->rfc1042_hdr));
219 218
220 /* Chop off the rxpd */ 219 /* Chop off the rxpd */
@@ -255,8 +254,8 @@ EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
255 * @brief This function converts Tx/Rx rates from the Marvell WLAN format 254 * @brief This function converts Tx/Rx rates from the Marvell WLAN format
256 * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s) 255 * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s)
257 * 256 *
258 * @param rate Input rate 257 * @param rate Input rate
259 * @return Output Rate (0 if invalid) 258 * @return Output Rate (0 if invalid)
260 */ 259 */
261static u8 convert_mv_rate_to_radiotap(u8 rate) 260static u8 convert_mv_rate_to_radiotap(u8 rate)
262{ 261{
@@ -295,9 +294,9 @@ static u8 convert_mv_rate_to_radiotap(u8 rate)
295 * @brief This function processes a received 802.11 packet and forwards it 294 * @brief This function processes a received 802.11 packet and forwards it
296 * to kernel/upper layer 295 * to kernel/upper layer
297 * 296 *
298 * @param priv A pointer to struct lbs_private 297 * @param priv A pointer to struct lbs_private
299 * @param skb A pointer to skb which includes the received packet 298 * @param skb A pointer to skb which includes the received packet
300 * @return 0 or -1 299 * @return 0 or -1
301 */ 300 */
302static int process_rxed_802_11_packet(struct lbs_private *priv, 301static int process_rxed_802_11_packet(struct lbs_private *priv,
303 struct sk_buff *skb) 302 struct sk_buff *skb)
@@ -314,7 +313,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
314 p_rx_pkt = (struct rx80211packethdr *) skb->data; 313 p_rx_pkt = (struct rx80211packethdr *) skb->data;
315 prxpd = &p_rx_pkt->rx_pd; 314 prxpd = &p_rx_pkt->rx_pd;
316 315
317 // lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); 316 /* lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); */
318 317
319 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { 318 if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) {
320 lbs_deb_rx("rx err: frame received with bad length\n"); 319 lbs_deb_rx("rx err: frame received with bad length\n");
diff --git a/drivers/net/wireless/libertas/tx.c b/drivers/net/wireless/libertas/tx.c
index 52d244ea3d97..a9bf658659eb 100644
--- a/drivers/net/wireless/libertas/tx.c
+++ b/drivers/net/wireless/libertas/tx.c
@@ -147,8 +147,6 @@ netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
147 dev->stats.tx_packets++; 147 dev->stats.tx_packets++;
148 dev->stats.tx_bytes += skb->len; 148 dev->stats.tx_bytes += skb->len;
149 149
150 dev->trans_start = jiffies;
151
152 if (priv->monitormode) { 150 if (priv->monitormode) {
153 /* Keep the skb to echo it back once Tx feedback is 151 /* Keep the skb to echo it back once Tx feedback is
154 received from FW */ 152 received from FW */
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 9b555884b08a..f96a96031a50 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -1441,8 +1441,10 @@ static int lbs_set_encode(struct net_device *dev,
1441 set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags); 1441 set_bit(ASSOC_FLAG_WEP_TX_KEYIDX, &assoc_req->flags);
1442 1442
1443 if (dwrq->flags & IW_ENCODE_RESTRICTED) { 1443 if (dwrq->flags & IW_ENCODE_RESTRICTED) {
1444 priv->authtype_auto = 0;
1444 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY; 1445 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
1445 } else if (dwrq->flags & IW_ENCODE_OPEN) { 1446 } else if (dwrq->flags & IW_ENCODE_OPEN) {
1447 priv->authtype_auto = 0;
1446 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; 1448 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
1447 } 1449 }
1448 1450
@@ -1621,8 +1623,10 @@ static int lbs_set_encodeext(struct net_device *dev,
1621 goto out; 1623 goto out;
1622 1624
1623 if (dwrq->flags & IW_ENCODE_RESTRICTED) { 1625 if (dwrq->flags & IW_ENCODE_RESTRICTED) {
1626 priv->authtype_auto = 0;
1624 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY; 1627 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_SHARED_KEY;
1625 } else if (dwrq->flags & IW_ENCODE_OPEN) { 1628 } else if (dwrq->flags & IW_ENCODE_OPEN) {
1629 priv->authtype_auto = 0;
1626 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; 1630 assoc_req->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
1627 } 1631 }
1628 1632