|
@@ -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];
|