aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/hostap
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-10-18 12:22:32 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-08 12:06:32 -0500
commit7d2e8d00b47b973c92db4df7444d5e6d3bb945f9 (patch)
tree22286fa095d0340245e83ca9c7695f42f65c141a /drivers/net/wireless/hostap
parent6ae3b84d979308671bf6f6a2123c258a8603d61c (diff)
pcmcia: use pre-determined values
A few PCMCIA network drivers can make use of values provided by the pcmcia core, instead of tedious, independent CIS parsing. xirc32ps_cs.c: manf_id hostap_cs.c: multifunction count b43/pcmcia.c: ConfigBase address and "Present" smc91c92_cs.c: By default, mhz_setup() can use VERS_1 as it is stored in struct pcmcia_device. Only some cards require workarounds, such as reading out VERS_1 twice. CC: David S. Miller <davem@davemloft.net> CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org Acked-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/wireless/hostap')
-rw-r--r--drivers/net/wireless/hostap/hostap_cs.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c
index ad8eab4a639b..31b60dd87bfe 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -274,9 +274,6 @@ static int sandisk_enable_wireless(struct net_device *dev)
274 conf_reg_t reg; 274 conf_reg_t reg;
275 struct hostap_interface *iface = netdev_priv(dev); 275 struct hostap_interface *iface = netdev_priv(dev);
276 local_info_t *local = iface->local; 276 local_info_t *local = iface->local;
277 tuple_t tuple;
278 cisparse_t *parse = NULL;
279 u_char buf[64];
280 struct hostap_cs_priv *hw_priv = local->hw_priv; 277 struct hostap_cs_priv *hw_priv = local->hw_priv;
281 278
282 if (hw_priv->link->io.NumPorts1 < 0x42) { 279 if (hw_priv->link->io.NumPorts1 < 0x42) {
@@ -285,28 +282,13 @@ static int sandisk_enable_wireless(struct net_device *dev)
285 goto done; 282 goto done;
286 } 283 }
287 284
288 parse = kmalloc(sizeof(cisparse_t), GFP_KERNEL);
289 if (parse == NULL) {
290 ret = -ENOMEM;
291 goto done;
292 }
293
294 tuple.Attributes = TUPLE_RETURN_COMMON;
295 tuple.TupleData = buf;
296 tuple.TupleDataMax = sizeof(buf);
297 tuple.TupleOffset = 0;
298
299 if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) { 285 if (hw_priv->link->manf_id != 0xd601 || hw_priv->link->card_id != 0x0101) {
300 /* No SanDisk manfid found */ 286 /* No SanDisk manfid found */
301 ret = -ENODEV; 287 ret = -ENODEV;
302 goto done; 288 goto done;
303 } 289 }
304 290
305 tuple.DesiredTuple = CISTPL_LONGLINK_MFC; 291 if (hw_priv->link->socket->functions < 2) {
306 if (pcmcia_get_first_tuple(hw_priv->link, &tuple) ||
307 pcmcia_get_tuple_data(hw_priv->link, &tuple) ||
308 pcmcia_parse_tuple(&tuple, parse) ||
309 parse->longlink_mfc.nfn < 2) {
310 /* No multi-function links found */ 292 /* No multi-function links found */
311 ret = -ENODEV; 293 ret = -ENODEV;
312 goto done; 294 goto done;
@@ -354,7 +336,6 @@ static int sandisk_enable_wireless(struct net_device *dev)
354 udelay(10); 336 udelay(10);
355 337
356done: 338done:
357 kfree(parse);
358 return ret; 339 return ret;
359} 340}
360 341