aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-03-25 20:20:03 -0400
committerDavid S. Miller <davem@davemloft.net>2008-03-25 20:20:03 -0400
commitf89e6e3834035c6e8203042f3527931aa7f52496 (patch)
treea82677254fe4511679d5690606ac75f4300fefe1 /drivers/net/wireless/libertas/main.c
parent7cbca67c073263c179f605bdbbdc565ab29d801d (diff)
parent3a643d244f09fa1fdd25d48a56a073c1a69583ee (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.26
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 2e5bac826c48..1eb0cb0a82b7 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -581,45 +581,45 @@ static int lbs_copy_multicast_address(struct lbs_private *priv,
581static void lbs_set_multicast_list(struct net_device *dev) 581static void lbs_set_multicast_list(struct net_device *dev)
582{ 582{
583 struct lbs_private *priv = dev->priv; 583 struct lbs_private *priv = dev->priv;
584 int oldpacketfilter; 584 int old_mac_control;
585 DECLARE_MAC_BUF(mac); 585 DECLARE_MAC_BUF(mac);
586 586
587 lbs_deb_enter(LBS_DEB_NET); 587 lbs_deb_enter(LBS_DEB_NET);
588 588
589 oldpacketfilter = priv->currentpacketfilter; 589 old_mac_control = priv->mac_control;
590 590
591 if (dev->flags & IFF_PROMISC) { 591 if (dev->flags & IFF_PROMISC) {
592 lbs_deb_net("enable promiscuous mode\n"); 592 lbs_deb_net("enable promiscuous mode\n");
593 priv->currentpacketfilter |= 593 priv->mac_control |=
594 CMD_ACT_MAC_PROMISCUOUS_ENABLE; 594 CMD_ACT_MAC_PROMISCUOUS_ENABLE;
595 priv->currentpacketfilter &= 595 priv->mac_control &=
596 ~(CMD_ACT_MAC_ALL_MULTICAST_ENABLE | 596 ~(CMD_ACT_MAC_ALL_MULTICAST_ENABLE |
597 CMD_ACT_MAC_MULTICAST_ENABLE); 597 CMD_ACT_MAC_MULTICAST_ENABLE);
598 } else { 598 } else {
599 /* Multicast */ 599 /* Multicast */
600 priv->currentpacketfilter &= 600 priv->mac_control &=
601 ~CMD_ACT_MAC_PROMISCUOUS_ENABLE; 601 ~CMD_ACT_MAC_PROMISCUOUS_ENABLE;
602 602
603 if (dev->flags & IFF_ALLMULTI || dev->mc_count > 603 if (dev->flags & IFF_ALLMULTI || dev->mc_count >
604 MRVDRV_MAX_MULTICAST_LIST_SIZE) { 604 MRVDRV_MAX_MULTICAST_LIST_SIZE) {
605 lbs_deb_net( "enabling all multicast\n"); 605 lbs_deb_net( "enabling all multicast\n");
606 priv->currentpacketfilter |= 606 priv->mac_control |=
607 CMD_ACT_MAC_ALL_MULTICAST_ENABLE; 607 CMD_ACT_MAC_ALL_MULTICAST_ENABLE;
608 priv->currentpacketfilter &= 608 priv->mac_control &=
609 ~CMD_ACT_MAC_MULTICAST_ENABLE; 609 ~CMD_ACT_MAC_MULTICAST_ENABLE;
610 } else { 610 } else {
611 priv->currentpacketfilter &= 611 priv->mac_control &=
612 ~CMD_ACT_MAC_ALL_MULTICAST_ENABLE; 612 ~CMD_ACT_MAC_ALL_MULTICAST_ENABLE;
613 613
614 if (!dev->mc_count) { 614 if (!dev->mc_count) {
615 lbs_deb_net("no multicast addresses, " 615 lbs_deb_net("no multicast addresses, "
616 "disabling multicast\n"); 616 "disabling multicast\n");
617 priv->currentpacketfilter &= 617 priv->mac_control &=
618 ~CMD_ACT_MAC_MULTICAST_ENABLE; 618 ~CMD_ACT_MAC_MULTICAST_ENABLE;
619 } else { 619 } else {
620 int i; 620 int i;
621 621
622 priv->currentpacketfilter |= 622 priv->mac_control |=
623 CMD_ACT_MAC_MULTICAST_ENABLE; 623 CMD_ACT_MAC_MULTICAST_ENABLE;
624 624
625 priv->nr_of_multicastmacaddr = 625 priv->nr_of_multicastmacaddr =
@@ -642,9 +642,8 @@ static void lbs_set_multicast_list(struct net_device *dev)
642 } 642 }
643 } 643 }
644 644
645 if (priv->currentpacketfilter != oldpacketfilter) { 645 if (priv->mac_control != old_mac_control)
646 lbs_set_mac_packet_filter(priv); 646 lbs_set_mac_control(priv);
647 }
648 647
649 lbs_deb_leave(LBS_DEB_NET); 648 lbs_deb_leave(LBS_DEB_NET);
650} 649}
@@ -804,7 +803,7 @@ static int lbs_thread(void *data)
804 lbs_deb_thread("main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p dnld_sent=%d cur_cmd=%p, confirm now\n", 803 lbs_deb_thread("main_thread: PRE_SLEEP--intcounter=%d currenttxskb=%p dnld_sent=%d cur_cmd=%p, confirm now\n",
805 priv->intcounter, priv->currenttxskb, priv->dnld_sent, priv->cur_cmd); 804 priv->intcounter, priv->currenttxskb, priv->dnld_sent, priv->cur_cmd);
806 805
807 lbs_ps_confirm_sleep(priv, (u16) priv->psmode); 806 lbs_ps_confirm_sleep(priv);
808 } else { 807 } else {
809 /* workaround for firmware sending 808 /* workaround for firmware sending
810 * deauth/linkloss event immediately 809 * deauth/linkloss event immediately
@@ -945,7 +944,7 @@ static int lbs_setup_firmware(struct lbs_private *priv)
945 goto done; 944 goto done;
946 } 945 }
947 946
948 lbs_set_mac_packet_filter(priv); 947 lbs_set_mac_control(priv);
949 948
950 ret = lbs_get_data_rate(priv); 949 ret = lbs_get_data_rate(priv);
951 if (ret < 0) { 950 if (ret < 0) {
@@ -1036,7 +1035,7 @@ static int lbs_init_adapter(struct lbs_private *priv)
1036 priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM; 1035 priv->secinfo.auth_mode = IW_AUTH_ALG_OPEN_SYSTEM;
1037 priv->mode = IW_MODE_INFRA; 1036 priv->mode = IW_MODE_INFRA;
1038 priv->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL; 1037 priv->curbssparams.channel = DEFAULT_AD_HOC_CHANNEL;
1039 priv->currentpacketfilter = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON; 1038 priv->mac_control = CMD_ACT_MAC_RX_ON | CMD_ACT_MAC_TX_ON;
1040 priv->radioon = RADIO_ON; 1039 priv->radioon = RADIO_ON;
1041 priv->auto_rate = 1; 1040 priv->auto_rate = 1;
1042 priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE; 1041 priv->capability = WLAN_CAPABILITY_SHORT_PREAMBLE;
@@ -1392,7 +1391,7 @@ static void lbs_remove_mesh(struct lbs_private *priv)
1392 * @param cfp_no A pointer to CFP number 1391 * @param cfp_no A pointer to CFP number
1393 * @return A pointer to CFP 1392 * @return A pointer to CFP
1394 */ 1393 */
1395struct chan_freq_power *lbs_get_region_cfp_table(u8 region, u8 band, int *cfp_no) 1394struct chan_freq_power *lbs_get_region_cfp_table(u8 region, int *cfp_no)
1396{ 1395{
1397 int i, end; 1396 int i, end;
1398 1397
@@ -1426,7 +1425,7 @@ int lbs_set_regiontable(struct lbs_private *priv, u8 region, u8 band)
1426 1425
1427 memset(priv->region_channel, 0, sizeof(priv->region_channel)); 1426 memset(priv->region_channel, 0, sizeof(priv->region_channel));
1428 1427
1429 cfp = lbs_get_region_cfp_table(region, band, &cfp_no); 1428 cfp = lbs_get_region_cfp_table(region, &cfp_no);
1430 if (cfp != NULL) { 1429 if (cfp != NULL) {
1431 priv->region_channel[i].nrcfp = cfp_no; 1430 priv->region_channel[i].nrcfp = cfp_no;
1432 priv->region_channel[i].CFP = cfp; 1431 priv->region_channel[i].CFP = cfp;