소스 검색

Correct symbol violations reported by "make symcheck"

tags/v0.9.3
Michael Brown 20 년 전
부모
커밋
a1f50f27b0
2개의 변경된 파일27개의 추가작업 그리고 21개의 파일을 삭제
  1. 10
    8
      src/drivers/net/sundance.c
  2. 17
    13
      src/drivers/net/tg3.c

+ 10
- 8
src/drivers/net/sundance.c 파일 보기

48
 #include "pci.h"
48
 #include "pci.h"
49
 #include "timer.h"
49
 #include "timer.h"
50
 #include "mii.h"
50
 #include "mii.h"
51
+#include "shared.h"
51
 
52
 
52
 #define drv_version "v1.12"
53
 #define drv_version "v1.12"
53
 #define drv_date "2004-03-21"
54
 #define drv_date "2004-03-21"
248
 /* Define the TX Descriptor */
249
 /* Define the TX Descriptor */
249
 static struct netdev_desc tx_ring[TX_RING_SIZE];
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
 /* Define the RX Descriptor */
252
 /* Define the RX Descriptor */
256
 static struct netdev_desc rx_ring[RX_RING_SIZE];
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
    All descriptors point to a part of this buffer */
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
 /* FIXME: Move BASE to the private structure */
264
 /* FIXME: Move BASE to the private structure */
263
 static u32 BASE;
265
 static u32 BASE;
273
 #define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_IO  | PCI_ADDR0)
275
 #define PCI_IOTYPE (PCI_USES_MASTER | PCI_USES_IO  | PCI_ADDR0)
274
 
276
 
275
 #define MII_CNT		4
277
 #define MII_CNT		4
276
-struct sundance_private {
278
+static struct sundance_private {
277
 	const char *nic_name;
279
 	const char *nic_name;
278
 	/* Frequently used values */
280
 	/* Frequently used values */
279
 
281
 
440
 /**************************************************************************
442
 /**************************************************************************
441
 IRQ - Wait for a frame
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
         unsigned int intr_status;
446
         unsigned int intr_status;
445
 
447
 
446
 	switch ( action ) {
448
 	switch ( action ) {

+ 17
- 13
src/drivers/net/tg3.c 파일 보기

16
 #include "pci.h"
16
 #include "pci.h"
17
 #include "timer.h"
17
 #include "timer.h"
18
 #include "string.h"
18
 #include "string.h"
19
+#include "shared.h"
19
 #include "tg3.h"
20
 #include "tg3.h"
20
 
21
 
21
 #define SUPPORT_COPPER_PHY  1
22
 #define SUPPORT_COPPER_PHY  1
24
 #define SUPPORT_PARTNO_STR  1
25
 #define SUPPORT_PARTNO_STR  1
25
 #define SUPPORT_PHY_STR     1
26
 #define SUPPORT_PHY_STR     1
26
 
27
 
27
-struct tg3 tg3;
28
+static struct tg3 tg3;
28
 
29
 
29
 /* Dummy defines for error handling */
30
 /* Dummy defines for error handling */
30
 #define EBUSY  1
31
 #define EBUSY  1
55
 
56
 
56
 #define RX_PKT_BUF_SZ		(1536 + 2 + 64)
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
 	struct tg3_rx_buffer_desc rx_std[TG3_RX_RING_SIZE];
67
 	struct tg3_rx_buffer_desc rx_std[TG3_RX_RING_SIZE];
61
 	struct tg3_rx_buffer_desc rx_rcb[TG3_RX_RCB_RING_SIZE];
68
 	struct tg3_rx_buffer_desc rx_rcb[TG3_RX_RCB_RING_SIZE];
62
 	struct tg3_tx_buffer_desc tx_ring[TG3_TX_RING_SIZE];
69
 	struct tg3_tx_buffer_desc tx_ring[TG3_TX_RING_SIZE];
63
 	struct tg3_hw_status      hw_status;
70
 	struct tg3_hw_status      hw_status;
64
 	struct tg3_hw_stats       hw_stats;
71
 	struct tg3_hw_stats       hw_stats;
65
 	unsigned char             rx_bufs[TG3_DEF_RX_RING_PENDING][RX_PKT_BUF_SZ];
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
  * pci_save_state - save the PCI configuration space of a device before suspending
77
  * pci_save_state - save the PCI configuration space of a device before suspending
3126
 static void tg3_transmit(struct nic *nic, const char *dst_addr,
3134
 static void tg3_transmit(struct nic *nic, const char *dst_addr,
3127
 	unsigned int type, unsigned int size, const char *packet)
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
 	static int frame_idx;
3137
 	static int frame_idx;
3138
+	struct eth_frame *frame;
3136
 	
3139
 	
3137
 	/* send the packet to destination */
3140
 	/* send the packet to destination */
3138
 	struct tg3_tx_buffer_desc *txd;
3141
 	struct tg3_tx_buffer_desc *txd;
3160
 	}
3163
 	}
3161
 	
3164
 	
3162
 	/* Copy the packet to the our local buffer */
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
 	frame[frame_idx].type = htons(type);
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
 	/* Setup the ring buffer entry to transmit */
3173
 	/* Setup the ring buffer entry to transmit */
3170
 	txd            = &tp->tx_ring[entry];
3174
 	txd            = &tp->tx_ring[entry];

Loading…
취소
저장