diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-10-18 17:54:24 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2009-11-08 12:23:05 -0500 |
commit | dddfbd824b96a25da0b2f1cf35c0be33ef2422fe (patch) | |
tree | 0f48f2883bd00ec5f15d8d32a3c826a3184f47ba /drivers/net/pcmcia/3c589_cs.c | |
parent | 91284224da5b15ec6c2b45e10fa5eccd1c92a204 (diff) |
pcmcia: convert net pcmcia drivers to use new CIS helpers
Use the new CIS helpers in net pcmcia drivers, which allows for
a few code cleanups.
This revision does not remove the phys_addr assignment in
3c589_cs.c -- a bug noted by Komuro <komurojun-mbn@nifty.com>
CC: David S. Miller <davem@davemloft.net>
CC: netdev@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia/3c589_cs.c')
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 569fb06793cf..fc6123ea6fa7 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -256,22 +256,16 @@ static int tc589_config(struct pcmcia_device *link) | |||
256 | { | 256 | { |
257 | struct net_device *dev = link->priv; | 257 | struct net_device *dev = link->priv; |
258 | struct el3_private *lp = netdev_priv(dev); | 258 | struct el3_private *lp = netdev_priv(dev); |
259 | tuple_t tuple; | ||
260 | __le16 buf[32]; | ||
261 | __be16 *phys_addr; | 259 | __be16 *phys_addr; |
262 | int last_fn, last_ret, i, j, multi = 0, fifo; | 260 | int last_fn, last_ret, i, j, multi = 0, fifo; |
263 | unsigned int ioaddr; | 261 | unsigned int ioaddr; |
264 | char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; | 262 | char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; |
263 | u8 *buf; | ||
264 | size_t len; | ||
265 | 265 | ||
266 | DEBUG(0, "3c589_config(0x%p)\n", link); | 266 | DEBUG(0, "3c589_config(0x%p)\n", link); |
267 | 267 | ||
268 | phys_addr = (__be16 *)dev->dev_addr; | 268 | phys_addr = (__be16 *)dev->dev_addr; |
269 | tuple.Attributes = 0; | ||
270 | tuple.TupleData = (cisdata_t *)buf; | ||
271 | tuple.TupleDataMax = sizeof(buf); | ||
272 | tuple.TupleOffset = 0; | ||
273 | tuple.Attributes = TUPLE_RETURN_COMMON; | ||
274 | |||
275 | /* Is this a 3c562? */ | 269 | /* Is this a 3c562? */ |
276 | if (link->manf_id != MANFID_3COM) | 270 | if (link->manf_id != MANFID_3COM) |
277 | printk(KERN_INFO "3c589_cs: hmmm, is this really a " | 271 | printk(KERN_INFO "3c589_cs: hmmm, is this really a " |
@@ -301,12 +295,13 @@ static int tc589_config(struct pcmcia_device *link) | |||
301 | 295 | ||
302 | /* The 3c589 has an extra EEPROM for configuration info, including | 296 | /* The 3c589 has an extra EEPROM for configuration info, including |
303 | the hardware address. The 3c562 puts the address in the CIS. */ | 297 | the hardware address. The 3c562 puts the address in the CIS. */ |
304 | tuple.DesiredTuple = 0x88; | 298 | len = pcmcia_get_tuple(link, 0x88, &buf); |
305 | if (pcmcia_get_first_tuple(link, &tuple) == 0) { | 299 | if (buf && len >= 6) { |
306 | pcmcia_get_tuple_data(link, &tuple); | 300 | for (i = 0; i < 3; i++) |
307 | for (i = 0; i < 3; i++) | 301 | phys_addr[i] = htons(le16_to_cpu(buf[i*2])); |
308 | phys_addr[i] = htons(le16_to_cpu(buf[i])); | 302 | kfree(buf); |
309 | } else { | 303 | } else { |
304 | kfree(buf); /* 0 < len < 6 */ | ||
310 | for (i = 0; i < 3; i++) | 305 | for (i = 0; i < 3; i++) |
311 | phys_addr[i] = htons(read_eeprom(ioaddr, i)); | 306 | phys_addr[i] = htons(read_eeprom(ioaddr, i)); |
312 | if (phys_addr[0] == htons(0x6060)) { | 307 | if (phys_addr[0] == htons(0x6060)) { |