Skip to content

Commit 9cbc94e

Browse files
committed
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/vmxnet3/vmxnet3_ethtool.c net/core/dev.c
2 parents 1d1652c + 7cc31a9 commit 9cbc94e

26 files changed

Lines changed: 173 additions & 94 deletions

File tree

‎drivers/net/Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ obj-$(CONFIG_NE3210) += ne3210.o 8390.o
144144
obj-$(CONFIG_SB1250_MAC) += sb1250-mac.o
145145
obj-$(CONFIG_B44) += b44.o
146146
obj-$(CONFIG_FORCEDETH) += forcedeth.o
147-
obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
147+
obj-$(CONFIG_NE_H8300) += ne-h8300.o
148148
obj-$(CONFIG_AX88796) += ax88796.o
149149
obj-$(CONFIG_BCM63XX_ENET) += bcm63xx_enet.o
150150
obj-$(CONFIG_FTMAC100) += ftmac100.o
@@ -219,7 +219,7 @@ obj-$(CONFIG_SC92031) += sc92031.o
219219
obj-$(CONFIG_LP486E) += lp486e.o
220220

221221
obj-$(CONFIG_ETH16I) += eth16i.o
222-
obj-$(CONFIG_ZORRO8390) += zorro8390.o 8390.o
222+
obj-$(CONFIG_ZORRO8390) += zorro8390.o
223223
obj-$(CONFIG_HPLANCE) += hplance.o 7990.o
224224
obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
225225
obj-$(CONFIG_EQUALIZER) += eql.o
@@ -231,7 +231,7 @@ obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
231231
obj-$(CONFIG_DECLANCE) += declance.o
232232
obj-$(CONFIG_ATARILANCE) += atarilance.o
233233
obj-$(CONFIG_A2065) += a2065.o
234-
obj-$(CONFIG_HYDRA) += hydra.o 8390.o
234+
obj-$(CONFIG_HYDRA) += hydra.o
235235
obj-$(CONFIG_ARIADNE) += ariadne.o
236236
obj-$(CONFIG_CS89x0) += cs89x0.o
237237
obj-$(CONFIG_MACSONIC) += macsonic.o

‎drivers/net/bonding/bond_3ad.h‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
typedef struct mac_addr {
4141
u8 mac_addr_value[ETH_ALEN];
42-
} mac_addr_t;
42+
} __packed mac_addr_t;
4343

4444
enum {
4545
BOND_AD_STABLE = 0,
@@ -134,12 +134,12 @@ typedef struct lacpdu {
134134
u8 tlv_type_terminator; // = terminator
135135
u8 terminator_length; // = 0
136136
u8 reserved_50[50]; // = 0
137-
} lacpdu_t;
137+
} __packed lacpdu_t;
138138

139139
typedef struct lacpdu_header {
140140
struct ethhdr hdr;
141141
struct lacpdu lacpdu;
142-
} lacpdu_header_t;
142+
} __packed lacpdu_header_t;
143143

144144
// Marker Protocol Data Unit(PDU) structure(43.5.3.2 in the 802.3ad standard)
145145
typedef struct bond_marker {
@@ -155,12 +155,12 @@ typedef struct bond_marker {
155155
u8 tlv_type_terminator; // = 0x00
156156
u8 terminator_length; // = 0x00
157157
u8 reserved_90[90]; // = 0
158-
} bond_marker_t;
158+
} __packed bond_marker_t;
159159

160160
typedef struct bond_marker_header {
161161
struct ethhdr hdr;
162162
struct bond_marker marker;
163-
} bond_marker_header_t;
163+
} __packed bond_marker_header_t;
164164

165165
#pragma pack()
166166

‎drivers/net/ehea/ehea_main.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,9 +2688,6 @@ static int ehea_open(struct net_device *dev)
26882688
netif_start_queue(dev);
26892689
}
26902690

2691-
init_waitqueue_head(&port->swqe_avail_wq);
2692-
init_waitqueue_head(&port->restart_wq);
2693-
26942691
mutex_unlock(&port->port_lock);
26952692

26962693
return ret;
@@ -3278,6 +3275,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
32783275

32793276
INIT_WORK(&port->reset_task, ehea_reset_port);
32803277

