Skip to content

Commit b1cdc46

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (63 commits) drivers/net/usb/asix.c: Fix pointer cast. be2net: Bug fix to avoid disabling bottom half during firmware upgrade. proc_dointvec: write a single value hso: add support for new products Phonet: fix potential use-after-free in pep_sock_close() ath9k: remove VEOL support for ad-hoc ath9k: change beacon allocation to prefer the first beacon slot sock.h: fix kernel-doc warning cls_cgroup: Fix build error when built-in macvlan: do proper cleanup in macvlan_common_newlink() V2 be2net: Bug fix in init code in probe net/dccp: expansion of error code size ath9k: Fix rx of mcast/bcast frames in PS mode with auto sleep wireless: fix sta_info.h kernel-doc warnings wireless: fix mac80211.h kernel-doc warnings iwlwifi: testing the wrong variable in iwl_add_bssid_station() ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs() ath9k_htc: dereferencing before check in hif_usb_tx_cb() rt2x00: Fix rt2800usb TX descriptor writing. rt2x00: Fix failed SLEEP->AWAKE and AWAKE->SLEEP transitions. ...
2 parents ce7d022 + f925b13 commit b1cdc46

75 files changed

Lines changed: 679 additions & 360 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/isdn/capi/kcapi.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,12 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
11471147
if (ctr->state == CAPI_CTR_DETECTED)
11481148
goto reset_unlock_out;
11491149

1150+
if (ctr->reset_ctr == NULL) {
1151+
printk(KERN_DEBUG "kcapi: reset: no reset function\n");
1152+
retval = -ESRCH;
1153+
goto reset_unlock_out;
1154+
}
1155+
11501156
ctr->reset_ctr(ctr);
11511157

11521158
retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);

‎drivers/isdn/gigaset/capi.c‎

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -921,30 +921,6 @@ void gigaset_isdn_stop(struct cardstate *cs)
921921
* ============================
922922
*/
923923

924-
/*
925-
* load firmware
926-
*/
927-
static int gigaset_load_firmware(struct capi_ctr *ctr, capiloaddata *data)
928-
{
929-
struct cardstate *cs = ctr->driverdata;
930-
931-
/* AVM specific operation, not needed for Gigaset -- ignore */
932-
dev_notice(cs->dev, "load_firmware ignored\n");
933-
934-
return 0;
935-
}
936-
937-
/*
938-
* reset (deactivate) controller
939-
*/
940-
static void gigaset_reset_ctr(struct capi_ctr *ctr)
941-
{
942-
struct cardstate *cs = ctr->driverdata;
943-
944-
/* AVM specific operation, not needed for Gigaset -- ignore */
945-
dev_notice(cs->dev, "reset_ctr ignored\n");
946-
}
947-
948924
/*
949925
* register CAPI application
950926
*/
@@ -2202,8 +2178,8 @@ int gigaset_isdn_regdev(struct cardstate *cs, const char *isdnid)
22022178
iif->ctr.driverdata = cs;
22032179
strncpy(iif->ctr.name, isdnid, sizeof(iif->ctr.name));
22042180
iif->ctr.driver_name = "gigaset";
2205-
iif->ctr.load_firmware = gigaset_load_firmware;
2206-
iif->ctr.reset_ctr = gigaset_reset_ctr;
2181+
iif->ctr.load_firmware = NULL;
2182+
iif->ctr.reset_ctr = NULL;
22072183
iif->ctr.register_appl = gigaset_register_appl;
22082184
iif->ctr.release_appl = gigaset_release_appl;
22092185
iif->ctr.send_message = gigaset_send_message;

