aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl3501_cs.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/wireless/wl3501_cs.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/wireless/wl3501_cs.c')
-rw-r--r--drivers/net/wireless/wl3501_cs.c66
1 files changed, 8 insertions, 58 deletions
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index a1cc2d498a1c..6bc7c92fbff7 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -29,7 +29,6 @@
29 29
30#include <linux/delay.h> 30#include <linux/delay.h>
31#include <linux/types.h> 31#include <linux/types.h>
32#include <linux/ethtool.h>
33#include <linux/init.h> 32#include <linux/init.h>
34#include <linux/interrupt.h> 33#include <linux/interrupt.h>
35#include <linux/in.h> 34#include <linux/in.h>
@@ -48,7 +47,6 @@
48 47
49#include <net/iw_handler.h> 48#include <net/iw_handler.h>
50 49
51#include <pcmcia/cs.h>
52#include <pcmcia/cistpl.h> 50#include <pcmcia/cistpl.h>
53#include <pcmcia/cisreg.h> 51#include <pcmcia/cisreg.h>
54#include <pcmcia/ds.h> 52#include <pcmcia/ds.h>
@@ -78,13 +76,6 @@
78#define WL3501_RESUME 0 76#define WL3501_RESUME 0
79#define WL3501_SUSPEND 1 77#define WL3501_SUSPEND 1
80 78
81/*
82 * The event() function is this driver's Card Services event handler. It will
83 * be called by Card Services when an appropriate card status event is
84 * received. The config() and release() entry points are used to configure or
85 * release a socket, in response to card insertion and ejection events. They
86 * are invoked from the wl24 event handler.
87 */
88static int wl3501_config(struct pcmcia_device *link); 79static int wl3501_config(struct pcmcia_device *link);
89static void wl3501_release(struct pcmcia_device *link); 80static void wl3501_release(struct pcmcia_device *link);
90 81
@@ -201,7 +192,7 @@ static inline void wl3501_switch_page(struct wl3501_card *this, u8 page)
201} 192}
202 193
203/* 194/*
204 * Get Ethernet MAC addresss. 195 * Get Ethernet MAC address.
205 * 196 *
206 * WARNING: We switch to FPAGE0 and switc back again. 197 * WARNING: We switch to FPAGE0 and switc back again.
207 * Making sure there is no other WL function beening called by ISR. 198 * Making sure there is no other WL function beening called by ISR.
@@ -299,7 +290,7 @@ static void wl3501_get_from_wla(struct wl3501_card *this, u16 src, void *dest,
299 * \ \- IEEE 802.11 -/ \-------------- len --------------/ 290 * \ \- IEEE 802.11 -/ \-------------- len --------------/
300 * \-struct wl3501_80211_tx_hdr--/ \-------- Ethernet Frame -------/ 291 * \-struct wl3501_80211_tx_hdr--/ \-------- Ethernet Frame -------/
301 * 292 *
302 * Return = Postion in Card 293 * Return = Position in Card
303 */ 294 */
304static u16 wl3501_get_tx_buffer(struct wl3501_card *this, u16 len) 295static u16 wl3501_get_tx_buffer(struct wl3501_card *this, u16 len)
305{ 296{
@@ -1411,15 +1402,6 @@ static struct iw_statistics *wl3501_get_wireless_stats(struct net_device *dev)
1411 return wstats; 1402 return wstats;
1412} 1403}
1413 1404
1414static void wl3501_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1415{
1416 strlcpy(info->driver, "wl3501_cs", sizeof(info->driver));
1417}
1418
1419static const struct ethtool_ops ops = {
1420 .get_drvinfo = wl3501_get_drvinfo
1421};
1422
1423/** 1405/**
1424 * wl3501_detach - deletes a driver "instance" 1406 * wl3501_detach - deletes a driver "instance"
1425 * @link - FILL_IN 1407 * @link - FILL_IN
@@ -1869,15 +1851,6 @@ static const struct net_device_ops wl3501_netdev_ops = {
1869 .ndo_validate_addr = eth_validate_addr, 1851 .ndo_validate_addr = eth_validate_addr,
1870}; 1852};
1871 1853
1872/**
1873 * wl3501_attach - creates an "instance" of the driver
1874 *
1875 * Creates an "instance" of the driver, allocating local data structures for
1876 * one device. The device is registered with Card Services.
1877 *
1878 * The dev_link structure is initialized, but we don't actually configure the
1879 * card at this point -- we wait until we receive a card insertion event.
1880 */
1881static int wl3501_probe(struct pcmcia_device *p_dev) 1854static int wl3501_probe(struct pcmcia_device *p_dev)
1882{ 1855{
1883 struct net_device *dev; 1856 struct net_device *dev;
@@ -1888,9 +1861,8 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1888 p_dev->resource[0]->flags = IO_DATA_PATH_WIDTH_8; 1861 p_dev->resource[0]->flags = IO_DATA_PATH_WIDTH_8;
1889 1862
1890 /* General socket configuration */ 1863 /* General socket configuration */
1891 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 1864 p_dev->config_flags = CONF_ENABLE_IRQ;
1892 p_dev->conf.IntType = INT_MEMORY_AND_IO; 1865 p_dev->config_index = 1;
1893 p_dev->conf.ConfigIndex = 1;
1894 1866
1895 dev = alloc_etherdev(sizeof(struct wl3501_card)); 1867 dev = alloc_etherdev(sizeof(struct wl3501_card));
1896 if (!dev) 1868 if (!dev)
@@ -1905,7 +1877,6 @@ static int wl3501_probe(struct pcmcia_device *p_dev)
1905 this->p_dev = p_dev; 1877 this->p_dev = p_dev;
1906 dev->wireless_data = &this->wireless_data; 1878 dev->wireless_data = &this->wireless_data;
1907 dev->wireless_handlers = &wl3501_handler_def; 1879 dev->wireless_handlers = &wl3501_handler_def;
1908 SET_ETHTOOL_OPS(dev, &ops);
1909 netif_stop_queue(dev); 1880 netif_stop_queue(dev);
1910 p_dev->priv = dev; 1881 p_dev->priv = dev;
1911 1882
@@ -1914,14 +1885,6 @@ out_link:
1914 return -ENOMEM; 1885 return -ENOMEM;
1915} 1886}
1916 1887
1917/**
1918 * wl3501_config - configure the PCMCIA socket and make eth device available
1919 * @link - FILL_IN
1920 *
1921 * wl3501_config() is scheduled to run after a CARD_INSERTION event is
1922 * received, to configure the PCMCIA socket, and to make the ethernet device
1923 * available to the system.
1924 */
1925static int wl3501_config(struct pcmcia_device *link) 1888static int wl3501_config(struct pcmcia_device *link)
1926{ 1889{
1927 struct net_device *dev = link->priv; 1890 struct net_device *dev = link->priv;
@@ -1952,10 +1915,7 @@ static int wl3501_config(struct pcmcia_device *link)
1952 if (ret) 1915 if (ret)
1953 goto failed; 1916 goto failed;
1954 1917
1955 /* This actually configures the PCMCIA socket -- setting up the I/O 1918 ret = pcmcia_enable_device(link);
1956 * windows and the interrupt mapping. */
1957
1958 ret = pcmcia_request_configuration(link, &link->conf);
1959 if (ret) 1919 if (ret)
1960 goto failed; 1920 goto failed;
1961 1921
@@ -1972,7 +1932,7 @@ static int wl3501_config(struct pcmcia_device *link)
1972 this->base_addr = dev->base_addr; 1932 this->base_addr = dev->base_addr;
1973 1933
1974 if (!wl3501_get_flash_mac_addr(this)) { 1934 if (!wl3501_get_flash_mac_addr(this)) {
1975 printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n", 1935 printk(KERN_WARNING "%s: Can't read MAC addr in flash ROM?\n",
1976 dev->name); 1936 dev->name);
1977 unregister_netdev(dev); 1937 unregister_netdev(dev);
1978 goto failed; 1938 goto failed;
@@ -2010,14 +1970,6 @@ failed:
2010 return -ENODEV; 1970 return -ENODEV;
2011} 1971}
2012 1972
2013/**
2014 * wl3501_release - unregister the net, release PCMCIA configuration
2015 * @arg - link
2016 *
2017 * After a card is removed, wl3501_release() will unregister the net device,
2018 * and release the PCMCIA configuration. If the device is still open, this
2019 * will be postponed until it is closed.
2020 */
2021static void wl3501_release(struct pcmcia_device *link) 1973static void wl3501_release(struct pcmcia_device *link)
2022{ 1974{
2023 pcmcia_disable_device(link); 1975 pcmcia_disable_device(link);
@@ -2048,7 +2000,7 @@ static int wl3501_resume(struct pcmcia_device *link)
2048} 2000}
2049 2001
2050 2002
2051static struct pcmcia_device_id wl3501_ids[] = { 2003static const struct pcmcia_device_id wl3501_ids[] = {
2052 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0001), 2004 PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0001),
2053 PCMCIA_DEVICE_NULL 2005 PCMCIA_DEVICE_NULL
2054}; 2006};
@@ -2056,9 +2008,7 @@ MODULE_DEVICE_TABLE(pcmcia, wl3501_ids);
2056 2008
2057static struct pcmcia_driver wl3501_driver = { 2009static struct pcmcia_driver wl3501_driver = {
2058 .owner = THIS_MODULE, 2010 .owner = THIS_MODULE,
2059 .drv = { 2011 .name = "wl3501_cs",
2060 .name = "wl3501_cs",
2061 },
2062 .probe = wl3501_probe, 2012 .probe = wl3501_probe,
2063 .remove = wl3501_detach, 2013 .remove = wl3501_detach,
2064 .id_table = wl3501_ids, 2014 .id_table = wl3501_ids,