On Wed, 15 Mar 2006 09:40:52 -0800, Jouni Malinen wrote:
> This breaks bcm43xx-d80211 build. Do you happen to have a patch to fix
> it?

Yes, I do. Sorry for not posting it.

This is a first part; it's just ugly and quick (but working) fix.

Index: dscape/drivers/net/wireless/bcm43xx-d80211/bcm43xx.h
===================================================================
--- dscape.orig/drivers/net/wireless/bcm43xx-d80211/bcm43xx.h   2006-03-06 
15:37:20.000000000 +0100
+++ dscape/drivers/net/wireless/bcm43xx-d80211/bcm43xx.h        2006-03-15 
17:29:08.000000000 +0100
@@ -720,6 +720,7 @@ struct bcm43xx_private {
        /* Informational stuff. */
        char nick[IW_ESSID_MAX_SIZE + 1];
        u8 bssid[ETH_ALEN];
+       int interfaces;
 
        /* encryption/decryption */
        u16 security_offset;
Index: dscape/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c
===================================================================
--- dscape.orig/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c      
2006-03-06 15:37:20.000000000 +0100
+++ dscape/drivers/net/wireless/bcm43xx-d80211/bcm43xx_main.c   2006-03-15 
17:29:08.000000000 +0100
@@ -4409,9 +4409,6 @@ static int bcm43xx_net_config(struct net
        if (conf->channel != radio->channel)
                bcm43xx_radio_selectchannel(bcm, conf->channel, 0);
 
-       if (conf->mode != bcm->iw_mode)
-               bcm43xx_set_iwmode(bcm, conf->mode);
-
        if (conf->short_slot_time != bcm->short_slot) {
                assert(phy->type == BCM43xx_PHYTYPE_G);
                if (conf->short_slot_time)
@@ -4578,6 +4575,33 @@ static int bcm43xx_net_stop(struct net_d
        return 0;
 }
 
+static int bcm43xx_add_interface(struct net_device *net_dev,
+                                struct ieee80211_if_conf *conf)
+{
+       struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
+
+       if (bcm->interfaces > 0)
+               return -ENOBUFS;
+       if (memcmp(bcm->net_dev->dev_addr, conf->mac_addr, ETH_ALEN) != 0)
+               return -EADDRNOTAVAIL;
+       if (conf->type == IEEE80211_SUB_IF_TYPE_STA)
+               bcm->iw_mode = IW_MODE_INFRA;
+       else if (conf->type == IEEE80211_SUB_IF_TYPE_IBSS)
+               bcm->iw_mode = IW_MODE_ADHOC;
+       else
+               return -EOPNOTSUPP;
+       bcm->interfaces++;
+       return 0;
+}
+
+static void bcm43xx_remove_interface(struct net_device *net_dev,
+                                    struct ieee80211_if_conf *conf)
+{
+       struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
+
+       bcm->interfaces--;
+}
+
 /* Initialization of struct net_device, just after allocation. */
 static void bcm43xx_netdev_setup(struct net_device *net_dev)
 {
@@ -4659,6 +4683,8 @@ static int __devinit bcm43xx_init_one(st
        ieee->tx = bcm43xx_net_hard_start_xmit;
        ieee->open = bcm43xx_net_open;
        ieee->stop = bcm43xx_net_stop;
+       ieee->add_interface = bcm43xx_add_interface;
+       ieee->remove_interface = bcm43xx_remove_interface;
        ieee->reset = bcm43xx_net_reset;
        ieee->config = bcm43xx_net_config;
 //TODO ieee->set_key = bcm43xx_net_set_key;


-- 
Jiri Benc
SUSE Labs
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to