Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199456
b: refs/heads/master
c: e5e5cf4
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed May 29, 2010
1 parent 8eceaf5 commit 60b686e
Show file tree
Hide file tree
Showing 58 changed files with 633 additions and 348 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: da1fdb02d9200ff28b6f3a380d21930335fe5429
refs/heads/master: e5e5cf4c71508ed38e921b31b438b8b349409f2a
6 changes: 6 additions & 0 deletions trunk/drivers/isdn/capi/kcapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,12 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
if (ctr->state == CAPI_CTR_DETECTED)
goto reset_unlock_out;

if (ctr->reset_ctr == NULL) {
printk(KERN_DEBUG "kcapi: reset: no reset function\n");
retval = -ESRCH;
goto reset_unlock_out;
}

ctr->reset_ctr(ctr);

retval = wait_on_ctr_state(ctr, CAPI_CTR_DETECTED);
Expand Down
28 changes: 2 additions & 26 deletions trunk/drivers/isdn/gigaset/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,30 +932,6 @@ void gigaset_isdn_stop(struct cardstate *cs)
* ============================
*/

/*
* load firmware
*/
static int gigaset_load_firmware(struct capi_ctr *ctr, capiloaddata *data)
{
struct cardstate *cs = ctr->driverdata;

/* AVM specific operation, not needed for Gigaset -- ignore */
dev_notice(cs->dev, "load_firmware ignored\n");

return 0;
}

/*
* reset (deactivate) controller
*/
static void gigaset_reset_ctr(struct capi_ctr *ctr)
{
struct cardstate *cs = ctr->driverdata;

/* AVM specific operation, not needed for Gigaset -- ignore */
dev_notice(cs->dev, "reset_ctr ignored\n");
}

/*
* register CAPI application
*/
Expand Down Expand Up @@ -2213,8 +2189,8 @@ int gigaset_isdn_regdev(struct cardstate *cs, const char *isdnid)
iif->ctr.driverdata = cs;
strncpy(iif->ctr.name, isdnid, sizeof(iif->ctr.name));
iif->ctr.driver_name = "gigaset";
iif->ctr.load_firmware = gigaset_load_firmware;
iif->ctr.reset_ctr = gigaset_reset_ctr;
iif->ctr.load_firmware = NULL;
iif->ctr.reset_ctr = NULL;
iif->ctr.register_appl = gigaset_register_appl;
iif->ctr.release_appl = gigaset_release_appl;
iif->ctr.send_message = gigaset_send_message;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/3c507.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id)
void __iomem *shmem;

if (dev == NULL) {
pr_err("%s: net_interrupt(): irq %d for unknown device.\n",
dev->name, irq);
pr_err("net_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ struct be_adapter {
u8 port_type;
u8 transceiver;
u8 generation; /* BladeEngine ASIC generation */
u32 flash_status;
struct completion flash_compl;

bool sriov_enabled;
u32 vf_if_handle[BE_MAX_VF];
Expand Down
21 changes: 18 additions & 3 deletions trunk/drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ static int be_mcc_compl_process(struct be_adapter *adapter,

compl_status = (compl->status >> CQE_STATUS_COMPL_SHIFT) &
CQE_STATUS_COMPL_MASK;

if ((compl->tag0 == OPCODE_COMMON_WRITE_FLASHROM) &&
(compl->tag1 == CMD_SUBSYSTEM_COMMON)) {
adapter->flash_status = compl_status;
complete(&adapter->flash_compl);
}

if (compl_status == MCC_STATUS_SUCCESS) {
if (compl->tag0 == OPCODE_ETH_GET_STATISTICS) {
struct be_cmd_resp_get_stats *resp =
Expand Down Expand Up @@ -287,7 +294,7 @@ int be_cmd_POST(struct be_adapter *adapter)
} else {
return 0;
}
} while (timeout < 20);
} while (timeout < 40);

dev_err(&adapter->pdev->dev, "POST timeout; stage=0x%x\n", stage);
return -1;
Expand Down Expand Up @@ -1417,6 +1424,7 @@ int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd,
int status;

spin_lock_bh(&adapter->mcc_lock);
adapter->flash_status = 0;

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

be_wrb_hdr_prepare(wrb, cmd->size, false, 1,
OPCODE_COMMON_WRITE_FLASHROM);
wrb->tag1 = CMD_SUBSYSTEM_COMMON;

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

status = be_mcc_notify_wait(adapter);
be_mcc_notify(adapter);
spin_unlock_bh(&adapter->mcc_lock);

if (!wait_for_completion_timeout(&adapter->flash_compl,
msecs_to_jiffies(12000)))
status = -1;
else
status = adapter->flash_status;

err:
spin_unlock_bh(&adapter->mcc_lock);
return status;
}

Expand Down
13 changes: 8 additions & 5 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ static int be_setup(struct be_adapter *adapter)
goto if_destroy;
}
vf++;
} while (vf < num_vfs);
}
} else if (!be_physfn(adapter)) {
status = be_cmd_mac_addr_query(adapter, mac,
MAC_ADDRESS_TYPE_NETWORK, false, adapter->if_handle);
Expand Down Expand Up @@ -2319,6 +2319,7 @@ static int be_ctrl_init(struct be_adapter *adapter)
spin_lock_init(&adapter->mcc_lock);
spin_lock_init(&adapter->mcc_cq_lock);

init_completion(&adapter->flash_compl);
pci_save_state(adapter->pdev);
return 0;

Expand Down Expand Up @@ -2487,17 +2488,19 @@ static int __devinit be_probe(struct pci_dev *pdev,
status = be_cmd_POST(adapter);
if (status)
goto ctrl_clean;

status = be_cmd_reset_function(adapter);
if (status)
goto ctrl_clean;
}

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

if (be_physfn(adapter)) {
status = be_cmd_reset_function(adapter);
if (status)
goto ctrl_clean;
}

status = be_stats_init(adapter);
if (status)
goto ctrl_clean;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,7 @@ static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)
return 0;

