Browse Source

Use shared symbols to save space

tags/v0.9.3
Michael Brown 20 years ago
parent
commit
3267ca5568
1 changed files with 13 additions and 10 deletions
  1. 13
    10
      src/drivers/net/w89c840.c

+ 13
- 10
src/drivers/net/w89c840.c View File

258
 
258
 
259
 static int ioaddr;
259
 static int ioaddr;
260
 static unsigned short eeprom [0x40];
260
 static unsigned short eeprom [0x40];
261
-static char        rx_packet[PKT_BUF_SZ * RX_RING_SIZE];
262
-static char        tx_packet[PKT_BUF_SZ * TX_RING_SIZE];
261
+struct {
262
+	char        rx_packet[PKT_BUF_SZ * RX_RING_SIZE];
263
+	char        tx_packet[PKT_BUF_SZ * TX_RING_SIZE];
264
+} w89c840_buf __shared;
263
 
265
 
264
 static int  eeprom_read(long ioaddr, int location);
266
 static int  eeprom_read(long ioaddr, int location);
265
 static int  mdio_read(int base_address, int phy_id, int location);
267
 static int  mdio_read(int base_address, int phy_id, int location);
498
     /* Fill in our transmit buffer */
500
     /* Fill in our transmit buffer */
499
     entry = w840private.cur_tx % TX_RING_SIZE;
501
     entry = w840private.cur_tx % TX_RING_SIZE;
500
 
502
 
501
-    memcpy (tx_packet, d, ETH_ALEN);    /* dst */
502
-    memcpy (tx_packet + ETH_ALEN, nic->node_addr, ETH_ALEN);/* src */
503
+    memcpy (w89c840_buf.tx_packet, d, ETH_ALEN);    /* dst */
504
+    memcpy (w89c840_buf.tx_packet + ETH_ALEN, nic->node_addr, ETH_ALEN);/*src*/
503
 
505
 
504
-    *((char *) tx_packet + 12) = t >> 8;    /* type */
505
-    *((char *) tx_packet + 13) = t;
506
+    *((char *) w89c840_buf.tx_packet + 12) = t >> 8;    /* type */
507
+    *((char *) w89c840_buf.tx_packet + 13) = t;
506
 
508
 
507
-    memcpy (tx_packet + ETH_HLEN, p, s);
509
+    memcpy (w89c840_buf.tx_packet + ETH_HLEN, p, s);
508
     s += ETH_HLEN;
510
     s += ETH_HLEN;
509
 
511
 
510
     while (s < ETH_ZLEN)
512
     while (s < ETH_ZLEN)
511
-    *((char *) tx_packet + ETH_HLEN + (s++)) = 0;
513
+    *((char *) w89c840_buf.tx_packet + ETH_HLEN + (s++)) = 0;
512
 
514
 
513
-    w840private.tx_ring[entry].buffer1 = virt_to_le32desc(tx_packet);
515
+    w840private.tx_ring[entry].buffer1
516
+	    = virt_to_le32desc(w89c840_buf.tx_packet);
514
 
517
 
515
     w840private.tx_ring[entry].length = (DescWholePkt | (u32) s);
518
     w840private.tx_ring[entry].length = (DescWholePkt | (u32) s);
516
     if (entry >= TX_RING_SIZE-1)         /* Wrap ring */
519
     if (entry >= TX_RING_SIZE-1)         /* Wrap ring */
930
 
933
 
931
     /* Initial all Rx descriptors. Fill in the Rx buffers. */
934
     /* Initial all Rx descriptors. Fill in the Rx buffers. */
932
 
935
 
933
-    p = &rx_packet[0];
936
+    p = &w89c840_buf.rx_packet[0];
934
 
937
 
935
     for (i = 0; i < RX_RING_SIZE; i++) {
938
     for (i = 0; i < RX_RING_SIZE; i++) {
936
         w840private.rx_ring[i].length = w840private.rx_buf_sz;
939
         w840private.rx_ring[i].length = w840private.rx_buf_sz;

Loading…
Cancel
Save