‎drivers/net/benet/be.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ struct be_adapter {
283283
u8 port_type;
284284
u8 transceiver;
285285
u8 generation; /* BladeEngine ASIC generation */
286+
u32 flash_status;
287+
struct completion flash_compl;
286288

287289
bool sriov_enabled;
288290
u32 vf_if_handle[BE_MAX_VF];

‎drivers/net/benet/be_cmds.c‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
5959

6060
compl_status = (compl->status >> CQE_STATUS_COMPL_SHIFT) &
6161
CQE_STATUS_COMPL_MASK;
62+
63+
if ((compl->tag0 == OPCODE_COMMON_WRITE_FLASHROM) &&
64+
(compl->tag1 == CMD_SUBSYSTEM_COMMON)) {
65+
adapter->flash_status = compl_status;
66+
complete(&adapter->flash_compl);
67+
}
68+
6269
if (compl_status == MCC_STATUS_SUCCESS) {
6370
if (compl->tag0 == OPCODE_ETH_GET_STATISTICS) {
6471
struct be_cmd_resp_get_stats *resp =
@@ -1417,6 +1424,7 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
14171424
int status;
14181425

14191426
spin_lock_bh(&adapter->mcc_lock);
1427+
adapter->flash_status = 0;
14201428

14211429
wrb = wrb_from_mccq(adapter);
14221430
if (!wrb) {
@@ -1428,6 +1436,7 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
14281436

14291437
be_wrb_hdr_prepare(wrb, cmd->size, false, 1,
14301438
OPCODE_COMMON_WRITE_FLASHROM);
1439+
wrb->tag1 = CMD_SUBSYSTEM_COMMON;
14311440

14321441
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
14331442
OPCODE_COMMON_WRITE_FLASHROM, cmd->size);
@@ -1439,10 +1448,16 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
14391448
req->params.op_code = cpu_to_le32(flash_opcode);
14401449
req->params.data_buf_size = cpu_to_le32(buf_size);
14411450

1442-
status = be_mcc_notify_wait(adapter);
1451+
be_mcc_notify(adapter);
1452+
spin_unlock_bh(&adapter->mcc_lock);
1453+
1454+
if (!wait_for_completion_timeout(&adapter->flash_compl,
1455+
msecs_to_jiffies(12000)))
1456+
status = -1;
1457+
else
1458+
status = adapter->flash_status;
14431459

14441460
err:
1445-
spin_unlock_bh(&adapter->mcc_lock);
14461461
return status;
14471462
}
14481463

‎drivers/net/benet/be_main.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,6 +2319,7 @@ static int be_ctrl_init(struct be_adapter *adapter)
23192319
spin_lock_init(&adapter->mcc_lock);
23202320
spin_lock_init(&adapter->mcc_cq_lock);
23212321

2322+
init_completion(&adapter->flash_compl);
23222323
pci_save_state(adapter->pdev);
23232324
return 0;
23242325

@@ -2487,17 +2488,19 @@ static int __devinit be_probe(struct pci_dev *pdev,
24872488
status = be_cmd_POST(adapter);
24882489
if (status)
24892490
goto ctrl_clean;
2490-
2491-
status = be_cmd_reset_function(adapter);
2492-
if (status)
2493-
goto ctrl_clean;
24942491
}
24952492

24962493
/* tell fw we're ready to fire cmds */
24972494
status = be_cmd_fw_init(adapter);
24982495
if (status)
24992496
goto ctrl_clean;
25002497

2498+
if (be_physfn(adapter)) {
2499+
status = be_cmd_reset_function(adapter);
2500+
if (status)
2501+
goto ctrl_clean;
2502+
}
2503+
25012504
status = be_stats_init(adapter);
25022505
if (status)
25032506
goto ctrl_clean;

‎drivers/net/bfin_mac.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,7 @@ static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)
16261626
return 0;
16271627

16281628
out_err_mdiobus_register:
1629+
kfree(miibus->irq);
16291630
mdiobus_free(miibus);
16301631
out_err_alloc:
16311632
peripheral_free_list(pin_req);
@@ -1638,6 +1639,7 @@ static int __devexit bfin_mii_bus_remove(struct platform_device *pdev)
16381639
struct mii_bus *miibus = platform_get_drvdata(pdev);
16391640
platform_set_drvdata(pdev, NULL);
16401641
mdiobus_unregister(miibus);
1642+
kfree(miibus->irq);
16411643
mdiobus_free(miibus);
16421644
peripheral_free_list(pin_req);
16431645
return 0;

‎drivers/net/can/sja1000/sja1000.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,8 @@ struct net_device *alloc_sja1000dev(int sizeof_priv)
599599
priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
600600
CAN_CTRLMODE_BERR_REPORTING;
601601

602+
spin_lock_init(&priv->cmdreg_lock);
603+
602604
if (sizeof_priv)
603605
priv->priv = (void *)priv + sizeof(struct sja1000_priv);
604606

‎drivers/net/enic/enic_main.c‎

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,9 +1034,10 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
10341034
{
10351035
struct vic_provinfo *vp;
10361036
u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
1037-
unsigned short *uuid;
1037+
u8 *uuid;
10381038
char uuid_str[38];
1039-
static char *uuid_fmt = "%04X%04X-%04X-%04X-%04X-%04X%04X%04X";
1039+
static char *uuid_fmt = "%02X%02X%02X%02X-%02X%02X-%02X%02X-"
1040+
"%02X%02X-%02X%02X%02X%02X%0X%02X";
10401041
int err;
10411042

10421043
if (!name)
@@ -1058,20 +1059,24 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
10581059
ETH_ALEN, mac);
10591060

10601061
if (instance_uuid) {
1061-
uuid = (unsigned short *)instance_uuid;
1062+
uuid = instance_uuid;
10621063
sprintf(uuid_str, uuid_fmt,
1063-
uuid[0], uuid[1], uuid[2], uuid[3],
1064-
uuid[4], uuid[5], uuid[6], uuid[7]);
1064+
uuid[0], uuid[1], uuid[2], uuid[3],
1065+
uuid[4], uuid[5], uuid[6], uuid[7],
1066+
uuid[8], uuid[9], uuid[10], uuid[11],
1067+
uuid[12], uuid[13], uuid[14], uuid[15]);
10651068
vic_provinfo_add_tlv(vp,
10661069
VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
10671070
sizeof(uuid_str), uuid_str);
10681071
}
10691072