3278+
init_waitqueue_head(&port->swqe_avail_wq);
3279+
init_waitqueue_head(&port->restart_wq);
3280+
32813281
ret = register_netdev(dev);
32823282
if (ret) {
32833283
pr_err("register_netdev failed. ret=%d\n", ret);

‎drivers/net/hydra.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ static const struct net_device_ops hydra_netdev_ops = {
9898
.ndo_open = hydra_open,
9999
.ndo_stop = hydra_close,
100100

101-
.ndo_start_xmit = ei_start_xmit,
102-
.ndo_tx_timeout = ei_tx_timeout,
103-
.ndo_get_stats = ei_get_stats,
104-
.ndo_set_multicast_list = ei_set_multicast_list,
101+
.ndo_start_xmit = __ei_start_xmit,
102+
.ndo_tx_timeout = __ei_tx_timeout,
103+
.ndo_get_stats = __ei_get_stats,
104+
.ndo_set_multicast_list = __ei_set_multicast_list,
105105
.ndo_validate_addr = eth_validate_addr,
106-
.ndo_set_mac_address = eth_mac_addr,
106+
.ndo_set_mac_address = eth_mac_addr,
107107
.ndo_change_mtu = eth_change_mtu,
108108
#ifdef CONFIG_NET_POLL_CONTROLLER
109-
.ndo_poll_controller = ei_poll,
109+
.ndo_poll_controller = __ei_poll,
110110
#endif
111111
};
112112

@@ -125,7 +125,7 @@ static int __devinit hydra_init(struct zorro_dev *z)
125125
0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
126126
};
127127

128-
dev = alloc_ei_netdev();
128+
dev = ____alloc_ei_netdev(0);
129129
if (!dev)
130130
return -ENOMEM;
131131

‎drivers/net/ne-h8300.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static void cleanup_card(struct net_device *dev)
167167
#ifndef MODULE
168168
struct net_device * __init ne_probe(int unit)
169169
{
170-
struct net_device *dev = alloc_ei_netdev();
170+
struct net_device *dev = ____alloc_ei_netdev(0);
171171
int err;
172172

173173
if (!dev)
@@ -197,15 +197,15 @@ static const struct net_device_ops ne_netdev_ops = {
197197
.ndo_open = ne_open,
198198
.ndo_stop = ne_close,
199199

200-
.ndo_start_xmit = ei_start_xmit,
201-
.ndo_tx_timeout = ei_tx_timeout,
202-
.ndo_get_stats = ei_get_stats,
203-
.ndo_set_multicast_list = ei_set_multicast_list,
200+
.ndo_start_xmit = __ei_start_xmit,
201+
.ndo_tx_timeout = __ei_tx_timeout,
202+
.ndo_get_stats = __ei_get_stats,
203+
.ndo_set_multicast_list = __ei_set_multicast_list,
204204
.ndo_validate_addr = eth_validate_addr,
205-
.ndo_set_mac_address = eth_mac_addr,
205+
.ndo_set_mac_address = eth_mac_addr,
206206
.ndo_change_mtu = eth_change_mtu,
207207
#ifdef CONFIG_NET_POLL_CONTROLLER
208-
.ndo_poll_controller = ei_poll,
208+
.ndo_poll_controller = __ei_poll,
209209
#endif
210210
};
211211

@@ -637,7 +637,7 @@ int init_module(void)
637637
int err;
638638

639639
for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
640-
struct net_device *dev = alloc_ei_netdev();
640+
struct net_device *dev = ____alloc_ei_netdev(0);
641641
if (!dev)
642642
break;
643643
if (io[this_dev]) {

‎drivers/net/sfc/mcdi.c‎

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx)
5050
return &nic_data->mcdi;
5151
}
5252

53+
static inline void
54+
efx_mcdi_readd(struct efx_nic *efx, efx_dword_t *value, unsigned reg)
55+
{
56+
struct siena_nic_data *nic_data = efx->nic_data;
57+
value->u32[0] = (__force __le32)__raw_readl(nic_data->mcdi_smem + reg);
58+
}
59+
60+
static inline void
61+
efx_mcdi_writed(struct efx_nic *efx, const efx_dword_t *value, unsigned reg)
62+
{
63+
struct siena_nic_data *nic_data = efx->nic_data;
64+
__raw_writel((__force u32)value->u32[0], nic_data->mcdi_smem + reg);
65+
}
66+
5367
void efx_mcdi_init(struct efx_nic *efx)
5468
{
5569
struct efx_mcdi_iface *mcdi;
@@ -70,8 +84,8 @@ static void efx_mcdi_copyin(struct efx_nic *efx, unsigned cmd,
7084
const u8 *inbuf, size_t inlen)
7185
{
7286
struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
73-
unsigned pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx);
74-
unsigned doorbell = FR_CZ_MC_TREG_SMEM + MCDI_DOORBELL(efx);
87+
unsigned pdu = MCDI_PDU(efx);
88+
unsigned doorbell = MCDI_DOORBELL(efx);
7589
unsigned int i;
7690
efx_dword_t hdr;
7791
u32 xflags, seqno;
@@ -92,38 +106,36 @@ static void efx_mcdi_copyin(struct efx_nic *efx, unsigned cmd,
92106
MCDI_HEADER_SEQ, seqno,
93107
MCDI_HEADER_XFLAGS, xflags);
94108

95-
efx_writed(efx, &hdr, pdu);
109+
efx_mcdi_writed(efx, &hdr, pdu);
96110

97-
for (i = 0; i < inlen; i += 4) {
98-
_efx_writed(efx, *((__le32 *)(inbuf + i)), pdu + 4 + i);
99-
/* use wmb() within loop to inhibit write combining */
100-
wmb();
101-
}
111+
for (i = 0; i < inlen; i += 4)
112+
efx_mcdi_writed(efx, (const efx_dword_t *)(inbuf + i),
113+
pdu + 4 + i);
102114

103115
/* ring the doorbell with a distinctive value */
104-
_efx_writed(efx, (__force __le32) 0x45789abc, doorbell);
105-
wmb();
116+
EFX_POPULATE_DWORD_1(hdr, EFX_DWORD_0, 0x45789abc);
117+
efx_mcdi_writed(efx, &hdr, doorbell);
106118
}
107119

