diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 12:11:44 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 12:11:44 -0800 |
commit | b5c78e04dd061b776978dad61dd85357081147b0 (patch) | |
tree | 2416b2dc61c452c3aeb2a32bcedf15e6257be638 /drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | |
parent | Merge tag 'driver-core-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core (diff) | |
parent | staging: comedi: vmk80xx: wait for URBs to complete (diff) | |
download | linux-dev-b5c78e04dd061b776978dad61dd85357081147b0.tar.xz linux-dev-b5c78e04dd061b776978dad61dd85357081147b0.zip |
Merge tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging tree update from Greg Kroah-Hartman:
"Here's the big staging tree merge for 3.9-rc1
Lots of cleanups and updates for drivers all through the staging tree.
We are pretty much "code neutral" here, adding just about as many
lines as we removed.
All of these have been in linux-next for a while."
* tag 'staging-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (804 commits)
staging: comedi: vmk80xx: wait for URBs to complete
staging: comedi: drivers: addi-data: hwdrv_apci3200.c: Add a missing semicolon
staging: et131x: Update TODO list
staging: et131x: Remove assignment of skb->dev
staging: wlan-ng: hfa384x.h: fix for error reported by smatch
staging/zache checkpatch ERROR: spaces prohibited around that
staging/ozwpan: Mark read only parameters and structs as const
staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat
staging/ozwpan: Mark local functions as static (fix sparse warnings)
staging/ozwpan: Add missing header includes
staging/usbip: Mark local functions as static (fix sparse warnings)
staging/xgifb: Remove duplicated code in loops.
staging/xgifb: Consolidate return paths
staging/xgifb: Remove code without effect
staging/xgifb: Remove unnecessary casts
staging/xgifb: Consolidate if/else if with identical code branches
staging: vt6656: replaced custom TRUE definition with true
staging: vt6656: replaced custom FALSE definition with false
staging: vt6656: replace custom BOOL definition with bool
staging/rtl8187se: Mark functions as static to silence sparse
...
Diffstat (limited to 'drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c')
-rw-r--r-- | drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c index 67ca5c990437..29d0a72f0d65 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c @@ -328,11 +328,12 @@ static void ft1000_disable_interrupts(struct net_device *dev) static void ft1000_reset_asic(struct net_device *dev) { struct ft1000_info *info = netdev_priv(dev); + struct ft1000_pcmcia *pcmcia = info->priv; u16 tempword; DEBUG(1, "ft1000_hw:ft1000_reset_asic called\n"); - (*info->ft1000_reset) (info->link); + (*info->ft1000_reset) (pcmcia->link); // Let's use the register provided by the Magnemite ASIC to reset the // ASIC and DSP. @@ -1397,12 +1398,13 @@ static int ft1000_parse_dpram_msg(struct net_device *dev) static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) { struct ft1000_info *info = netdev_priv(dev); + struct ft1000_pcmcia *pcmcia = info->priv; u16 i; u32 templong; u16 tempword; DEBUG(1, "ft1000:ft1000_hw:ft1000_flush_fifo called\n"); - if (info->PktIntfErr > MAX_PH_ERR) { + if (pcmcia->PktIntfErr > MAX_PH_ERR) { if (info->AsicID == ELECTRABUZZ_ID) { info->DSP_TIME[0] = ft1000_read_dpram(dev, FT1000_DSP_TIMER0); @@ -1491,7 +1493,7 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) FIFO_FLUSH_BADCNT; } else { // Let's assume that we really flush the FIFO - info->PktIntfErr++; + pcmcia->PktIntfErr++; return; } } else { @@ -1522,7 +1524,7 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) DEBUG(0, "FT1000_REG_MAG_DFSR = 0x%x\n", tempword); } if (DrvErrNum) { - info->PktIntfErr++; + pcmcia->PktIntfErr++; } } } @@ -1731,6 +1733,7 @@ static int ft1000_copy_up_pkt(struct net_device *dev) static int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) { struct ft1000_info *info = netdev_priv(dev); + struct ft1000_pcmcia *pcmcia = info->priv; union { struct pseudo_hdr blk; u16 buff[sizeof(struct pseudo_hdr) >> 1]; @@ -1780,7 +1783,7 @@ static int ft1000_copy_down_pkt(struct net_device *dev, u16 * packet, u16 len) pseudo.blk.control = 0; pseudo.blk.rsvd1 = 0; pseudo.blk.seq_num = 0; - pseudo.blk.rsvd2 = info->packetseqnum++; + pseudo.blk.rsvd2 = pcmcia->packetseqnum++; pseudo.blk.qos_class = 0; /* Calculate pseudo header checksum */ pseudo.blk.checksum = pseudo.buff[0]; @@ -2058,6 +2061,8 @@ void stop_ft1000_card(struct net_device *dev) kfree(ptr); } + kfree(info->priv); + if (info->registered) { unregister_netdev(dev); info->registered = 0; @@ -2101,6 +2106,7 @@ struct net_device *init_ft1000_card(struct pcmcia_device *link, void *ft1000_reset) { struct ft1000_info *info; + struct ft1000_pcmcia *pcmcia; struct net_device *dev; static const struct net_device_ops ft1000ops = // Slavius 21.10.2009 due to kernel changes @@ -2142,10 +2148,13 @@ struct net_device *init_ft1000_card(struct pcmcia_device *link, memset(&info->stats, 0, sizeof(struct net_device_stats)); + info->priv = kzalloc(sizeof(struct ft1000_pcmcia), GFP_KERNEL); + pcmcia = info->priv; + pcmcia->link = link; + spin_lock_init(&info->dpram_lock); info->DrvErrNum = 0; info->registered = 1; - info->link = link; info->ft1000_reset = ft1000_reset; info->mediastate = 0; info->fifo_cnt = 0; |