out_err_mdiobus_register:
kfree(miibus->irq);
mdiobus_free(miibus);
out_err_alloc:
peripheral_free_list(pin_req);
Expand All @@ -1638,6 +1639,7 @@ static int __devexit bfin_mii_bus_remove(struct platform_device *pdev)
struct mii_bus *miibus = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
mdiobus_unregister(miibus);
kfree(miibus->irq);
mdiobus_free(miibus);
peripheral_free_list(pin_req);
return 0;
Expand Down
10 changes: 3 additions & 7 deletions trunk/drivers/net/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3367,13 +3367,9 @@ static int cnic_cm_shutdown(struct cnic_dev *dev)

static void cnic_init_context(struct cnic_dev *dev, u32 cid)
{
struct cnic_local *cp = dev->cnic_priv;
u32 cid_addr;
int i;

if (CHIP_NUM(cp) == CHIP_NUM_5709)
return;

cid_addr = GET_CID_ADDR(cid);

for (i = 0; i < CTX_SIZE; i += 4)
Expand Down Expand Up @@ -3530,14 +3526,11 @@ static void cnic_init_bnx2_tx_ring(struct cnic_dev *dev)

sb_id = cp->status_blk_num;
tx_cid = 20;
cnic_init_context(dev, tx_cid);
cnic_init_context(dev, tx_cid + 1);
cp->tx_cons_ptr = &s_blk->status_tx_quick_consumer_index2;
if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) {
struct status_block_msix *sblk = cp->status_blk.bnx2;

tx_cid = TX_TSS_CID + sb_id - 1;
cnic_init_context(dev, tx_cid);
CNIC_WR(dev, BNX2_TSCH_TSS_CFG, (sb_id << 24) |
(TX_TSS_CID << 7));
cp->tx_cons_ptr = &sblk->status_tx_quick_consumer_index;
Expand All @@ -3556,6 +3549,9 @@ static void cnic_init_bnx2_tx_ring(struct cnic_dev *dev)
offset2 = BNX2_L2CTX_TBDR_BHADDR_HI_XI;
offset3 = BNX2_L2CTX_TBDR_BHADDR_LO_XI;
} else {
cnic_init_context(dev, tx_cid);
cnic_init_context(dev, tx_cid + 1);

offset0 = BNX2_L2CTX_TYPE;
offset1 = BNX2_L2CTX_CMD_TYPE;
offset2 = BNX2_L2CTX_TBDR_BHADDR_HI;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/cnic_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#ifndef CNIC_IF_H
#define CNIC_IF_H

#define CNIC_MODULE_VERSION "2.1.1"
#define CNIC_MODULE_RELDATE "Feb 22, 2010"
#define CNIC_MODULE_VERSION "2.1.2"
#define CNIC_MODULE_RELDATE "May 26, 2010"

#define CNIC_ULP_RDMA 0
#define CNIC_ULP_ISCSI 1
Expand Down
29 changes: 21 additions & 8 deletions trunk/drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,10 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
{
struct vic_provinfo *vp;
u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
unsigned short *uuid;
u8 *uuid;
char uuid_str[38];
static char *uuid_fmt = "%04X%04X-%04X-%04X-%04X-%04X%04X%04X";
static char *uuid_fmt = "%02X%02X%02X%02X-%02X%02X-%02X%02X-"
"%02X%02X-%02X%02X%02X%02X%0X%02X";
int err;

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

if (instance_uuid) {
uuid = (unsigned short *)instance_uuid;
uuid = instance_uuid;
sprintf(uuid_str, uuid_fmt,
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7]);
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
sizeof(uuid_str), uuid_str);
}

