Browse Source

Correct symbol violations reported by "make symcheck"

tags/v0.9.3
Michael Brown 20 years ago
parent
commit
a1f50f27b0
2 changed files with 27 additions and 21 deletions
  1. 10
    8
      src/drivers/net/sundance.c
  2. 17
    13
      src/drivers/net/tg3.c

+ 10
- 8
src/drivers/net/sundance.c View File

@@ -48,6 +48,7 @@
48 48
 #include "pci.h"
49 49
 #include "timer.h"
50 50
 #include "mii.h"
51
+#include "shared.h"
51 52
 
52 53
 #define drv_version "v1.12"
53 54
 #define drv_date "2004-03-21"
@@ -248,16 +249,17 @@ enum desc_status_bits {
248 249
 /* Define the TX Descriptor */
249 250
 static struct netdev_desc tx_ring[TX_RING_SIZE];
250 251
 
251
-/* Create a static buffer of size PKT_BUF_SZ for each TX Descriptor.
252
-  All descriptors point to a part of this buffer */
253
-static unsigned char txb[PKT_BUF_SZ * TX_RING_SIZE];
254
-
255 252
 /* Define the RX Descriptor */
256 253
 static struct netdev_desc rx_ring[RX_RING_SIZE];
257 254
 
258
-/* Create a static buffer of size PKT_BUF_SZ for each RX Descriptor.
255
+/* Create a static buffer of size PKT_BUF_SZ for each RX and TX descriptor.
259 256
    All descriptors point to a part of this buffer */
260
-static unsigned char rxb[RX_RING_SIZE * PKT_BUF_SZ];
257
+struct {
258
+	unsigned char txb[PKT_BUF_SZ * TX_RING_SIZE];
259
+	unsigned char rxb[RX_RING_SIZE * PKT_BUF_SZ];
260
+} rx_tx_buf __shared;
261
+#define rxb rx_tx_buf.rxb
262
+#define txb rx_tx_buf.txb
261 263
 
262 264
 /* FIXME: Move BASE to the private structure */
263 265
 static u32 BASE;
@@ -273,7 +275,7 @@ enum chip_capability_flags { CanHaveMII = 1, KendinPktDropBug = 2, };
273 275
 #define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_IO  | PCI_ADDR0)
274 276
 
275 277
 #define MII_CNT		4
276
-struct sundance_private {
278
+static struct sundance_private {
277 279
 	const char *nic_name;
278 280
 	/* Frequently used values */
279 281
 
@@ -440,7 +442,7 @@ static void sundance_reset(struct nic *nic)
440 442
 /**************************************************************************
441 443
 IRQ - Wait for a frame
442 444
 ***************************************************************************/
443
-void sundance_irq ( struct nic *nic, irq_action_t action ) {
445
+static void sundance_irq ( struct nic *nic, irq_action_t action ) {
444 446
         unsigned int intr_status;
445 447
 
446 448
 	switch ( action ) {

+ 17
- 13
src/drivers/net/tg3.c View File

@@ -16,6 +16,7 @@
16 16
 #include "pci.h"
17 17
 #include "timer.h"
18 18
 #include "string.h"
19
+#include "shared.h"
19 20
 #include "tg3.h"
20 21
 
21 22
 #define SUPPORT_COPPER_PHY  1
@@ -24,7 +25,7 @@
24 25
 #define SUPPORT_PARTNO_STR  1
25 26
 #define SUPPORT_PHY_STR     1
26 27
 
27
-struct tg3 tg3;
28
+static struct tg3 tg3;
28 29
 
29 30
 /* Dummy defines for error handling */
30 31
 #define EBUSY  1
@@ -55,15 +56,22 @@ struct tg3 tg3;
55 56
 
56 57
 #define RX_PKT_BUF_SZ		(1536 + 2 + 64)
57 58
 
59
+struct eth_frame {
60
+	uint8_t  dst_addr[ETH_ALEN];
61
+	uint8_t  src_addr[ETH_ALEN];
62
+	uint16_t type;
63
+	uint8_t  data [ETH_FRAME_LEN - ETH_HLEN];
64
+};
58 65
 
59
-static struct bss {
66
+struct bss {
60 67
 	struct tg3_rx_buffer_desc rx_std[TG3_RX_RING_SIZE];
61 68
 	struct tg3_rx_buffer_desc rx_rcb[TG3_RX_RCB_RING_SIZE];
62 69
 	struct tg3_tx_buffer_desc tx_ring[TG3_TX_RING_SIZE];
63 70
 	struct tg3_hw_status      hw_status;
64 71
 	struct tg3_hw_stats       hw_stats;
65 72
 	unsigned char             rx_bufs[TG3_DEF_RX_RING_PENDING][RX_PKT_BUF_SZ];
66
-} tg3_bss;
73
+	struct eth_frame	  tx_frame[2];
74
+} tg3_bss __shared;
67 75
 
68 76
 /**
69 77
  * pci_save_state - save the PCI configuration space of a device before suspending
@@ -3126,13 +3134,8 @@ static void tg3_set_txd(struct tg3 *tp, int entry,
3126 3134
 static void tg3_transmit(struct nic *nic, const char *dst_addr,
3127 3135
 	unsigned int type, unsigned int size, const char *packet)
3128 3136
 {
3129
-	static struct eth_frame {
3130
-		uint8_t  dst_addr[ETH_ALEN];
3131
-		uint8_t  src_addr[ETH_ALEN];
3132
-		uint16_t type;
3133
-		uint8_t  data [ETH_FRAME_LEN - ETH_HLEN];
3134
-	} frame[2];
3135 3137
 	static int frame_idx;
3138
+	struct eth_frame *frame;
3136 3139
 	
3137 3140
 	/* send the packet to destination */
3138 3141
 	struct tg3_tx_buffer_desc *txd;
@@ -3160,11 +3163,12 @@ static void tg3_transmit(struct nic *nic, const char *dst_addr,
3160 3163
 	}
3161 3164
 	
3162 3165
 	/* Copy the packet to the our local buffer */
3163
-	memcpy(&frame[frame_idx].dst_addr, dst_addr, ETH_ALEN);
3164
-	memcpy(&frame[frame_idx].src_addr, nic->node_addr, ETH_ALEN);
3166
+	frame = &tg3_bss.tx_frame[frame_idx];
3167
+	memcpy(frame[frame_idx].dst_addr, dst_addr, ETH_ALEN);
3168
+	memcpy(frame[frame_idx].src_addr, nic->node_addr, ETH_ALEN);
3165 3169
 	frame[frame_idx].type = htons(type);
3166
-	memset(&frame[frame_idx].data, 0, sizeof(frame[frame_idx].data));
3167
-	memcpy(&frame[frame_idx].data, packet, size);
3170
+	memset(frame[frame_idx].data, 0, sizeof(frame[frame_idx].data));
3171
+	memcpy(frame[frame_idx].data, packet, size);
3168 3172
 
3169 3173
 	/* Setup the ring buffer entry to transmit */
3170 3174
 	txd            = &tp->tx_ring[entry];

Loading…
Cancel
Save