12
12
Copyright (C) 1999 David A. Hinds -- [email protected]
13
13
14
14
pcnet_cs.c 1.153 2003/11/09 18:53:09
15
-
15
+
16
16
The network driver code is based on Donald Becker's NE2000 code:
17
17
18
18
Written 1992,1993 by Donald Becker.
@@ -146,7 +146,7 @@ typedef struct hw_info_t {
146
146
#define MII_PHYID_REG2 0x03
147
147
148
148
static hw_info_t hw_info [] = {
149
- { /* Accton EN2212 */ 0x0ff0 , 0x00 , 0x00 , 0xe8 , DELAY_OUTPUT },
149
+ { /* Accton EN2212 */ 0x0ff0 , 0x00 , 0x00 , 0xe8 , DELAY_OUTPUT },
150
150
{ /* Allied Telesis LA-PCM */ 0x0ff0 , 0x00 , 0x00 , 0xf4 , 0 },
151
151
{ /* APEX MultiCard */ 0x03f4 , 0x00 , 0x20 , 0xe5 , 0 },
152
152
{ /* ASANTE FriendlyNet */ 0x4910 , 0x00 , 0x00 , 0x94 ,
@@ -193,7 +193,7 @@ static hw_info_t hw_info[] = {
193
193
{ /* NE2000 Compatible */ 0x0ff0 , 0x00 , 0xa0 , 0x0c , 0 },
194
194
{ /* Network General Sniffer */ 0x0ff0 , 0x00 , 0x00 , 0x65 ,
195
195
HAS_MISC_REG | HAS_IBM_MISC },
196
- { /* Panasonic VEL211 */ 0x0ff0 , 0x00 , 0x80 , 0x45 ,
196
+ { /* Panasonic VEL211 */ 0x0ff0 , 0x00 , 0x80 , 0x45 ,
197
197
HAS_MISC_REG | HAS_IBM_MISC },
198
198
{ /* PreMax PE-200 */ 0x07f0 , 0x00 , 0x20 , 0xe0 , 0 },
199
199
{ /* RPTI EP400 */ 0x0110 , 0x00 , 0x40 , 0x95 , 0 },
@@ -330,7 +330,7 @@ static hw_info_t *get_hwinfo(struct pcmcia_device *link)
330
330
for (j = 0 ; j < 6 ; j ++ )
331
331
dev -> dev_addr [j ] = readb (base + (j <<1 ));
332
332
}
333
-
333
+
334
334
iounmap (virt );
335
335
j = pcmcia_release_window (link -> win );
336
336
if (j != CS_SUCCESS )
@@ -490,7 +490,7 @@ static int try_io_port(struct pcmcia_device *link)
490
490
if (link -> io .NumPorts2 > 0 ) {
491
491
/* for master/slave multifunction cards */
492
492
link -> io .Attributes2 = IO_DATA_PATH_WIDTH_8 ;
493
- link -> irq .Attributes =
493
+ link -> irq .Attributes =
494
494
IRQ_TYPE_DYNAMIC_SHARING |IRQ_FIRST_SHARED ;
495
495
}
496
496
} else {
@@ -543,19 +543,19 @@ static int pcnet_config(struct pcmcia_device *link)
543
543
manfid = le16_to_cpu (buf [0 ]);
544
544
prodid = le16_to_cpu (buf [1 ]);
545
545
}
546
-
546
+
547
547
tuple .DesiredTuple = CISTPL_CFTABLE_ENTRY ;
548
548
tuple .Attributes = 0 ;
549
549
CS_CHECK (GetFirstTuple , pcmcia_get_first_tuple (link , & tuple ));
550
550
while (last_ret == CS_SUCCESS ) {
551
551
cistpl_cftable_entry_t * cfg = & (parse .cftable_entry );
552
552
cistpl_io_t * io = & (parse .cftable_entry .io );
553
-
553
+
554
554
if (pcmcia_get_tuple_data (link , & tuple ) != 0 ||
555
555
pcmcia_parse_tuple (link , & tuple , & parse ) != 0 ||
556
556
cfg -> index == 0 || cfg -> io .nwin == 0 )
557
557
goto next_entry ;
558
-
558
+
559
559
link -> conf .ConfigIndex = cfg -> index ;
560
560
/* For multifunction cards, by convention, we configure the
561
561
network function with window 0, and serial with window 1 */
@@ -584,15 +584,15 @@ static int pcnet_config(struct pcmcia_device *link)
584
584
}
585
585
586
586
CS_CHECK (RequestIRQ , pcmcia_request_irq (link , & link -> irq ));
587
-
587
+
588
588
if (link -> io .NumPorts2 == 8 ) {
589
589
link -> conf .Attributes |= CONF_ENABLE_SPKR ;
590
590
link -> conf .Status = CCSR_AUDIO_ENA ;
591
591
}
592
592
if ((manfid == MANFID_IBM ) &&
593
593
(prodid == PRODID_IBM_HOME_AND_AWAY ))
594
594
link -> conf .ConfigIndex |= 0x10 ;
595
-
595
+
596
596
CS_CHECK (RequestConfiguration , pcmcia_request_configuration (link , & link -> conf ));
597
597
dev -> irq = link -> irq .AssignedIRQ ;
598
598
dev -> base_addr = link -> io .BasePort1 ;
@@ -614,7 +614,7 @@ static int pcnet_config(struct pcmcia_device *link)
614
614
hw_info = get_ax88190 (link );
615
615
if (hw_info == NULL )
616
616
hw_info = get_hwired (link );
617
-
617
+
618
618
if (hw_info == NULL ) {
619
619
printk (KERN_NOTICE "pcnet_cs: unable to read hardware net"
620
620
" address for io base %#3lx\n" , dev -> base_addr );
@@ -631,7 +631,7 @@ static int pcnet_config(struct pcmcia_device *link)
631
631
info -> flags &= ~USE_BIG_BUF ;
632
632
if (!use_big_buf )
633
633
info -> flags &= ~USE_BIG_BUF ;
634
-
634
+
635
635
if (info -> flags & USE_BIG_BUF ) {
636
636
start_pg = SOCKET_START_PG ;
637
637
stop_pg = SOCKET_STOP_PG ;
@@ -929,7 +929,7 @@ static void set_misc_reg(struct net_device *dev)
929
929
kio_addr_t nic_base = dev -> base_addr ;
930
930
pcnet_dev_t * info = PRIV (dev );
931
931
u_char tmp ;
932
-
932
+
933
933
if (info -> flags & HAS_MISC_REG ) {
934
934
tmp = inb_p (nic_base + PCNET_MISC ) & ~3 ;
935
935
if (dev -> if_port == 2 )
@@ -1022,7 +1022,7 @@ static int pcnet_close(struct net_device *dev)
1022
1022
1023
1023
ei_close (dev );
1024
1024
free_irq (dev -> irq , dev );
1025
-
1025
+
1026
1026
link -> open -- ;
1027
1027
netif_stop_queue (dev );
1028
1028
del_timer_sync (& info -> watchdog );
@@ -1054,12 +1054,12 @@ static void pcnet_reset_8390(struct net_device *dev)
1054
1054
udelay (100 );
1055
1055
}
1056
1056
outb_p (ENISR_RESET , nic_base + EN0_ISR ); /* Ack intr. */
1057
-
1057
+
1058
1058
if (i == 100 )
1059
1059
printk (KERN_ERR "%s: pcnet_reset_8390() did not complete.\n" ,
1060
1060
dev -> name );
1061
1061
set_misc_reg (dev );
1062
-
1062
+
1063
1063
} /* pcnet_reset_8390 */
1064
1064
1065
1065
/*====================================================================*/
@@ -1233,7 +1233,7 @@ static void dma_get_8390_hdr(struct net_device *dev,
1233
1233
dev -> name , ei_status .dmaing , ei_status .irqlock );
1234
1234
return ;
1235
1235
}
1236
-
1236
+
1237
1237
ei_status .dmaing |= 0x01 ;
1238
1238
outb_p (E8390_NODMA + E8390_PAGE0 + E8390_START , nic_base + PCNET_CMD );
1239
1239
outb_p (sizeof (struct e8390_pkt_hdr ), nic_base + EN0_RCNTLO );
@@ -1458,7 +1458,7 @@ static void shmem_get_8390_hdr(struct net_device *dev,
1458
1458
void __iomem * xfer_start = ei_status .mem + (TX_PAGES <<8 )
1459
1459
+ (ring_page << 8 )
1460
1460
- (ei_status .rx_start_page << 8 );
1461
-
1461
+
1462
1462
copyin (hdr , xfer_start , sizeof (struct e8390_pkt_hdr ));
1463
1463
/* Fix for big endian systems */
1464
1464
hdr -> count = le16_to_cpu (hdr -> count );
@@ -1473,7 +1473,7 @@ static void shmem_block_input(struct net_device *dev, int count,
1473
1473
unsigned long offset = (TX_PAGES <<8 ) + ring_offset
1474
1474
- (ei_status .rx_start_page << 8 );
1475
1475
char * buf = skb -> data ;
1476
-
1476
+
1477
1477
if (offset + count > ei_status .priv ) {
1478
1478
/* We must wrap the input move. */
1479
1479
int semi_count = ei_status .priv - offset ;
@@ -1541,7 +1541,7 @@ static int setup_shmem_window(struct pcmcia_device *link, int start_pg,
1541
1541
info -> base = NULL ; link -> win = NULL ;
1542
1542
goto failed ;
1543
1543
}
1544
-
1544
+
1545
1545
ei_status .mem = info -> base + offset ;
1546
1546
ei_status .priv = req .Size ;
1547
1547
dev -> mem_start = (u_long )ei_status .mem ;
@@ -1768,7 +1768,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
1768
1768
PCMCIA_DEVICE_CIS_PROD_ID12 ("NDC" , "Ethernet" , 0x01c43ae1 , 0x00b2e941 , "NE2K.cis" ),
1769
1769
PCMCIA_DEVICE_CIS_PROD_ID12 ("PMX " , "PE-200" , 0x34f3f1c8 , 0x10b59f8c , "PE-200.cis" ),
1770
1770
PCMCIA_DEVICE_CIS_PROD_ID12 ("TAMARACK" , "Ethernet" , 0xcf434fba , 0x00b2e941 , "tamarack.cis" ),
1771
- PCMCIA_DEVICE_PROD_ID123 ("Fast Ethernet" , "CF Size PC Card" , "1.0" ,
1771
+ PCMCIA_DEVICE_PROD_ID123 ("Fast Ethernet" , "CF Size PC Card" , "1.0" ,
1772
1772
0xb4be14e3 , 0x43ac239b , 0x0877b627 ),
1773
1773
PCMCIA_DEVICE_NULL
1774
1774
};
0 commit comments