if (host_uuid) {
uuid = (unsigned short *)host_uuid;
uuid = host_uuid;
sprintf(uuid_str, uuid_fmt,
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7]);
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_HOST_UUID_STR,
sizeof(uuid_str), uuid_str);
Expand Down Expand Up @@ -1127,6 +1132,14 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
switch (request) {
case PORT_REQUEST_ASSOCIATE:

/* If the interface mac addr hasn't been assigned,
* assign a random mac addr before setting port-
* profile.
*/

if (is_zero_ether_addr(netdev->dev_addr))
random_ether_addr(netdev->dev_addr);

if (port[IFLA_PORT_PROFILE])
name = nla_data(port[IFLA_PORT_PROFILE]);

Expand Down
34 changes: 30 additions & 4 deletions trunk/drivers/net/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ MODULE_PARM_DESC(buffer_size, "DMA buffer allocation size");
* @iobase: pointer to I/O memory region
* @membase: pointer to buffer memory region
* @dma_alloc: dma allocated buffer size
* @io_region_size: I/O memory region size
* @num_tx: number of send buffers
* @cur_tx: last send buffer written
* @dty_tx: last buffer actually sent
Expand All @@ -193,6 +194,7 @@ struct ethoc {
void __iomem *iobase;
void __iomem *membase;
int dma_alloc;
resource_size_t io_region_size;

unsigned int num_tx;
unsigned int cur_tx;
Expand Down Expand Up @@ -943,6 +945,7 @@ static int ethoc_probe(struct platform_device *pdev)
priv = netdev_priv(netdev);
priv->netdev = netdev;
priv->dma_alloc = 0;
priv->io_region_size = mmio->end - mmio->start + 1;

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

goto out;

error2:
netif_napi_del(&priv->napi);
error:
mdiobus_unregister(priv->mdio);
free_mdio:
kfree(priv->mdio->irq);
mdiobus_free(priv->mdio);
free:
if (priv->dma_alloc)
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
netdev->mem_start);
if (priv) {
if (priv->dma_alloc)
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
netdev->mem_start);
else if (priv->membase)
devm_iounmap(&pdev->dev, priv->membase);
if (priv->iobase)
devm_iounmap(&pdev->dev, priv->iobase);
}
if (mem)
devm_release_mem_region(&pdev->dev, mem->start,
mem->end - mem->start + 1);
if (mmio)
devm_release_mem_region(&pdev->dev, mmio->start,
mmio->end - mmio->start + 1);
free_netdev(netdev);
out:
return ret;
Expand All @@ -1078,6 +1095,7 @@ static int ethoc_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);

if (netdev) {
netif_napi_del(&priv->napi);
phy_disconnect(priv->phy);
priv->phy = NULL;

Expand All @@ -1089,6 +1107,14 @@ static int ethoc_remove(struct platform_device *pdev)
if (priv->dma_alloc)
dma_free_coherent(NULL, priv->dma_alloc, priv->membase,
netdev->mem_start);
else {
devm_iounmap(&pdev->dev, priv->membase);
devm_release_mem_region(&pdev->dev, netdev->mem_start,
netdev->mem_end - netdev->mem_start + 1);
}
devm_iounmap(&pdev->dev, priv->iobase);
devm_release_mem_region(&pdev->dev, netdev->base_addr,
priv->io_region_size);
unregister_netdev(netdev);
free_netdev(netdev);
}
Expand Down
Loading

0 comments on commit 60b686e

Please sign in to comment.