aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/pc300_drv.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/wan/pc300_drv.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/wan/pc300_drv.c')
-rw-r--r--drivers/net/wan/pc300_drv.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c
index 79dabc557bd3..3f744c643094 100644
--- a/drivers/net/wan/pc300_drv.c
+++ b/drivers/net/wan/pc300_drv.c
@@ -228,6 +228,7 @@ static char rcsid[] =
228#include <linux/etherdevice.h> 228#include <linux/etherdevice.h>
229#include <linux/spinlock.h> 229#include <linux/spinlock.h>
230#include <linux/if.h> 230#include <linux/if.h>
231#include <linux/slab.h>
231#include <net/arp.h> 232#include <net/arp.h>
232 233
233#include <asm/io.h> 234#include <asm/io.h>
@@ -251,7 +252,7 @@ static char rcsid[] =
251#undef PC300_DEBUG_RX 252#undef PC300_DEBUG_RX
252#undef PC300_DEBUG_OTHER 253#undef PC300_DEBUG_OTHER
253 254
254static struct pci_device_id cpc_pci_dev_id[] __devinitdata = { 255static DEFINE_PCI_DEVICE_TABLE(cpc_pci_dev_id) = {
255 /* PC300/RSV or PC300/X21, 2 chan */ 256 /* PC300/RSV or PC300/X21, 2 chan */
256 {0x120e, 0x300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0x300}, 257 {0x120e, 0x300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0x300},
257 /* PC300/RSV or PC300/X21, 1 chan */ 258 /* PC300/RSV or PC300/X21, 1 chan */
@@ -514,8 +515,8 @@ static int dma_buf_read(pc300_t * card, int ch, struct sk_buff *skb)
514 RX_BD_ADDR(ch, chan->rx_first_bd)); 515 RX_BD_ADDR(ch, chan->rx_first_bd));
515 while ((status = cpc_readb(&ptdescr->status)) & DST_OSB) { 516 while ((status = cpc_readb(&ptdescr->status)) & DST_OSB) {
516 nchar = cpc_readw(&ptdescr->len); 517 nchar = cpc_readw(&ptdescr->len);
517 if ((status & (DST_OVR | DST_CRC | DST_RBIT | DST_SHRT | DST_ABT)) 518 if ((status & (DST_OVR | DST_CRC | DST_RBIT | DST_SHRT | DST_ABT)) ||
518 || (nchar > BD_DEF_LEN)) { 519 (nchar > BD_DEF_LEN)) {
519 520
520 if (nchar > BD_DEF_LEN) 521 if (nchar > BD_DEF_LEN)
521 status |= DST_RBIT; 522 status |= DST_RBIT;
@@ -1428,8 +1429,7 @@ static void falc_update_stats(pc300_t * card, int ch)
1428 1429
1429 if (((conf->media == IF_IFACE_T1) && 1430 if (((conf->media == IF_IFACE_T1) &&
1430 (cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_LLBAD) && 1431 (cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_LLBAD) &&
1431 (!(cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_PDEN))) 1432 (!(cpc_readb(falcbase + F_REG(FRS1, ch)) & FRS1_PDEN))) ||
1432 ||
1433 ((conf->media == IF_IFACE_E1) && 1433 ((conf->media == IF_IFACE_E1) &&
1434 (cpc_readb(falcbase + F_REG(RSP, ch)) & RSP_LLBAD))) { 1434 (cpc_readb(falcbase + F_REG(RSP, ch)) & RSP_LLBAD))) {
1435 pfalc->prbs = 2; 1435 pfalc->prbs = 2;
@@ -2285,8 +2285,8 @@ static void falc_e1_intr(pc300_t * card, int ch)
2285 if (gis & GIS_ISR1) { 2285 if (gis & GIS_ISR1) {
2286 isr1 = cpc_readb(falcbase + F_REG(FISR1, ch)); 2286 isr1 = cpc_readb(falcbase + F_REG(FISR1, ch));
2287 if (isr1 & FISR1_XMB) { 2287 if (isr1 & FISR1_XMB) {
2288 if ((pfalc->xmb_cause & 2) 2288 if ((pfalc->xmb_cause & 2) &&
2289 && pfalc->multiframe_mode) { 2289 pfalc->multiframe_mode) {
2290 if (cpc_readb (falcbase + F_REG(FRS0, ch)) & 2290 if (cpc_readb (falcbase + F_REG(FRS0, ch)) &
2291 (FRS0_LOS | FRS0_AIS | FRS0_LFA)) { 2291 (FRS0_LOS | FRS0_AIS | FRS0_LFA)) {
2292 cpc_writeb(falcbase + F_REG(XSP, ch), 2292 cpc_writeb(falcbase + F_REG(XSP, ch),
@@ -2639,9 +2639,9 @@ static int cpc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
2639 !(cpc_readb (scabase + M_REG(CTL, ch)) & CTL_DTR); 2639 !(cpc_readb (scabase + M_REG(CTL, ch)) & CTL_DTR);
2640 /* There is no DSR in HD64572 */ 2640 /* There is no DSR in HD64572 */
2641 } 2641 }
2642 if (!arg 2642 if (!arg ||
2643 || copy_to_user(arg, &pc300status, sizeof(pc300status_t))) 2643 copy_to_user(arg, &pc300status, sizeof(pc300status_t)))
2644 return -EINVAL; 2644 return -EINVAL;
2645 return 0; 2645 return 0;
2646 } 2646 }
2647 2647