Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
[safe/jmp/linux-2.6] / drivers / net / wireless / wl3501_cs.c
index cfde68c..68789c6 100644 (file)
@@ -79,7 +79,7 @@ static int pc_debug = PCMCIA_DEBUG;
 module_param(pc_debug, int, 0);
 #define dprintk(n, format, args...) \
        { if (pc_debug > (n)) \
-               printk(KERN_INFO "%s: " format "\n", __FUNCTION__ , ##args); }
+               printk(KERN_INFO "%s: " format "\n", __func__ , ##args); }
 #else
 #define dprintk(n, format, args...)
 #endif
@@ -470,7 +470,7 @@ static int wl3501_pwr_mgmt(struct wl3501_card *this, int suspend)
                        spin_unlock_irqrestore(&this->lock, flags);
                        rc = wait_event_interruptible(this->wait,
                                this->sig_pwr_mgmt_confirm.status != 255);
-                       printk(KERN_INFO "%s: %s status=%d\n", __FUNCTION__,
+                       printk(KERN_INFO "%s: %s status=%d\n", __func__,
                               suspend ? "suspend" : "resume",
                               this->sig_pwr_mgmt_confirm.status);
                        goto out;
@@ -860,11 +860,10 @@ static int wl3501_esbq_confirm(struct wl3501_card *this)
 static void wl3501_online(struct net_device *dev)
 {
        struct wl3501_card *this = netdev_priv(dev);
+       DECLARE_MAC_BUF(mac);
 
-       printk(KERN_INFO "%s: Wireless LAN online. BSSID: "
-              "%02X %02X %02X %02X %02X %02X\n", dev->name,
-              this->bssid[0], this->bssid[1], this->bssid[2],
-              this->bssid[3], this->bssid[4], this->bssid[5]);
+       printk(KERN_INFO "%s: Wireless LAN online. BSSID: %s\n",
+              dev->name, print_mac(mac, this->bssid));
        netif_wake_queue(dev);
 }
 
@@ -1200,7 +1199,7 @@ static int wl3501_reset_board(struct wl3501_card *this)
                }
                WL3501_NOPLOOP(10);
        }
-       printk(KERN_WARNING "%s: failed to reset the board!\n", __FUNCTION__);
+       printk(KERN_WARNING "%s: failed to reset the board!\n", __func__);
        rc = -ENODEV;
 out:
        return rc;
@@ -1251,7 +1250,7 @@ static int wl3501_init_firmware(struct wl3501_card *this)
 out:
        return rc;
 fail:
-       printk(KERN_WARNING "%s: failed!\n", __FUNCTION__);
+       printk(KERN_WARNING "%s: failed!\n", __func__);
        goto out;
 }
 
@@ -1625,25 +1624,25 @@ static int wl3501_get_scan(struct net_device *dev, struct iw_request_info *info,
                iwe.cmd                 = SIOCGIWAP;
                iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
                memcpy(iwe.u.ap_addr.sa_data, this->bss_set[i].bssid, ETH_ALEN);
-               current_ev = iwe_stream_add_event(current_ev,
+               current_ev = iwe_stream_add_event(info, current_ev,
                                                  extra + IW_SCAN_MAX_DATA,
                                                  &iwe, IW_EV_ADDR_LEN);
                iwe.cmd           = SIOCGIWESSID;
                iwe.u.data.flags  = 1;
                iwe.u.data.length = this->bss_set[i].ssid.el.len;
-               current_ev = iwe_stream_add_point(current_ev,
+               current_ev = iwe_stream_add_point(info, current_ev,
                                                  extra + IW_SCAN_MAX_DATA,
                                                  &iwe,
                                                  this->bss_set[i].ssid.essid);
                iwe.cmd    = SIOCGIWMODE;
                iwe.u.mode = this->bss_set[i].bss_type;
-               current_ev = iwe_stream_add_event(current_ev,
+               current_ev = iwe_stream_add_event(info, current_ev,
                                                  extra + IW_SCAN_MAX_DATA,
                                                  &iwe, IW_EV_UINT_LEN);
                iwe.cmd = SIOCGIWFREQ;
                iwe.u.freq.m = this->bss_set[i].ds_pset.chan;
                iwe.u.freq.e = 0;
-               current_ev = iwe_stream_add_event(current_ev,
+               current_ev = iwe_stream_add_event(info, current_ev,
                                                  extra + IW_SCAN_MAX_DATA,
                                                  &iwe, IW_EV_FREQ_LEN);
                iwe.cmd = SIOCGIWENCODE;
@@ -1652,7 +1651,7 @@ static int wl3501_get_scan(struct net_device *dev, struct iw_request_info *info,
                else
                        iwe.u.data.flags = IW_ENCODE_DISABLED;
                iwe.u.data.length = 0;
-               current_ev = iwe_stream_add_point(current_ev,
+               current_ev = iwe_stream_add_point(info, current_ev,
                                                  extra + IW_SCAN_MAX_DATA,
                                                  &iwe, NULL);
        }
@@ -1893,7 +1892,7 @@ static const iw_handler   wl3501_handler[] = {
 };
 
 static const struct iw_handler_def wl3501_handler_def = {
-       .num_standard   = sizeof(wl3501_handler) / sizeof(iw_handler),
+       .num_standard   = ARRAY_SIZE(wl3501_handler),
        .standard       = (iw_handler *)wl3501_handler,
        .get_wireless_stats = wl3501_get_wireless_stats,
 };
@@ -1918,7 +1917,7 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
        p_dev->io.IOAddrLines   = 5;
 
        /* Interrupt setup */
-       p_dev->irq.Attributes   = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+       p_dev->irq.Attributes   = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT;
        p_dev->irq.IRQInfo1     = IRQ_LEVEL_ID;
        p_dev->irq.Handler = wl3501_interrupt;
 
@@ -1966,6 +1965,7 @@ static int wl3501_config(struct pcmcia_device *link)
        struct net_device *dev = link->priv;
        int i = 0, j, last_fn, last_ret;
        struct wl3501_card *this;
+       DECLARE_MAC_BUF(mac);
 
        /* Try allocating IO ports.  This tries a few fixed addresses.  If you
         * want, you can also read the card's config table to pick addresses --
@@ -1977,10 +1977,10 @@ static int wl3501_config(struct pcmcia_device *link)
                link->io.BasePort1 = j;
                link->io.BasePort2 = link->io.BasePort1 + 0x10;
                i = pcmcia_request_io(link, &link->io);
-               if (i == CS_SUCCESS)
+               if (i == 0)
                        break;
        }
-       if (i != CS_SUCCESS) {
+       if (i != 0) {
                cs_error(link, RequestIO, i);
                goto failed;
        }
@@ -2019,14 +2019,14 @@ static int wl3501_config(struct pcmcia_device *link)
        }
        strcpy(this->node.dev_name, dev->name);
 
-       /* print probe information */
-       printk(KERN_INFO "%s: wl3501 @ 0x%3.3x, IRQ %d, MAC addr in flash ROM:",
-              dev->name, this->base_addr, (int)dev->irq);
-       for (i = 0; i < 6; i++) {
+       for (i = 0; i < 6; i++)
                dev->dev_addr[i] = ((char *)&this->mac_addr)[i];
-               printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
-       }
-       printk("\n");
+
+       /* print probe information */
+       printk(KERN_INFO "%s: wl3501 @ 0x%3.3x, IRQ %d, "
+              "MAC addr in flash ROM:%s\n",
+              dev->name, this->base_addr, (int)dev->irq,
+              print_mac(mac, dev->dev_addr));
        /*
         * Initialize card parameters - added by jss
         */