108120
static void efx_mcdi_copyout(struct efx_nic *efx, u8 *outbuf, size_t outlen)
109121
{
110122
struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
111-
unsigned int pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx);
123+
unsigned int pdu = MCDI_PDU(efx);
112124
int i;
113125

114126
BUG_ON(atomic_read(&mcdi->state) == MCDI_STATE_QUIESCENT);
115127
BUG_ON(outlen & 3 || outlen >= 0x100);
116128

117129
for (i = 0; i < outlen; i += 4)
118-
*((__le32 *)(outbuf + i)) = _efx_readd(efx, pdu + 4 + i);
130+
efx_mcdi_readd(efx, (efx_dword_t *)(outbuf + i), pdu + 4 + i);
119131
}
120132

121133
static int efx_mcdi_poll(struct efx_nic *efx)
122134
{
123135
struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
124136
unsigned int time, finish;
125137
unsigned int respseq, respcmd, error;
126-
unsigned int pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx);
138+
unsigned int pdu = MCDI_PDU(efx);
127139
unsigned int rc, spins;
128140
efx_dword_t reg;
129141

@@ -149,8 +161,7 @@ static int efx_mcdi_poll(struct efx_nic *efx)
149161

150162
time = get_seconds();
151163

152-
rmb();
153-
efx_readd(efx, &reg, pdu);
164+
efx_mcdi_readd(efx, &reg, pdu);
154165