10701073
if (host_uuid) {
1071-
uuid = (unsigned short *)host_uuid;
1074+
uuid = host_uuid;
10721075
sprintf(uuid_str, uuid_fmt,
1073-
uuid[0], uuid[1], uuid[2], uuid[3],
1074-
uuid[4], uuid[5], uuid[6], uuid[7]);
1076+
uuid[0], uuid[1], uuid[2], uuid[3],
1077+
uuid[4], uuid[5], uuid[6], uuid[7],
1078+
uuid[8], uuid[9], uuid[10], uuid[11],
1079+
uuid[12], uuid[13], uuid[14], uuid[15]);
10751080
vic_provinfo_add_tlv(vp,
10761081
VIC_LINUX_PROV_TLV_HOST_UUID_STR,
10771082
sizeof(uuid_str), uuid_str);
@@ -1127,6 +1132,14 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
11271132
switch (request) {
11281133
case PORT_REQUEST_ASSOCIATE:
11291134

1135+
/* If the interface mac addr hasn't been assigned,
1136+
* assign a random mac addr before setting port-
1137+
* profile.
1138+
*/
1139+
1140+
if (is_zero_ether_addr(netdev->dev_addr))
1141+
random_ether_addr(netdev->dev_addr);
1142+
11301143
if (port[IFLA_PORT_PROFILE])
11311144
name = nla_data(port[IFLA_PORT_PROFILE]);
11321145

‎drivers/net/ethoc.c‎

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ MODULE_PARM_DESC(buffer_size, "DMA buffer allocation size");
174174
* @iobase: pointer to I/O memory region
175175
* @membase: pointer to buffer memory region
176176
* @dma_alloc: dma allocated buffer size
177+
* @io_region_size: I/O memory region size
177178
* @num_tx: number of send buffers
178179
* @cur_tx: last send buffer written
179180
* @dty_tx: last buffer actually sent
@@ -193,6 +194,7 @@ struct ethoc {
193194
void __iomem *iobase;
194195
void __iomem *membase;
195196
int dma_alloc;
197+
resource_size_t io_region_size;
196198

197199
unsigned int num_tx;
198200
unsigned int cur_tx;
@@ -943,6 +945,7 @@ static int ethoc_probe(struct platform_device *pdev)
943945
priv = netdev_priv(netdev);
944946
priv->netdev = netdev;
945947
priv->dma_alloc = 0;
948+
priv->io_region_size = mmio->end - mmio->start + 1;
946949

947950
priv->iobase = devm_ioremap_nocache(&pdev->dev, netdev->base_addr,
948951
resource_size(mmio));
@@ -1047,20 +1050,34 @@ static int ethoc_probe(struct platform_device *pdev)
10471050
ret = register_netdev(netdev);
10481051
if (ret < 0) {
10491052
dev_err(&netdev->dev, "failed to register interface\n");
1050-
goto error;
1053+
goto error2;
10511054
}
10521055

10531056
goto out;
10541057

1058+
error2:
1059+
netif_napi_del(&priv->napi);
10551060
error:
10561061
mdiobus_unregister(priv->mdio);
10571062
free_mdio:
10581063
kfree(priv->mdio->irq);
10591064
mdiobus_free(priv->mdio);
10601065
free:
1061-
if (priv->dma_alloc)
1062-
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
1063-
netdev->mem_start);
1066+
if (priv) {
1067+
if (priv->dma_alloc)
1068+
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
1069+
netdev->mem_start);
1070+
else if (priv->membase)
1071+
devm_iounmap(&pdev->dev, priv->membase);
1072+
if (priv->iobase)
1073+
devm_iounmap(&pdev->dev, priv->iobase);
1074+
}
1075+
if (mem)
1076+
devm_release_mem_region(&pdev->dev, mem->start,
1077+
mem->end - mem->start + 1);
1078+
if (mmio)
1079+
devm_release_mem_region(&pdev->dev, mmio->start,
1080+
mmio->end - mmio->start + 1);
10641081
free_netdev(netdev);
10651082
out:
10661083
return ret;
@@ -1078,6 +1095,7 @@ static int ethoc_remove(struct platform_device *pdev)
10781095
platform_set_drvdata(pdev, NULL);
10791096

