aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/orinoco/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/orinoco/main.c')
-rw-r--r--drivers/net/wireless/orinoco/main.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index 4fa8264a400..ff869a25024 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -80,6 +80,7 @@
80#include <linux/kernel.h> 80#include <linux/kernel.h>
81#include <linux/init.h> 81#include <linux/init.h>
82#include <linux/delay.h> 82#include <linux/delay.h>
83#include <linux/device.h>
83#include <linux/netdevice.h> 84#include <linux/netdevice.h>
84#include <linux/etherdevice.h> 85#include <linux/etherdevice.h>
85#include <linux/ethtool.h> 86#include <linux/ethtool.h>
@@ -2073,9 +2074,9 @@ static void orinoco_unregister_pm_notifier(struct orinoco_private *priv)
2073/* Initialization */ 2074/* Initialization */
2074/********************************************************************/ 2075/********************************************************************/
2075 2076
2076static int orinoco_init(struct net_device *dev) 2077int orinoco_init(struct orinoco_private *priv)
2077{ 2078{
2078 struct orinoco_private *priv = netdev_priv(dev); 2079 struct device *dev = priv->dev;
2079 hermes_t *hw = &priv->hw; 2080 hermes_t *hw = &priv->hw;
2080 int err = 0; 2081 int err = 0;
2081 2082
@@ -2086,15 +2087,14 @@ static int orinoco_init(struct net_device *dev)
2086 /* Initialize the firmware */ 2087 /* Initialize the firmware */
2087 err = hermes_init(hw); 2088 err = hermes_init(hw);
2088 if (err != 0) { 2089 if (err != 0) {
2089 printk(KERN_ERR "%s: failed to initialize firmware (err = %d)\n", 2090 dev_err(dev, "Failed to initialize firmware (err = %d)\n",
2090 dev->name, err); 2091 err);
2091 goto out; 2092 goto out;
2092 } 2093 }
2093 2094
2094 err = determine_fw_capabilities(priv); 2095 err = determine_fw_capabilities(priv);
2095 if (err != 0) { 2096 if (err != 0) {
2096 printk(KERN_ERR "%s: Incompatible firmware, aborting\n", 2097 dev_err(dev, "Incompatible firmware, aborting\n");
2097 dev->name);
2098 goto out; 2098 goto out;
2099 } 2099 }
2100 2100
@@ -2110,27 +2110,23 @@ static int orinoco_init(struct net_device *dev)
2110 /* Check firmware version again */ 2110 /* Check firmware version again */
2111 err = determine_fw_capabilities(priv); 2111 err = determine_fw_capabilities(priv);
2112 if (err != 0) { 2112 if (err != 0) {
2113 printk(KERN_ERR "%s: Incompatible firmware, aborting\n", 2113 dev_err(dev, "Incompatible firmware, aborting\n");
2114 dev->name);
2115 goto out; 2114 goto out;
2116 } 2115 }
2117 } 2116 }
2118 2117
2119 if (priv->has_port3) 2118 if (priv->has_port3)
2120 printk(KERN_DEBUG "%s: Ad-hoc demo mode supported\n", 2119 dev_info(dev, "Ad-hoc demo mode supported\n");
2121 dev->name);
2122 if (priv->has_ibss) 2120 if (priv->has_ibss)
2123 printk(KERN_DEBUG "%s: IEEE standard IBSS ad-hoc mode supported\n", 2121 dev_info(dev, "IEEE standard IBSS ad-hoc mode supported\n");
2124 dev->name); 2122 if (priv->has_wep)
2125 if (priv->has_wep) { 2123 dev_info(dev, "WEP supported, %s-bit key\n",
2126 printk(KERN_DEBUG "%s: WEP supported, %s-bit key\n", dev->name, 2124 priv->has_big_wep ? "104" : "40");
2127 priv->has_big_wep ? "104" : "40");
2128 }
2129 if (priv->has_wpa) { 2125 if (priv->has_wpa) {
2130 printk(KERN_DEBUG "%s: WPA-PSK supported\n", dev->name); 2126 dev_info(dev, "WPA-PSK supported\n");
2131 if (orinoco_mic_init(priv)) { 2127 if (orinoco_mic_init(priv)) {
2132 printk(KERN_ERR "%s: Failed to setup MIC crypto " 2128 dev_err(dev, "Failed to setup MIC crypto algorithm. "
2133 "algorithm. Disabling WPA support\n", dev->name); 2129 "Disabling WPA support\n");
2134 priv->has_wpa = 0; 2130 priv->has_wpa = 0;
2135 } 2131 }
2136 } 2132 }
@@ -2141,14 +2137,14 @@ static int orinoco_init(struct net_device *dev)
2141 goto out; 2137 goto out;
2142 orinoco_bss_data_init(priv); 2138 orinoco_bss_data_init(priv);
2143 2139
2144 err = orinoco_hw_read_card_settings(priv, dev->dev_addr); 2140 /* Netdev has not initialised, but we have allocated the buffer. */
2141 err = orinoco_hw_read_card_settings(priv, priv->ndev->dev_addr);
2145 if (err) 2142 if (err)
2146 goto out; 2143 goto out;
2147 2144
2148 err = orinoco_hw_allocate_fid(priv); 2145 err = orinoco_hw_allocate_fid(priv);
2149 if (err) { 2146 if (err) {
2150 printk(KERN_ERR "%s: failed to allocate NIC buffer!\n", 2147 dev_err(dev, "Failed to allocate NIC buffer!\n");
2151 dev->name);
2152 goto out; 2148 goto out;
2153 } 2149 }
2154 2150
@@ -2174,14 +2170,14 @@ static int orinoco_init(struct net_device *dev)
2174 priv->hw_unavailable--; 2170 priv->hw_unavailable--;
2175 spin_unlock_irq(&priv->lock); 2171 spin_unlock_irq(&priv->lock);
2176 2172
2177 printk(KERN_DEBUG "%s: ready\n", dev->name); 2173 dev_dbg(dev, "Ready\n");
2178 2174
2179 out: 2175 out:
2180 return err; 2176 return err;
2181} 2177}
2178EXPORT_SYMBOL(orinoco_init);
2182 2179
2183static const struct net_device_ops orinoco_netdev_ops = { 2180static const struct net_device_ops orinoco_netdev_ops = {
2184 .ndo_init = orinoco_init,
2185 .ndo_open = orinoco_open, 2181 .ndo_open = orinoco_open,
2186 .ndo_stop = orinoco_stop, 2182 .ndo_stop = orinoco_stop,
2187 .ndo_start_xmit = orinoco_xmit, 2183 .ndo_start_xmit = orinoco_xmit,