155166
/* All 1's indicates that shared memory is in reset (and is
156167
* not a valid header). Wait for it to come out reset before
@@ -177,7 +188,7 @@ static int efx_mcdi_poll(struct efx_nic *efx)
177188
respseq, mcdi->seqno);
178189
rc = EIO;
179190
} else if (error) {
180-
efx_readd(efx, &reg, pdu + 4);
191+
efx_mcdi_readd(efx, &reg, pdu + 4);
181192
switch (EFX_DWORD_FIELD(reg, EFX_DWORD_0)) {
182193
#define TRANSLATE_ERROR(name) \
183194
case MC_CMD_ERR_ ## name: \
@@ -211,21 +222,21 @@ static int efx_mcdi_poll(struct efx_nic *efx)
211222
/* Test and clear MC-rebooted flag for this port/function */
212223
int efx_mcdi_poll_reboot(struct efx_nic *efx)
213224
{
214-
unsigned int addr = FR_CZ_MC_TREG_SMEM + MCDI_REBOOT_FLAG(efx);
225+
unsigned int addr = MCDI_REBOOT_FLAG(efx);
215226
efx_dword_t reg;
216227
uint32_t value;
217228

218229
if (efx_nic_rev(efx) < EFX_REV_SIENA_A0)
219230
return false;
220231

221-
efx_readd(efx, &reg, addr);
232+
efx_mcdi_readd(efx, &reg, addr);
222233
value = EFX_DWORD_FIELD(reg, EFX_DWORD_0);
223234

224235
if (value == 0)
225236
return 0;
226237

227238
EFX_ZERO_DWORD(reg);
228-
efx_writed(efx, &reg, addr);
239+
efx_mcdi_writed(efx, &reg, addr);
229240

230241
if (value == MC_STATUS_DWORD_ASSERT)
231242
return -EINTR;

‎drivers/net/sfc/nic.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,6 +1935,13 @@ void efx_nic_get_regs(struct efx_nic *efx, void *buf)
19351935

19361936
size = min_t(size_t, table->step, 16);
19371937

1938+
if (table->offset >= efx->type->mem_map_size) {
1939+
/* No longer mapped; return dummy data */
1940+
memcpy(buf, "\xde\xc0\xad\xde", 4);
1941+
buf += table->rows * size;
1942+
continue;
1943+
}
1944+
19381945
for (i = 0; i < table->rows; i++) {
19391946
switch (table->step) {
19401947
case 4: /* 32-bit register or SRAM */

‎drivers/net/sfc/nic.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,12 @@ static inline struct falcon_board *falcon_board(struct efx_nic *efx)
143143
/**
144144
* struct siena_nic_data - Siena NIC state
145145
* @mcdi: Management-Controller-to-Driver Interface
146+
* @mcdi_smem: MCDI shared memory mapping. The mapping is always uncacheable.
146147
* @wol_filter_id: Wake-on-LAN packet filter id
147148
*/
148149
struct siena_nic_data {
149150
struct efx_mcdi_iface mcdi;
151+
void __iomem *mcdi_smem;
150152
int wol_filter_id;
151153
};
152154

‎drivers/net/sfc/siena.c‎

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,26 @@ static int siena_probe_nic(struct efx_nic *efx)
220220
efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
221221
efx->net_dev->dev_id = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
222222

223+
/* Initialise MCDI */
224+
nic_data->mcdi_smem = ioremap_nocache(efx->membase_phys +
225+
FR_CZ_MC_TREG_SMEM,
226+
FR_CZ_MC_TREG_SMEM_STEP *
227+
FR_CZ_MC_TREG_SMEM_ROWS);
228+
if (!nic_data->mcdi_smem) {
229+
netif_err(efx, probe, efx->net_dev,
230+
"could not map MCDI at %llx+%x\n",
231+
(unsigned long long)efx->membase_phys +
232+
FR_CZ_MC_TREG_SMEM,
233+
FR_CZ_MC_TREG_SMEM_STEP * FR_CZ_MC_TREG_SMEM_ROWS);
234+
rc = -ENOMEM;
235+
goto fail1;
236+
}
223237
efx_mcdi_init(efx);
224238

225239
/* Recover from a failed assertion before probing */
226240
rc = efx_mcdi_handle_assertion(efx);
227241
if (rc)
228-
goto fail1;
242+
goto fail2;
229243

230244
/* Let the BMC know that the driver is now in charge of link and
231245
* filter settings. We must do this before we reset the NIC */
@@ -280,6 +294,7 @@ static int siena_probe_nic(struct efx_nic *efx)
280294
fail3:
281295
efx_mcdi_drv_attach(efx, false, NULL);
282296
fail2:
297+
iounmap(nic_data->mcdi_smem);
283298
fail1:
284299
kfree(efx->nic_data);
285300
return rc;
@@ -359,6 +374,8 @@ static int siena_init_nic(struct efx_nic *efx)
359374

360375
static void siena_remove_nic(struct efx_nic *efx)
361376
{
377+
struct siena_nic_data *nic_data = efx->nic_data;
378+
362379
efx_nic_free_buffer(efx, &efx->irq_status);
363380

364381
siena_reset_hw(efx, RESET_TYPE_ALL);
@@ -368,7 +385,8 @@ static void siena_remove_nic(struct efx_nic *efx)
368385
efx_mcdi_drv_attach(efx, false, NULL);
369386

370387
/* Tear down the private nic state */
371-
kfree(efx->nic_data);
388+
iounmap(nic_data->mcdi_smem);
389+
kfree(nic_data);
372390
efx->nic_data = NULL;
373391
}
374392

@@ -606,8 +624,7 @@ const struct efx_nic_type siena_a0_nic_type = {
606624
.default_mac_ops = &efx_mcdi_mac_operations,
607625

608626
.revision = EFX_REV_SIENA_A0,
609-
.mem_map_size = (FR_CZ_MC_TREG_SMEM +
610-
FR_CZ_MC_TREG_SMEM_STEP * FR_CZ_MC_TREG_SMEM_ROWS),
627+
.mem_map_size = FR_CZ_MC_TREG_SMEM, /* MC_TREG_SMEM mapped separately */
611628
.txd_ptr_tbl_base = FR_BZ_TX_DESC_PTR_TBL,
612629
.rxd_ptr_tbl_base = FR_BZ_RX_DESC_PTR_TBL,
613630
.buf_tbl_base = FR_BZ_BUF_FULL_TBL,

‎drivers/net/vmxnet3/vmxnet3_ethtool.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ int vmxnet3_set_features(struct net_device *netdev, u32 features)
276276
adapter->shared->devRead.misc.uptFeatures &=
277277
~UPT1_F_RXCSUM;
278278

279+
/* update harware LRO capability accordingly */
279280
if (features & NETIF_F_LRO)
280281
adapter->shared->devRead.misc.uptFeatures |=
281282
UPT1_F_LRO;

0 commit comments

Comments
 (0)