Browse Source

Move tulip_private structure into shared data.

tags/v0.9.3
Michael Brown 19 years ago
parent
commit
24c0498cbc
1 changed files with 20 additions and 19 deletions
  1. 20
    19
      src/drivers/net/tulip.c

+ 20
- 19
src/drivers/net/tulip.c View File

396
 
396
 
397
 static u32 ioaddr;
397
 static u32 ioaddr;
398
 
398
 
399
-/* Note: transmit and receive buffers must be longword aligned and
400
-   longword divisable */
401
-
402
-#define TX_RING_SIZE	2
403
-#define RX_RING_SIZE	4
404
-struct {
405
-    struct tulip_tx_desc tx_ring[TX_RING_SIZE];
406
-    unsigned char txb[BUFLEN];
407
-    struct tulip_rx_desc rx_ring[RX_RING_SIZE];
408
-    unsigned char rxb[RX_RING_SIZE * BUFLEN];
409
-} tulip_buffers __shared __attribute__ ((aligned(4)));
410
-#define tx_ring tulip_buffers.tx_ring
411
-#define txb tulip_buffers.txb
412
-#define rx_ring tulip_buffers.rx_ring
413
-#define rxb tulip_buffers.rxb
414
-
415
-static struct tulip_private {
399
+struct tulip_private {
416
     int cur_rx;
400
     int cur_rx;
417
     int chip_id;                        /* index into tulip_tbl[]  */
401
     int chip_id;                        /* index into tulip_tbl[]  */
418
     int pci_id_idx;                     /* index into pci_id_tbl[] */
402
     int pci_id_idx;                     /* index into pci_id_tbl[] */
439
     signed char phys[4], mii_cnt;       /* MII device addresses. */
423
     signed char phys[4], mii_cnt;       /* MII device addresses. */
440
     int cur_index;                      /* Current media index. */
424
     int cur_index;                      /* Current media index. */
441
     int saved_if_port;
425
     int saved_if_port;
442
-} tpx;
426
+};
427
+
428
+/* Note: transmit and receive buffers must be longword aligned and
429
+   longword divisable */
430
+
431
+#define TX_RING_SIZE	2
432
+#define RX_RING_SIZE	4
433
+struct {
434
+    struct tulip_tx_desc tx_ring[TX_RING_SIZE];
435
+    unsigned char txb[BUFLEN];
436
+    struct tulip_rx_desc rx_ring[RX_RING_SIZE];
437
+    unsigned char rxb[RX_RING_SIZE * BUFLEN];
438
+    struct tulip_private tpx;
439
+} tulip_bss __shared __attribute__ ((aligned(4)));
440
+#define tx_ring tulip_bss.tx_ring
441
+#define txb tulip_bss.txb
442
+#define rx_ring tulip_bss.rx_ring
443
+#define rxb tulip_bss.rxb
443
 
444
 
444
 static struct tulip_private *tp;
445
 static struct tulip_private *tp;
445
 
446
 
1248
     nic->irqno     = 0;
1249
     nic->irqno     = 0;
1249
 
1250
 
1250
     /* point to private storage */
1251
     /* point to private storage */
1251
-    tp = &tpx;
1252
+    tp = &tulip_bss.tpx;
1252
 
1253
 
1253
     tp->vendor_id  = pci->vendor_id;
1254
     tp->vendor_id  = pci->vendor_id;
1254
     tp->dev_id     = pci->device_id;
1255
     tp->dev_id     = pci->device_id;

Loading…
Cancel
Save