10801097
if (netdev) {
1098+
netif_napi_del(&priv->napi);
10811099
phy_disconnect(priv->phy);
10821100
priv->phy = NULL;
10831101

@@ -1089,6 +1107,14 @@ static int ethoc_remove(struct platform_device *pdev)
10891107
if (priv->dma_alloc)
10901108
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
10911109
netdev->mem_start);
1110+
else {
1111+
devm_iounmap(&pdev->dev, priv->membase);
1112+
devm_release_mem_region(&pdev->dev, netdev->mem_start,
1113+
netdev->mem_end - netdev->mem_start + 1);
1114+
}
1115+
devm_iounmap(&pdev->dev, priv->iobase);
1116+
devm_release_mem_region(&pdev->dev, netdev->base_addr,
1117+
priv->io_region_size);
10921118
unregister_netdev(netdev);
10931119
free_netdev(netdev);
10941120
}

‎drivers/net/fec.c‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <linux/clk.h>
4242
#include <linux/platform_device.h>
4343
#include <linux/phy.h>
44+
#include <linux/fec.h>
4445

4546
#include <asm/cacheflush.h>
4647

@@ -182,6 +183,7 @@ struct fec_enet_private {
182183
struct phy_device *phy_dev;
183184
int mii_timeout;
184185
uint phy_speed;
186+
phy_interface_t phy_interface;
185187
int index;
186188
int link;
187189
int full_duplex;
@@ -1191,6 +1193,21 @@ fec_restart(struct net_device *dev, int duplex)
11911193
/* Set MII speed */
11921194
writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
11931195

1196+
#ifdef FEC_MIIGSK_ENR
1197+
if (fep->phy_interface == PHY_INTERFACE_MODE_RMII) {
1198+
/* disable the gasket and wait */
1199+
writel(0, fep->hwp + FEC_MIIGSK_ENR);
1200+
while (readl(fep->hwp + FEC_MIIGSK_ENR) & 4)
1201+
udelay(1);
1202+
1203+
/* configure the gasket: RMII, 50 MHz, no loopback, no echo */
1204+
writel(1, fep->hwp + FEC_MIIGSK_CFGR);
1205+
1206+
/* re-enable the gasket */
1207+
writel(2, fep->hwp + FEC_MIIGSK_ENR);
1208+
}
1209+
#endif
1210+
11941211
/* And last, enable the transmit and receive processing */
11951212
writel(2, fep->hwp + FEC_ECNTRL);
11961213
writel(0, fep->hwp + FEC_R_DES_ACTIVE);
@@ -1226,6 +1243,7 @@ static int __devinit
12261243
fec_probe(struct platform_device *pdev)
12271244
{
12281245
struct fec_enet_private *fep;
1246+
struct fec_platform_data *pdata;
12291247
struct net_device *ndev;
12301248
int i, irq, ret = 0;
12311249
struct resource *r;
@@ -1259,6 +1277,10 @@ fec_probe(struct platform_device *pdev)
12591277

12601278
platform_set_drvdata(pdev, ndev);
12611279

1280+
pdata = pdev->dev.platform_data;
1281+
if (pdata)
1282+
fep->phy_interface = pdata->phy;
1283+
12621284
/* This device has up to three irqs on some platforms */
12631285
for (i = 0; i < 3; i++) {
12641286
irq = platform_get_irq(pdev, i);

0 commit comments

Comments
 (0)