mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Merge branch 'master' into for-next
This commit is contained in:
commit
f1bbbb6912
3859 changed files with 293114 additions and 105562 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -598,8 +598,8 @@ rx_next:
|
|||
goto rx_status_loop;
|
||||
|
||||
spin_lock_irqsave(&cp->lock, flags);
|
||||
cpw16_f(IntrMask, cp_intr_mask);
|
||||
__napi_complete(napi);
|
||||
cpw16_f(IntrMask, cp_intr_mask);
|
||||
spin_unlock_irqrestore(&cp->lock, flags);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -860,6 +860,7 @@ retry:
|
|||
}
|
||||
|
||||
/* if unknown chip, assume array element #0, original RTL-8139 in this case */
|
||||
i = 0;
|
||||
dev_dbg(&pdev->dev, "unknown chip version, assuming RTL-8139\n");
|
||||
dev_dbg(&pdev->dev, "TxConfig = 0x%lx\n", RTL_R32 (TxConfig));
|
||||
tp->chipset = 0;
|
||||
|
|
@ -2088,8 +2089,8 @@ static int rtl8139_poll(struct napi_struct *napi, int budget)
|
|||
* again when we think we are done.
|
||||
*/
|
||||
spin_lock_irqsave(&tp->lock, flags);
|
||||
RTL_W16_F(IntrMask, rtl8139_intr_mask);
|
||||
__napi_complete(napi);
|
||||
RTL_W16_F(IntrMask, rtl8139_intr_mask);
|
||||
spin_unlock_irqrestore(&tp->lock, flags);
|
||||
}
|
||||
spin_unlock(&tp->rx_lock);
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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 =
|
||||
|
|
@ -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;
|
||||
|
|
@ -1417,17 +1424,19 @@ 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) {
|
||||
status = -EBUSY;
|
||||
goto err;
|
||||
goto err_unlock;
|
||||
}
|
||||
req = cmd->va;
|
||||
sge = nonembedded_sgl(wrb);
|
||||
|
||||
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);
|
||||
|
|
@ -1439,9 +1448,18 @@ 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);
|
||||
|
||||
err:
|
||||
if (!wait_for_completion_timeout(&adapter->flash_compl,
|
||||
msecs_to_jiffies(12000)))
|
||||
status = -1;
|
||||
else
|
||||
status = adapter->flash_status;
|
||||
|
||||
return status;
|
||||
|
||||
err_unlock:
|
||||
spin_unlock_bh(&adapter->mcc_lock);
|
||||
return status;
|
||||
}
|
||||
|
|
@ -1482,7 +1500,7 @@ err:
|
|||
return status;
|
||||
}
|
||||
|
||||
extern int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
|
||||
int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac,
|
||||
struct be_dma_mem *nonemb_cmd)
|
||||
{
|
||||
struct be_mcc_wrb *wrb;
|
||||
|
|
@ -1575,7 +1593,7 @@ int be_cmd_loopback_test(struct be_adapter *adapter, u32 port_num,
|
|||
|
||||
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_LOWLEVEL,
|
||||
OPCODE_LOWLEVEL_LOOPBACK_TEST, sizeof(*req));
|
||||
req->hdr.timeout = 4;
|
||||
req->hdr.timeout = cpu_to_le32(4);
|
||||
|
||||
req->pattern = cpu_to_le64(pattern);
|
||||
req->src_port = cpu_to_le32(port_num);
|
||||
|
|
@ -1647,7 +1665,7 @@ err:
|
|||
return status;
|
||||
}
|
||||
|
||||
extern int be_cmd_get_seeprom_data(struct be_adapter *adapter,
|
||||
int be_cmd_get_seeprom_data(struct be_adapter *adapter,
|
||||
struct be_dma_mem *nonemb_cmd)
|
||||
{
|
||||
struct be_mcc_wrb *wrb;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
@ -2487,10 +2488,6 @@ 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 */
|
||||
|
|
@ -2498,6 +2495,12 @@ static int __devinit be_probe(struct pci_dev *pdev,
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1654,8 +1654,11 @@ MODULE_DEVICE_TABLE (of, bmac_match);
|
|||
|
||||
static struct macio_driver bmac_driver =
|
||||
{
|
||||
.name = "bmac",
|
||||
.match_table = bmac_match,
|
||||
.driver = {
|
||||
.name = "bmac",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = bmac_match,
|
||||
},
|
||||
.probe = bmac_probe,
|
||||
.remove = bmac_remove,
|
||||
#ifdef CONFIG_PM
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ static const struct flash_spec flash_5709 = {
|
|||
MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl);
|
||||
|
||||
static void bnx2_init_napi(struct bnx2 *bp);
|
||||
static void bnx2_del_napi(struct bnx2 *bp);
|
||||
|
||||
static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr)
|
||||
{
|
||||
|
|
@ -6270,6 +6271,7 @@ open_err:
|
|||
bnx2_free_skbs(bp);
|
||||
bnx2_free_irq(bp);
|
||||
bnx2_free_mem(bp);
|
||||
bnx2_del_napi(bp);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -6537,6 +6539,7 @@ bnx2_close(struct net_device *dev)
|
|||
bnx2_free_irq(bp);
|
||||
bnx2_free_skbs(bp);
|
||||
bnx2_free_mem(bp);
|
||||
bnx2_del_napi(bp);
|
||||
bp->link_up = 0;
|
||||
netif_carrier_off(bp->dev);
|
||||
bnx2_set_power_state(bp, PCI_D3hot);
|
||||
|
|
@ -8227,7 +8230,16 @@ bnx2_bus_string(struct bnx2 *bp, char *str)
|
|||
return str;
|
||||
}
|
||||
|
||||
static void __devinit
|
||||
static void
|
||||
bnx2_del_napi(struct bnx2 *bp)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < bp->irq_nvecs; i++)
|
||||
netif_napi_del(&bp->bnx2_napi[i].napi);
|
||||
}
|
||||
|
||||
static void
|
||||
bnx2_init_napi(struct bnx2 *bp)
|
||||
{
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,16 @@ config CAN_BFIN
|
|||
To compile this driver as a module, choose M here: the
|
||||
module will be called bfin_can.
|
||||
|
||||
config CAN_JANZ_ICAN3
|
||||
tristate "Janz VMOD-ICAN3 Intelligent CAN controller"
|
||||
depends on CAN_DEV && MFD_JANZ_CMODIO
|
||||
---help---
|
||||
Driver for Janz VMOD-ICAN3 Intelligent CAN controller module, which
|
||||
connects to a MODULbus carrier board.
|
||||
|
||||
This driver can also be built as a module. If so, the module will be
|
||||
called janz-ican3.ko.
|
||||
|
||||
source "drivers/net/can/mscan/Kconfig"
|
||||
|
||||
source "drivers/net/can/sja1000/Kconfig"
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@ obj-$(CONFIG_CAN_AT91) += at91_can.o
|
|||
obj-$(CONFIG_CAN_TI_HECC) += ti_hecc.o
|
||||
obj-$(CONFIG_CAN_MCP251X) += mcp251x.o
|
||||
obj-$(CONFIG_CAN_BFIN) += bfin_can.o
|
||||
obj-$(CONFIG_CAN_JANZ_ICAN3) += janz-ican3.o
|
||||
|
||||
ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
|
||||
|
|
|
|||
1830
drivers/net/can/janz-ican3.c
Normal file
1830
drivers/net/can/janz-ican3.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -73,7 +73,7 @@ static u32 __devinit mpc52xx_can_get_clock(struct of_device *ofdev,
|
|||
else
|
||||
*mscan_clksrc = MSCAN_CLKSRC_XTAL;
|
||||
|
||||
freq = mpc5xxx_get_bus_frequency(ofdev->node);
|
||||
freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node);
|
||||
if (!freq)
|
||||
return 0;
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev,
|
|||
}
|
||||
|
||||
/* Determine the MSCAN device index from the physical address */
|
||||
pval = of_get_property(ofdev->node, "reg", &plen);
|
||||
pval = of_get_property(ofdev->dev.of_node, "reg", &plen);
|
||||
BUG_ON(!pval || plen < sizeof(*pval));
|
||||
clockidx = (*pval & 0x80) ? 1 : 0;
|
||||
if (*pval & 0x2000)
|
||||
|
|
@ -168,11 +168,11 @@ static u32 __devinit mpc512x_can_get_clock(struct of_device *ofdev,
|
|||
*/
|
||||
if (clock_name && !strcmp(clock_name, "ip")) {
|
||||
*mscan_clksrc = MSCAN_CLKSRC_IPS;
|
||||
freq = mpc5xxx_get_bus_frequency(ofdev->node);
|
||||
freq = mpc5xxx_get_bus_frequency(ofdev->dev.of_node);
|
||||
} else {
|
||||
*mscan_clksrc = MSCAN_CLKSRC_BUS;
|
||||
|
||||
pval = of_get_property(ofdev->node,
|
||||
pval = of_get_property(ofdev->dev.of_node,
|
||||
"fsl,mscan-clock-divider", &plen);
|
||||
if (pval && plen == sizeof(*pval))
|
||||
clockdiv = *pval;
|
||||
|
|
@ -251,7 +251,7 @@ static int __devinit mpc5xxx_can_probe(struct of_device *ofdev,
|
|||
const struct of_device_id *id)
|
||||
{
|
||||
struct mpc5xxx_can_data *data = (struct mpc5xxx_can_data *)id->data;
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct net_device *dev;
|
||||
struct mscan_priv *priv;
|
||||
void __iomem *base;
|
||||
|
|
@ -392,15 +392,17 @@ static struct of_device_id __devinitdata mpc5xxx_can_table[] = {
|
|||
};
|
||||
|
||||
static struct of_platform_driver mpc5xxx_can_driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "mpc5xxx_can",
|
||||
.driver = {
|
||||
.name = "mpc5xxx_can",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mpc5xxx_can_table,
|
||||
},
|
||||
.probe = mpc5xxx_can_probe,
|
||||
.remove = __devexit_p(mpc5xxx_can_remove),
|
||||
#ifdef CONFIG_PM
|
||||
.suspend = mpc5xxx_can_suspend,
|
||||
.resume = mpc5xxx_can_resume,
|
||||
#endif
|
||||
.match_table = mpc5xxx_can_table,
|
||||
};
|
||||
|
||||
static int __init mpc5xxx_can_init(void)
|
||||
|
|
|
|||
|
|
@ -599,6 +599,8 @@ struct net_device *alloc_sja1000dev(int sizeof_priv)
|
|||
priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
|
||||
CAN_CTRLMODE_BERR_REPORTING;
|
||||
|
||||
spin_lock_init(&priv->cmdreg_lock);
|
||||
|
||||
if (sizeof_priv)
|
||||
priv->priv = (void *)priv + sizeof(struct sja1000_priv);
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ static int __devexit sja1000_ofp_remove(struct of_device *ofdev)
|
|||
{
|
||||
struct net_device *dev = dev_get_drvdata(&ofdev->dev);
|
||||
struct sja1000_priv *priv = netdev_priv(dev);
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct resource res;
|
||||
|
||||
dev_set_drvdata(&ofdev->dev, NULL);
|
||||
|
|
@ -90,7 +90,7 @@ static int __devexit sja1000_ofp_remove(struct of_device *ofdev)
|
|||
static int __devinit sja1000_ofp_probe(struct of_device *ofdev,
|
||||
const struct of_device_id *id)
|
||||
{
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct net_device *dev;
|
||||
struct sja1000_priv *priv;
|
||||
struct resource res;
|
||||
|
|
@ -215,11 +215,13 @@ static struct of_device_id __devinitdata sja1000_ofp_table[] = {
|
|||
MODULE_DEVICE_TABLE(of, sja1000_ofp_table);
|
||||
|
||||
static struct of_platform_driver sja1000_ofp_driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = DRV_NAME,
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = DRV_NAME,
|
||||
.of_match_table = sja1000_ofp_table,
|
||||
},
|
||||
.probe = sja1000_ofp_probe,
|
||||
.remove = __devexit_p(sja1000_ofp_remove),
|
||||
.match_table = sja1000_ofp_table,
|
||||
};
|
||||
|
||||
static int __init sja1000_ofp_init(void)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -2554,7 +2554,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
|
|||
mdef = er32(MDEF(i));
|
||||
|
||||
/* Ignore filters with anything other than IPMI ports */
|
||||
if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
|
||||
if (mdef & ~(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
|
||||
continue;
|
||||
|
||||
/* Enable this decision filter in MANC2H */
|
||||
|
|
|
|||
|
|
@ -122,8 +122,11 @@ static struct of_device_id ehea_device_table[] = {
|
|||
MODULE_DEVICE_TABLE(of, ehea_device_table);
|
||||
|
||||
static struct of_platform_driver ehea_driver = {
|
||||
.name = "ehea",
|
||||
.match_table = ehea_device_table,
|
||||
.driver = {
|
||||
.name = "ehea",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = ehea_device_table,
|
||||
},
|
||||
.probe = ehea_probe_adapter,
|
||||
.remove = ehea_remove,
|
||||
};
|
||||
|
|
@ -3050,7 +3053,7 @@ static DEVICE_ATTR(log_port_id, S_IRUSR | S_IRGRP | S_IROTH, ehea_show_port_id,
|
|||
static void __devinit logical_port_release(struct device *dev)
|
||||
{
|
||||
struct ehea_port *port = container_of(dev, struct ehea_port, ofdev.dev);
|
||||
of_node_put(port->ofdev.node);
|
||||
of_node_put(port->ofdev.dev.of_node);
|
||||
}
|
||||
|
||||
static struct device *ehea_register_port(struct ehea_port *port,
|
||||
|
|
@ -3058,7 +3061,7 @@ static struct device *ehea_register_port(struct ehea_port *port,
|
|||
{
|
||||
int ret;
|
||||
|
||||
port->ofdev.node = of_node_get(dn);
|
||||
port->ofdev.dev.of_node = of_node_get(dn);
|
||||
port->ofdev.dev.parent = &port->adapter->ofdev->dev;
|
||||
port->ofdev.dev.bus = &ibmebus_bus_type;
|
||||
|
||||
|
|
@ -3225,7 +3228,7 @@ static int ehea_setup_ports(struct ehea_adapter *adapter)
|
|||
const u32 *dn_log_port_id;
|
||||
int i = 0;
|
||||
|
||||
lhea_dn = adapter->ofdev->node;
|
||||
lhea_dn = adapter->ofdev->dev.of_node;
|
||||
while ((eth_dn = of_get_next_child(lhea_dn, eth_dn))) {
|
||||
|
||||
dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no",
|
||||
|
|
@ -3264,7 +3267,7 @@ static struct device_node *ehea_get_eth_dn(struct ehea_adapter *adapter,
|
|||
struct device_node *eth_dn = NULL;
|
||||
const u32 *dn_log_port_id;
|
||||
|
||||
lhea_dn = adapter->ofdev->node;
|
||||
lhea_dn = adapter->ofdev->dev.of_node;
|
||||
while ((eth_dn = of_get_next_child(lhea_dn, eth_dn))) {
|
||||
|
||||
dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no",
|
||||
|
|
@ -3394,7 +3397,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
|
|||
const u64 *adapter_handle;
|
||||
int ret;
|
||||
|
||||
if (!dev || !dev->node) {
|
||||
if (!dev || !dev->dev.of_node) {
|
||||
ehea_error("Invalid ibmebus device probed");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -3410,14 +3413,14 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
|
|||
|
||||
adapter->ofdev = dev;
|
||||
|
||||
adapter_handle = of_get_property(dev->node, "ibm,hea-handle",
|
||||
adapter_handle = of_get_property(dev->dev.of_node, "ibm,hea-handle",
|
||||
NULL);
|
||||
if (adapter_handle)
|
||||
adapter->handle = *adapter_handle;
|
||||
|
||||
if (!adapter->handle) {
|
||||
dev_err(&dev->dev, "failed getting handle for adapter"
|
||||
" '%s'\n", dev->node->full_name);
|
||||
" '%s'\n", dev->dev.of_node->full_name);
|
||||
ret = -ENODEV;
|
||||
goto out_free_ad;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,14 @@ struct enic_msix_entry {
|
|||
void *devid;
|
||||
};
|
||||
|
||||
#define ENIC_SET_APPLIED (1 << 0)
|
||||
#define ENIC_SET_REQUEST (1 << 1)
|
||||
#define ENIC_SET_NAME (1 << 2)
|
||||
#define ENIC_SET_INSTANCE (1 << 3)
|
||||
#define ENIC_SET_HOST (1 << 4)
|
||||
|
||||
struct enic_port_profile {
|
||||
u32 set;
|
||||
u8 request;
|
||||
char name[PORT_PROFILE_MAX];
|
||||
u8 instance_uuid[PORT_UUID_MAX];
|
||||
|
|
|
|||
|
|
@ -1029,127 +1029,133 @@ static int enic_dev_init_done(struct enic *enic, int *done, int *error)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
|
||||
char *name, u8 *instance_uuid, u8 *host_uuid)
|
||||
static int enic_set_port_profile(struct enic *enic, 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)
|
||||
return -EINVAL;
|
||||
|
||||
if (!is_valid_ether_addr(mac))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
vp = vic_provinfo_alloc(GFP_KERNEL, oui, VIC_PROVINFO_LINUX_TYPE);
|
||||
if (!vp)
|
||||
return -ENOMEM;
|
||||
|
||||
vic_provinfo_add_tlv(vp,
|
||||
VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
|
||||
strlen(name) + 1, name);
|
||||
|
||||
vic_provinfo_add_tlv(vp,
|
||||
VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
|
||||
ETH_ALEN, mac);
|
||||
|
||||
if (instance_uuid) {
|
||||
uuid = (unsigned short *)instance_uuid;
|
||||
sprintf(uuid_str, uuid_fmt,
|
||||
uuid[0], uuid[1], uuid[2], uuid[3],
|
||||
uuid[4], uuid[5], uuid[6], uuid[7]);
|
||||
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;
|
||||
sprintf(uuid_str, uuid_fmt,
|
||||
uuid[0], uuid[1], uuid[2], uuid[3],
|
||||
uuid[4], uuid[5], uuid[6], uuid[7]);
|
||||
vic_provinfo_add_tlv(vp,
|
||||
VIC_LINUX_PROV_TLV_HOST_UUID_STR,
|
||||
sizeof(uuid_str), uuid_str);
|
||||
}
|
||||
|
||||
err = enic_vnic_dev_deinit(enic);
|
||||
if (err)
|
||||
goto err_out;
|
||||
return err;
|
||||
|
||||
memset(&enic->pp, 0, sizeof(enic->pp));
|
||||
switch (enic->pp.request) {
|
||||
|
||||
err = enic_dev_init_prov(enic, vp);
|
||||
if (err)
|
||||
goto err_out;
|
||||
case PORT_REQUEST_ASSOCIATE:
|
||||
|
||||
enic->pp.request = request;
|
||||
memcpy(enic->pp.name, name, PORT_PROFILE_MAX);
|
||||
if (instance_uuid)
|
||||
memcpy(enic->pp.instance_uuid,
|
||||
instance_uuid, PORT_UUID_MAX);
|
||||
if (host_uuid)
|
||||
memcpy(enic->pp.host_uuid,
|
||||
host_uuid, PORT_UUID_MAX);
|
||||
if (!(enic->pp.set & ENIC_SET_NAME) || !strlen(enic->pp.name))
|
||||
return -EINVAL;
|
||||
|
||||
err_out:
|
||||
vic_provinfo_free(vp);
|
||||
if (!is_valid_ether_addr(mac))
|
||||
return -EADDRNOTAVAIL;
|
||||
|
||||
return err;
|
||||
}
|
||||
vp = vic_provinfo_alloc(GFP_KERNEL, oui,
|
||||
VIC_PROVINFO_LINUX_TYPE);
|
||||
if (!vp)
|
||||
return -ENOMEM;
|
||||
|
||||
static int enic_unset_port_profile(struct enic *enic)
|
||||
{
|
||||
memset(&enic->pp, 0, sizeof(enic->pp));
|
||||
return enic_vnic_dev_deinit(enic);
|
||||
vic_provinfo_add_tlv(vp,
|
||||
VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
|
||||
strlen(enic->pp.name) + 1, enic->pp.name);
|
||||
|
||||
vic_provinfo_add_tlv(vp,
|
||||
VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
|
||||
ETH_ALEN, mac);
|
||||
|
||||
if (enic->pp.set & ENIC_SET_INSTANCE) {
|
||||
uuid = enic->pp.instance_uuid;
|
||||
sprintf(uuid_str, uuid_fmt,
|
||||
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 (enic->pp.set & ENIC_SET_HOST) {
|
||||
uuid = enic->pp.host_uuid;
|
||||
sprintf(uuid_str, uuid_fmt,
|
||||
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);
|
||||
}
|
||||
|
||||
err = enic_dev_init_prov(enic, vp);
|
||||
vic_provinfo_free(vp);
|
||||
if (err)
|
||||
return err;
|
||||
break;
|
||||
|
||||
case PORT_REQUEST_DISASSOCIATE:
|
||||
break;
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
enic->pp.set |= ENIC_SET_APPLIED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int enic_set_vf_port(struct net_device *netdev, int vf,
|
||||
struct nlattr *port[])
|
||||
{
|
||||
struct enic *enic = netdev_priv(netdev);
|
||||
char *name = NULL;
|
||||
u8 *instance_uuid = NULL;
|
||||
u8 *host_uuid = NULL;
|
||||
u8 request = PORT_REQUEST_DISASSOCIATE;
|
||||
|
||||
memset(&enic->pp, 0, sizeof(enic->pp));
|
||||
|
||||
if (port[IFLA_PORT_REQUEST]) {
|
||||
enic->pp.set |= ENIC_SET_REQUEST;
|
||||
enic->pp.request = nla_get_u8(port[IFLA_PORT_REQUEST]);
|
||||
}
|
||||
|
||||
if (port[IFLA_PORT_PROFILE]) {
|
||||
enic->pp.set |= ENIC_SET_NAME;
|
||||
memcpy(enic->pp.name, nla_data(port[IFLA_PORT_PROFILE]),
|
||||
PORT_PROFILE_MAX);
|
||||
}
|
||||
|
||||
if (port[IFLA_PORT_INSTANCE_UUID]) {
|
||||
enic->pp.set |= ENIC_SET_INSTANCE;
|
||||
memcpy(enic->pp.instance_uuid,
|
||||
nla_data(port[IFLA_PORT_INSTANCE_UUID]), PORT_UUID_MAX);
|
||||
}
|
||||
|
||||
if (port[IFLA_PORT_HOST_UUID]) {
|
||||
enic->pp.set |= ENIC_SET_HOST;
|
||||
memcpy(enic->pp.host_uuid,
|
||||
nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX);
|
||||
}
|
||||
|
||||
/* don't support VFs, yet */
|
||||
if (vf != PORT_SELF_VF)
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (port[IFLA_PORT_REQUEST])
|
||||
request = nla_get_u8(port[IFLA_PORT_REQUEST]);
|
||||
if (!(enic->pp.set & ENIC_SET_REQUEST))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
switch (request) {
|
||||
case PORT_REQUEST_ASSOCIATE:
|
||||
if (enic->pp.request == PORT_REQUEST_ASSOCIATE) {
|
||||
|
||||
if (port[IFLA_PORT_PROFILE])
|
||||
name = nla_data(port[IFLA_PORT_PROFILE]);
|
||||
/* If the interface mac addr hasn't been assigned,
|
||||
* assign a random mac addr before setting port-
|
||||
* profile.
|
||||
*/
|
||||
|
||||
if (port[IFLA_PORT_INSTANCE_UUID])
|
||||
instance_uuid =
|
||||
nla_data(port[IFLA_PORT_INSTANCE_UUID]);
|
||||
|
||||
if (port[IFLA_PORT_HOST_UUID])
|
||||
host_uuid = nla_data(port[IFLA_PORT_HOST_UUID]);
|
||||
|
||||
return enic_set_port_profile(enic, request,
|
||||
netdev->dev_addr, name,
|
||||
instance_uuid, host_uuid);
|
||||
|
||||
case PORT_REQUEST_DISASSOCIATE:
|
||||
|
||||
return enic_unset_port_profile(enic);
|
||||
|
||||
default:
|
||||
break;
|
||||
if (is_zero_ether_addr(netdev->dev_addr))
|
||||
random_ether_addr(netdev->dev_addr);
|
||||
}
|
||||
|
||||
return -EOPNOTSUPP;
|
||||
return enic_set_port_profile(enic, netdev->dev_addr);
|
||||
}
|
||||
|
||||
static int enic_get_vf_port(struct net_device *netdev, int vf,
|
||||
|
|
@ -1159,14 +1165,12 @@ static int enic_get_vf_port(struct net_device *netdev, int vf,
|
|||
int err, error, done;
|
||||
u16 response = PORT_PROFILE_RESPONSE_SUCCESS;
|
||||
|
||||
/* don't support VFs, yet */
|
||||
if (vf != PORT_SELF_VF)
|
||||
return -EOPNOTSUPP;
|
||||
if (!(enic->pp.set & ENIC_SET_APPLIED))
|
||||
return -ENODATA;
|
||||
|
||||
err = enic_dev_init_done(enic, &done, &error);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
error = err;
|
||||
|
||||
switch (error) {
|
||||
case ERR_SUCCESS:
|
||||
|
|
@ -1189,12 +1193,15 @@ static int enic_get_vf_port(struct net_device *netdev, int vf,
|
|||
|
||||
NLA_PUT_U16(skb, IFLA_PORT_REQUEST, enic->pp.request);
|
||||
NLA_PUT_U16(skb, IFLA_PORT_RESPONSE, response);
|
||||
NLA_PUT(skb, IFLA_PORT_PROFILE, PORT_PROFILE_MAX,
|
||||
enic->pp.name);
|
||||
NLA_PUT(skb, IFLA_PORT_INSTANCE_UUID, PORT_UUID_MAX,
|
||||
enic->pp.instance_uuid);
|
||||
NLA_PUT(skb, IFLA_PORT_HOST_UUID, PORT_UUID_MAX,
|
||||
enic->pp.host_uuid);
|
||||
if (enic->pp.set & ENIC_SET_NAME)
|
||||
NLA_PUT(skb, IFLA_PORT_PROFILE, PORT_PROFILE_MAX,
|
||||
enic->pp.name);
|
||||
if (enic->pp.set & ENIC_SET_INSTANCE)
|
||||
NLA_PUT(skb, IFLA_PORT_INSTANCE_UUID, PORT_UUID_MAX,
|
||||
enic->pp.instance_uuid);
|
||||
if (enic->pp.set & ENIC_SET_HOST)
|
||||
NLA_PUT(skb, IFLA_PORT_HOST_UUID, PORT_UUID_MAX,
|
||||
enic->pp.host_uuid);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ static int rx_copybreak;
|
|||
#include <linux/bitops.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/byteorder.h>
|
||||
|
||||
/* These identify the driver base version and may not be removed. */
|
||||
static char version[] __devinitdata =
|
||||
|
|
@ -230,7 +231,7 @@ static const u16 media2miictl[16] = {
|
|||
* The EPIC100 Rx and Tx buffer descriptors. Note that these
|
||||
* really ARE host-endian; it's not a misannotation. We tell
|
||||
* the card to byteswap them internally on big-endian hosts -
|
||||
* look for #ifdef CONFIG_BIG_ENDIAN in epic_open().
|
||||
* look for #ifdef __BIG_ENDIAN in epic_open().
|
||||
*/
|
||||
|
||||
struct epic_tx_desc {
|
||||
|
|
@ -690,7 +691,7 @@ static int epic_open(struct net_device *dev)
|
|||
outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);
|
||||
|
||||
/* Tell the chip to byteswap descriptors on big-endian hosts */
|
||||
#ifdef CONFIG_BIG_ENDIAN
|
||||
#ifdef __BIG_ENDIAN
|
||||
outl(0x4432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
|
||||
inl(ioaddr + GENCTL);
|
||||
outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
|
||||
|
|
@ -806,7 +807,7 @@ static void epic_restart(struct net_device *dev)
|
|||
for (i = 16; i > 0; i--)
|
||||
outl(0x0008, ioaddr + TEST1);
|
||||
|
||||
#ifdef CONFIG_BIG_ENDIAN
|
||||
#ifdef __BIG_ENDIAN
|
||||
outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
|
||||
#else
|
||||
outl(0x0412 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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;
|
||||
|
|
@ -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));
|
||||
|
|
@ -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;
|
||||
|
|
@ -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;
|
||||
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include <linux/clk.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/phy.h>
|
||||
#include <linux/fec.h>
|
||||
|
||||
#include <asm/cacheflush.h>
|
||||
|
||||
|
|
@ -182,6 +183,7 @@ struct fec_enet_private {
|
|||
struct phy_device *phy_dev;
|
||||
int mii_timeout;
|
||||
uint phy_speed;
|
||||
phy_interface_t phy_interface;
|
||||
int index;
|
||||
int link;
|
||||
int full_duplex;
|
||||
|
|
@ -679,6 +681,8 @@ static int fec_enet_mii_probe(struct net_device *dev)
|
|||
struct phy_device *phy_dev = NULL;
|
||||
int phy_addr;
|
||||
|
||||
fep->phy_dev = NULL;
|
||||
|
||||
/* find the first phy */
|
||||
for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
|
||||
if (fep->mii_bus->phy_map[phy_addr]) {
|
||||
|
|
@ -709,6 +713,11 @@ static int fec_enet_mii_probe(struct net_device *dev)
|
|||
fep->link = 0;
|
||||
fep->full_duplex = 0;
|
||||
|
||||
printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
|
||||
"(mii_bus:phy_addr=%s, irq=%d)\n", dev->name,
|
||||
fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
|
||||
fep->phy_dev->irq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -754,13 +763,8 @@ static int fec_enet_mii_init(struct platform_device *pdev)
|
|||
if (mdiobus_register(fep->mii_bus))
|
||||
goto err_out_free_mdio_irq;
|
||||
|
||||
if (fec_enet_mii_probe(dev) != 0)
|
||||
goto err_out_unregister_bus;
|
||||
|
||||
return 0;
|
||||
|
||||
err_out_unregister_bus:
|
||||
mdiobus_unregister(fep->mii_bus);
|
||||
err_out_free_mdio_irq:
|
||||
kfree(fep->mii_bus->irq);
|
||||
err_out_free_mdiobus:
|
||||
|
|
@ -913,7 +917,12 @@ fec_enet_open(struct net_device *dev)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* schedule a link state check */
|
||||
/* Probe and connect to PHY when open the interface */
|
||||
ret = fec_enet_mii_probe(dev);
|
||||
if (ret) {
|
||||
fec_enet_free_buffers(dev);
|
||||
return ret;
|
||||
}
|
||||
phy_start(fep->phy_dev);
|
||||
netif_start_queue(dev);
|
||||
fep->opened = 1;
|
||||
|
|
@ -927,10 +936,12 @@ fec_enet_close(struct net_device *dev)
|
|||
|
||||
/* Don't know what to do yet. */
|
||||
fep->opened = 0;
|
||||
phy_stop(fep->phy_dev);
|
||||
netif_stop_queue(dev);
|
||||
fec_stop(dev);
|
||||
|
||||
if (fep->phy_dev)
|
||||
phy_disconnect(fep->phy_dev);
|
||||
|
||||
fec_enet_free_buffers(dev);
|
||||
|
||||
return 0;
|
||||
|
|
@ -1191,6 +1202,21 @@ fec_restart(struct net_device *dev, int duplex)
|
|||
/* Set MII speed */
|
||||
writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
|
||||
|
||||
#ifdef FEC_MIIGSK_ENR
|
||||
if (fep->phy_interface == PHY_INTERFACE_MODE_RMII) {
|
||||
/* disable the gasket and wait */
|
||||
writel(0, fep->hwp + FEC_MIIGSK_ENR);
|
||||
while (readl(fep->hwp + FEC_MIIGSK_ENR) & 4)
|
||||
udelay(1);
|
||||
|
||||
/* configure the gasket: RMII, 50 MHz, no loopback, no echo */
|
||||
writel(1, fep->hwp + FEC_MIIGSK_CFGR);
|
||||
|
||||
/* re-enable the gasket */
|
||||
writel(2, fep->hwp + FEC_MIIGSK_ENR);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* And last, enable the transmit and receive processing */
|
||||
writel(2, fep->hwp + FEC_ECNTRL);
|
||||
writel(0, fep->hwp + FEC_R_DES_ACTIVE);
|
||||
|
|
@ -1226,6 +1252,7 @@ static int __devinit
|
|||
fec_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct fec_enet_private *fep;
|
||||
struct fec_platform_data *pdata;
|
||||
struct net_device *ndev;
|
||||
int i, irq, ret = 0;
|
||||
struct resource *r;
|
||||
|
|
@ -1259,6 +1286,10 @@ fec_probe(struct platform_device *pdev)
|
|||
|
||||
platform_set_drvdata(pdev, ndev);
|
||||
|
||||
pdata = pdev->dev.platform_data;
|
||||
if (pdata)
|
||||
fep->phy_interface = pdata->phy;
|
||||
|
||||
/* This device has up to three irqs on some platforms */
|
||||
for (i = 0; i < 3; i++) {
|
||||
irq = platform_get_irq(pdev, i);
|
||||
|
|
@ -1294,11 +1325,6 @@ fec_probe(struct platform_device *pdev)
|
|||
if (ret)
|
||||
goto failed_register;
|
||||
|
||||
printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
|
||||
"(mii_bus:phy_addr=%s, irq=%d)\n", ndev->name,
|
||||
fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
|
||||
fep->phy_dev->irq);
|
||||
|
||||
return 0;
|
||||
|
||||
failed_register:
|
||||
|
|
@ -1347,10 +1373,9 @@ fec_suspend(struct platform_device *dev, pm_message_t state)
|
|||
|
||||
if (ndev) {
|
||||
fep = netdev_priv(ndev);
|
||||
if (netif_running(ndev)) {
|
||||
netif_device_detach(ndev);
|
||||
fec_stop(ndev);
|
||||
}
|
||||
if (netif_running(ndev))
|
||||
fec_enet_close(ndev);
|
||||
clk_disable(fep->clk);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1359,12 +1384,13 @@ static int
|
|||
fec_resume(struct platform_device *dev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(dev);
|
||||
struct fec_enet_private *fep;
|
||||
|
||||
if (ndev) {
|
||||
if (netif_running(ndev)) {
|
||||
fec_enet_init(ndev, 0);
|
||||
netif_device_attach(ndev);
|
||||
}
|
||||
fep = netdev_priv(ndev);
|
||||
clk_enable(fep->clk);
|
||||
if (netif_running(ndev))
|
||||
fec_enet_open(ndev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@
|
|||
#define FEC_R_DES_START 0x180 /* Receive descriptor ring */
|
||||
#define FEC_X_DES_START 0x184 /* Transmit descriptor ring */
|
||||
#define FEC_R_BUFF_SIZE 0x188 /* Maximum receive buff size */
|
||||
#define FEC_MIIGSK_CFGR 0x300 /* MIIGSK Configuration reg */
|
||||
#define FEC_MIIGSK_ENR 0x308 /* MIIGSK Enable reg */
|
||||
|
||||
#else
|
||||
|
||||
|
|
|
|||
|
|
@ -871,7 +871,7 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
|
|||
priv->ndev = ndev;
|
||||
|
||||
/* Reserve FEC control zone */
|
||||
rv = of_address_to_resource(op->node, 0, &mem);
|
||||
rv = of_address_to_resource(op->dev.of_node, 0, &mem);
|
||||
if (rv) {
|
||||
printk(KERN_ERR DRIVER_NAME ": "
|
||||
"Error while parsing device node resource\n" );
|
||||
|
|
@ -919,7 +919,7 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
|
|||
|
||||
/* Get the IRQ we need one by one */
|
||||
/* Control */
|
||||
ndev->irq = irq_of_parse_and_map(op->node, 0);
|
||||
ndev->irq = irq_of_parse_and_map(op->dev.of_node, 0);
|
||||
|
||||
/* RX */
|
||||
priv->r_irq = bcom_get_task_irq(priv->rx_dmatsk);
|
||||
|
|
@ -942,20 +942,20 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
|
|||
/* Start with safe defaults for link connection */
|
||||
priv->speed = 100;
|
||||
priv->duplex = DUPLEX_HALF;
|
||||
priv->mdio_speed = ((mpc5xxx_get_bus_frequency(op->node) >> 20) / 5) << 1;
|
||||
priv->mdio_speed = ((mpc5xxx_get_bus_frequency(op->dev.of_node) >> 20) / 5) << 1;
|
||||
|
||||
/* The current speed preconfigures the speed of the MII link */
|
||||
prop = of_get_property(op->node, "current-speed", &prop_size);
|
||||
prop = of_get_property(op->dev.of_node, "current-speed", &prop_size);
|
||||
if (prop && (prop_size >= sizeof(u32) * 2)) {
|
||||
priv->speed = prop[0];
|
||||
priv->duplex = prop[1] ? DUPLEX_FULL : DUPLEX_HALF;
|
||||
}
|
||||
|
||||
/* If there is a phy handle, then get the PHY node */
|
||||
priv->phy_node = of_parse_phandle(op->node, "phy-handle", 0);
|
||||
priv->phy_node = of_parse_phandle(op->dev.of_node, "phy-handle", 0);
|
||||
|
||||
/* the 7-wire property means don't use MII mode */
|
||||
if (of_find_property(op->node, "fsl,7-wire-mode", NULL)) {
|
||||
if (of_find_property(op->dev.of_node, "fsl,7-wire-mode", NULL)) {
|
||||
priv->seven_wire_mode = 1;
|
||||
dev_info(&ndev->dev, "using 7-wire PHY mode\n");
|
||||
}
|
||||
|
|
@ -1063,9 +1063,11 @@ static struct of_device_id mpc52xx_fec_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, mpc52xx_fec_match);
|
||||
|
||||
static struct of_platform_driver mpc52xx_fec_driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = DRIVER_NAME,
|
||||
.match_table = mpc52xx_fec_match,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mpc52xx_fec_match,
|
||||
},
|
||||
.probe = mpc52xx_fec_probe,
|
||||
.remove = mpc52xx_fec_remove,
|
||||
#ifdef CONFIG_PM
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of,
|
|||
const struct of_device_id *match)
|
||||
{
|
||||
struct device *dev = &of->dev;
|
||||
struct device_node *np = of->node;
|
||||
struct device_node *np = of->dev.of_node;
|
||||
struct mii_bus *bus;
|
||||
struct mpc52xx_fec_mdio_priv *priv;
|
||||
struct resource res = {};
|
||||
|
|
@ -107,7 +107,7 @@ static int mpc52xx_fec_mdio_probe(struct of_device *of,
|
|||
|
||||
/* set MII speed */
|
||||
out_be32(&priv->regs->mii_speed,
|
||||
((mpc5xxx_get_bus_frequency(of->node) >> 20) / 5) << 1);
|
||||
((mpc5xxx_get_bus_frequency(of->dev.of_node) >> 20) / 5) << 1);
|
||||
|
||||
err = of_mdiobus_register(bus, np);
|
||||
if (err)
|
||||
|
|
@ -159,10 +159,13 @@ static struct of_device_id mpc52xx_fec_mdio_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, mpc52xx_fec_mdio_match);
|
||||
|
||||
struct of_platform_driver mpc52xx_fec_mdio_driver = {
|
||||
.name = "mpc5200b-fec-phy",
|
||||
.driver = {
|
||||
.name = "mpc5200b-fec-phy",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mpc52xx_fec_mdio_match,
|
||||
},
|
||||
.probe = mpc52xx_fec_mdio_probe,
|
||||
.remove = mpc52xx_fec_mdio_remove,
|
||||
.match_table = mpc52xx_fec_mdio_match,
|
||||
};
|
||||
|
||||
/* let fec driver call it, since this has to be registered before it */
|
||||
|
|
|
|||
|
|
@ -1013,7 +1013,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
|
|||
return -ENOMEM;
|
||||
|
||||
if (!IS_FEC(match)) {
|
||||
data = of_get_property(ofdev->node, "fsl,cpm-command", &len);
|
||||
data = of_get_property(ofdev->dev.of_node, "fsl,cpm-command", &len);
|
||||
if (!data || len != 4)
|
||||
goto out_free_fpi;
|
||||
|
||||
|
|
@ -1025,8 +1025,8 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
|
|||
fpi->rx_copybreak = 240;
|
||||
fpi->use_napi = 1;
|
||||
fpi->napi_weight = 17;
|
||||
fpi->phy_node = of_parse_phandle(ofdev->node, "phy-handle", 0);
|
||||
if ((!fpi->phy_node) && (!of_get_property(ofdev->node, "fixed-link",
|
||||
fpi->phy_node = of_parse_phandle(ofdev->dev.of_node, "phy-handle", 0);
|
||||
if ((!fpi->phy_node) && (!of_get_property(ofdev->dev.of_node, "fixed-link",
|
||||
NULL)))
|
||||
goto out_free_fpi;
|
||||
|
||||
|
|
@ -1059,7 +1059,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
|
|||
spin_lock_init(&fep->lock);
|
||||
spin_lock_init(&fep->tx_lock);
|
||||
|
||||
mac_addr = of_get_mac_address(ofdev->node);
|
||||
mac_addr = of_get_mac_address(ofdev->dev.of_node);
|
||||
if (mac_addr)
|
||||
memcpy(ndev->dev_addr, mac_addr, 6);
|
||||
|
||||
|
|
@ -1156,8 +1156,11 @@ static struct of_device_id fs_enet_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, fs_enet_match);
|
||||
|
||||
static struct of_platform_driver fs_enet_driver = {
|
||||
.name = "fs_enet",
|
||||
.match_table = fs_enet_match,
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "fs_enet",
|
||||
.of_match_table = fs_enet_match,
|
||||
},
|
||||
.probe = fs_enet_probe,
|
||||
.remove = fs_enet_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -88,19 +88,19 @@ static int do_pd_setup(struct fs_enet_private *fep)
|
|||
struct fs_platform_info *fpi = fep->fpi;
|
||||
int ret = -EINVAL;
|
||||
|
||||
fep->interrupt = of_irq_to_resource(ofdev->node, 0, NULL);
|
||||
fep->interrupt = of_irq_to_resource(ofdev->dev.of_node, 0, NULL);
|
||||
if (fep->interrupt == NO_IRQ)
|
||||
goto out;
|
||||
|
||||
fep->fcc.fccp = of_iomap(ofdev->node, 0);
|
||||
fep->fcc.fccp = of_iomap(ofdev->dev.of_node, 0);
|
||||
if (!fep->fcc.fccp)
|
||||
goto out;
|
||||
|
||||
fep->fcc.ep = of_iomap(ofdev->node, 1);
|
||||
fep->fcc.ep = of_iomap(ofdev->dev.of_node, 1);
|
||||
if (!fep->fcc.ep)
|
||||
goto out_fccp;
|
||||
|
||||
fep->fcc.fcccp = of_iomap(ofdev->node, 2);
|
||||
fep->fcc.fcccp = of_iomap(ofdev->dev.of_node, 2);
|
||||
if (!fep->fcc.fcccp)
|
||||
goto out_ep;
|
||||
|
||||
|
|
@ -504,17 +504,54 @@ static int get_regs_len(struct net_device *dev)
|
|||
}
|
||||
|
||||
/* Some transmit errors cause the transmitter to shut
|
||||
* down. We now issue a restart transmit. Since the
|
||||
* errors close the BD and update the pointers, the restart
|
||||
* _should_ pick up without having to reset any of our
|
||||
* pointers either. Also, To workaround 8260 device erratum
|
||||
* CPM37, we must disable and then re-enable the transmitter
|
||||
* following a Late Collision, Underrun, or Retry Limit error.
|
||||
* down. We now issue a restart transmit.
|
||||
* Also, to workaround 8260 device erratum CPM37, we must
|
||||
* disable and then re-enable the transmitterfollowing a
|
||||
* Late Collision, Underrun, or Retry Limit error.
|
||||
* In addition, tbptr may point beyond BDs beyond still marked
|
||||
* as ready due to internal pipelining, so we need to look back
|
||||
* through the BDs and adjust tbptr to point to the last BD
|
||||
* marked as ready. This may result in some buffers being
|
||||
* retransmitted.
|
||||
*/
|
||||
static void tx_restart(struct net_device *dev)
|
||||
{
|
||||
struct fs_enet_private *fep = netdev_priv(dev);
|
||||
fcc_t __iomem *fccp = fep->fcc.fccp;
|
||||
const struct fs_platform_info *fpi = fep->fpi;
|
||||
fcc_enet_t __iomem *ep = fep->fcc.ep;
|
||||
cbd_t __iomem *curr_tbptr;
|
||||
cbd_t __iomem *recheck_bd;
|
||||
cbd_t __iomem *prev_bd;
|
||||
cbd_t __iomem *last_tx_bd;
|
||||
|
||||
last_tx_bd = fep->tx_bd_base + (fpi->tx_ring * sizeof(cbd_t));
|
||||
|
||||
/* get the current bd held in TBPTR and scan back from this point */
|
||||
recheck_bd = curr_tbptr = (cbd_t __iomem *)
|
||||
((R32(ep, fen_genfcc.fcc_tbptr) - fep->ring_mem_addr) +
|
||||
fep->ring_base);
|
||||
|
||||
prev_bd = (recheck_bd == fep->tx_bd_base) ? last_tx_bd : recheck_bd - 1;
|
||||
|
||||
/* Move through the bds in reverse, look for the earliest buffer
|
||||
* that is not ready. Adjust TBPTR to the following buffer */
|
||||
while ((CBDR_SC(prev_bd) & BD_ENET_TX_READY) != 0) {
|
||||
/* Go back one buffer */
|
||||
recheck_bd = prev_bd;
|
||||
|
||||
/* update the previous buffer */
|
||||
prev_bd = (prev_bd == fep->tx_bd_base) ? last_tx_bd : prev_bd - 1;
|
||||
|
||||
/* We should never see all bds marked as ready, check anyway */
|
||||
if (recheck_bd == curr_tbptr)
|
||||
break;
|
||||
}
|
||||
/* Now update the TBPTR and dirty flag to the current buffer */
|
||||
W32(ep, fen_genfcc.fcc_tbptr,
|
||||
(uint) (((void *)recheck_bd - fep->ring_base) +
|
||||
fep->ring_mem_addr));
|
||||
fep->dirty_tx = recheck_bd;
|
||||
|
||||
C32(fccp, fcc_gfmr, FCC_GFMR_ENT);
|
||||
udelay(10);
|
||||
|
|
|
|||
|
|
@ -98,11 +98,11 @@ static int do_pd_setup(struct fs_enet_private *fep)
|
|||
{
|
||||
struct of_device *ofdev = to_of_device(fep->dev);
|
||||
|
||||
fep->interrupt = of_irq_to_resource(ofdev->node, 0, NULL);
|
||||
fep->interrupt = of_irq_to_resource(ofdev->dev.of_node, 0, NULL);
|
||||
if (fep->interrupt == NO_IRQ)
|
||||
return -EINVAL;
|
||||
|
||||
fep->fec.fecp = of_iomap(ofdev->node, 0);
|
||||
fep->fec.fecp = of_iomap(ofdev->dev.of_node, 0);
|
||||
if (!fep->fcc.fccp)
|
||||
return -EINVAL;
|
||||
|
||||
|
|
|
|||
|
|
@ -98,15 +98,15 @@ static int do_pd_setup(struct fs_enet_private *fep)
|
|||
{
|
||||
struct of_device *ofdev = to_of_device(fep->dev);
|
||||
|
||||
fep->interrupt = of_irq_to_resource(ofdev->node, 0, NULL);
|
||||
fep->interrupt = of_irq_to_resource(ofdev->dev.of_node, 0, NULL);
|
||||
if (fep->interrupt == NO_IRQ)
|
||||
return -EINVAL;
|
||||
|
||||
fep->scc.sccp = of_iomap(ofdev->node, 0);
|
||||
fep->scc.sccp = of_iomap(ofdev->dev.of_node, 0);
|
||||
if (!fep->scc.sccp)
|
||||
return -EINVAL;
|
||||
|
||||
fep->scc.ep = of_iomap(ofdev->node, 1);
|
||||
fep->scc.ep = of_iomap(ofdev->dev.of_node, 1);
|
||||
if (!fep->scc.ep) {
|
||||
iounmap(fep->scc.sccp);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev,
|
|||
|
||||
new_bus->name = "CPM2 Bitbanged MII",
|
||||
|
||||
ret = fs_mii_bitbang_init(new_bus, ofdev->node);
|
||||
ret = fs_mii_bitbang_init(new_bus, ofdev->dev.of_node);
|
||||
if (ret)
|
||||
goto out_free_bus;
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev,
|
|||
new_bus->parent = &ofdev->dev;
|
||||
dev_set_drvdata(&ofdev->dev, new_bus);
|
||||
|
||||
ret = of_mdiobus_register(new_bus, ofdev->node);
|
||||
ret = of_mdiobus_register(new_bus, ofdev->dev.of_node);
|
||||
if (ret)
|
||||
goto out_free_irqs;
|
||||
|
||||
|
|
@ -224,8 +224,11 @@ static struct of_device_id fs_enet_mdio_bb_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, fs_enet_mdio_bb_match);
|
||||
|
||||
static struct of_platform_driver fs_enet_bb_mdio_driver = {
|
||||
.name = "fsl-bb-mdio",
|
||||
.match_table = fs_enet_mdio_bb_match,
|
||||
.driver = {
|
||||
.name = "fsl-bb-mdio",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = fs_enet_mdio_bb_match,
|
||||
},
|
||||
.probe = fs_enet_mdio_probe,
|
||||
.remove = fs_enet_mdio_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev,
|
|||
new_bus->write = &fs_enet_fec_mii_write;
|
||||
new_bus->reset = &fs_enet_fec_mii_reset;
|
||||
|
||||
ret = of_address_to_resource(ofdev->node, 0, &res);
|
||||
ret = of_address_to_resource(ofdev->dev.of_node, 0, &res);
|
||||
if (ret)
|
||||
goto out_res;
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev,
|
|||
goto out_fec;
|
||||
|
||||
if (get_bus_freq) {
|
||||
clock = get_bus_freq(ofdev->node);
|
||||
clock = get_bus_freq(ofdev->dev.of_node);
|
||||
if (!clock) {
|
||||
/* Use maximum divider if clock is unknown */
|
||||
dev_warn(&ofdev->dev, "could not determine IPS clock\n");
|
||||
|
|
@ -172,7 +172,7 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev,
|
|||
new_bus->parent = &ofdev->dev;
|
||||
dev_set_drvdata(&ofdev->dev, new_bus);
|
||||
|
||||
ret = of_mdiobus_register(new_bus, ofdev->node);
|
||||
ret = of_mdiobus_register(new_bus, ofdev->dev.of_node);
|
||||
if (ret)
|
||||
goto out_free_irqs;
|
||||
|
||||
|
|
@ -222,8 +222,11 @@ static struct of_device_id fs_enet_mdio_fec_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, fs_enet_mdio_fec_match);
|
||||
|
||||
static struct of_platform_driver fs_enet_fec_mdio_driver = {
|
||||
.name = "fsl-fec-mdio",
|
||||
.match_table = fs_enet_mdio_fec_match,
|
||||
.driver = {
|
||||
.name = "fsl-fec-mdio",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = fs_enet_mdio_fec_match,
|
||||
},
|
||||
.probe = fs_enet_mdio_probe,
|
||||
.remove = fs_enet_mdio_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ static int get_ucc_id_for_range(u64 start, u64 end, u32 *ucc_id)
|
|||
static int fsl_pq_mdio_probe(struct of_device *ofdev,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct device_node *tbi;
|
||||
struct fsl_pq_mdio_priv *priv;
|
||||
struct fsl_pq_mdio __iomem *regs = NULL;
|
||||
|
|
@ -471,10 +471,13 @@ static struct of_device_id fsl_pq_mdio_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, fsl_pq_mdio_match);
|
||||
|
||||
static struct of_platform_driver fsl_pq_mdio_driver = {
|
||||
.name = "fsl-pq_mdio",
|
||||
.driver = {
|
||||
.name = "fsl-pq_mdio",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = fsl_pq_mdio_match,
|
||||
},
|
||||
.probe = fsl_pq_mdio_probe,
|
||||
.remove = fsl_pq_mdio_remove,
|
||||
.match_table = fsl_pq_mdio_match,
|
||||
};
|
||||
|
||||
int __init fsl_pq_mdio_init(void)
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev)
|
|||
int err = 0, i;
|
||||
struct net_device *dev = NULL;
|
||||
struct gfar_private *priv = NULL;
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct device_node *child = NULL;
|
||||
const u32 *stash;
|
||||
const u32 *stash_len;
|
||||
|
|
@ -646,7 +646,7 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev)
|
|||
return -ENOMEM;
|
||||
|
||||
priv = netdev_priv(dev);
|
||||
priv->node = ofdev->node;
|
||||
priv->node = ofdev->dev.of_node;
|
||||
priv->ndev = dev;
|
||||
|
||||
dev->num_tx_queues = num_tx_qs;
|
||||
|
|
@ -747,8 +747,7 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev)
|
|||
FSL_GIANFAR_DEV_HAS_CSUM |
|
||||
FSL_GIANFAR_DEV_HAS_VLAN |
|
||||
FSL_GIANFAR_DEV_HAS_MAGIC_PACKET |
|
||||
FSL_GIANFAR_DEV_HAS_EXTENDED_HASH |
|
||||
FSL_GIANFAR_DEV_HAS_TIMER;
|
||||
FSL_GIANFAR_DEV_HAS_EXTENDED_HASH;
|
||||
|
||||
ctype = of_get_property(np, "phy-connection-type", NULL);
|
||||
|
||||
|
|
@ -939,7 +938,7 @@ static int gfar_probe(struct of_device *ofdev,
|
|||
priv = netdev_priv(dev);
|
||||
priv->ndev = dev;
|
||||
priv->ofdev = ofdev;
|
||||
priv->node = ofdev->node;
|
||||
priv->node = ofdev->dev.of_node;
|
||||
SET_NETDEV_DEV(dev, &ofdev->dev);
|
||||
|
||||
spin_lock_init(&priv->bflock);
|
||||
|
|
@ -3167,12 +3166,14 @@ MODULE_DEVICE_TABLE(of, gfar_match);
|
|||
|
||||
/* Structure for a device driver */
|
||||
static struct of_platform_driver gfar_driver = {
|
||||
.name = "fsl-gianfar",
|
||||
.match_table = gfar_match,
|
||||
|
||||
.driver = {
|
||||
.name = "fsl-gianfar",
|
||||
.owner = THIS_MODULE,
|
||||
.pm = GFAR_PM_OPS,
|
||||
.of_match_table = gfar_match,
|
||||
},
|
||||
.probe = gfar_probe,
|
||||
.remove = gfar_remove,
|
||||
.driver.pm = GFAR_PM_OPS,
|
||||
};
|
||||
|
||||
static int __init gfar_init(void)
|
||||
|
|
|
|||
|
|
@ -1499,7 +1499,8 @@ static int __devinit greth_of_probe(struct of_device *ofdev, const struct of_dev
|
|||
if (i == 6) {
|
||||
const unsigned char *addr;
|
||||
int len;
|
||||
addr = of_get_property(ofdev->node, "local-mac-address", &len);
|
||||
addr = of_get_property(ofdev->dev.of_node, "local-mac-address",
|
||||
&len);
|
||||
if (addr != NULL && len == 6) {
|
||||
for (i = 0; i < 6; i++)
|
||||
macaddr[i] = (unsigned int) addr[i];
|
||||
|
|
@ -1606,14 +1607,13 @@ static struct of_device_id greth_of_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, greth_of_match);
|
||||
|
||||
static struct of_platform_driver greth_of_driver = {
|
||||
.name = "grlib-greth",
|
||||
.match_table = greth_of_match,
|
||||
.driver = {
|
||||
.name = "grlib-greth",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = greth_of_match,
|
||||
},
|
||||
.probe = greth_of_probe,
|
||||
.remove = __devexit_p(greth_of_remove),
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "grlib-greth",
|
||||
},
|
||||
};
|
||||
|
||||
static int __init greth_init(void)
|
||||
|
|
|
|||
|
|
@ -1151,8 +1151,7 @@ static int __init yam_init_driver(void)
|
|||
dev = alloc_netdev(sizeof(struct yam_port), name,
|
||||
yam_setup);
|
||||
if (!dev) {
|
||||
printk(KERN_ERR "yam: cannot allocate net device %s\n",
|
||||
dev->name);
|
||||
pr_err("yam: cannot allocate net device\n");
|
||||
err = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,8 @@ static inline void emac_report_timeout_error(struct emac_instance *dev,
|
|||
EMAC_FTR_440EP_PHY_CLK_FIX))
|
||||
DBG(dev, "%s" NL, error);
|
||||
else if (net_ratelimit())
|
||||
printk(KERN_ERR "%s: %s\n", dev->ofdev->node->full_name, error);
|
||||
printk(KERN_ERR "%s: %s\n", dev->ofdev->dev.of_node->full_name,
|
||||
error);
|
||||
}
|
||||
|
||||
/* EMAC PHY clock workaround:
|
||||
|
|
@ -2185,7 +2186,7 @@ static void emac_ethtool_get_drvinfo(struct net_device *ndev,
|
|||
strcpy(info->version, DRV_VERSION);
|
||||
info->fw_version[0] = '\0';
|
||||
sprintf(info->bus_info, "PPC 4xx EMAC-%d %s",
|
||||
dev->cell_index, dev->ofdev->node->full_name);
|
||||
dev->cell_index, dev->ofdev->dev.of_node->full_name);
|
||||
info->regdump_len = emac_ethtool_get_regs_len(ndev);
|
||||
}
|
||||
|
||||
|
|
@ -2379,7 +2380,7 @@ static int __devinit emac_read_uint_prop(struct device_node *np, const char *nam
|
|||
|
||||
static int __devinit emac_init_phy(struct emac_instance *dev)
|
||||
{
|
||||
struct device_node *np = dev->ofdev->node;
|
||||
struct device_node *np = dev->ofdev->dev.of_node;
|
||||
struct net_device *ndev = dev->ndev;
|
||||
u32 phy_map, adv;
|
||||
int i;
|
||||
|
|
@ -2514,7 +2515,7 @@ static int __devinit emac_init_phy(struct emac_instance *dev)
|
|||
|
||||
static int __devinit emac_init_config(struct emac_instance *dev)
|
||||
{
|
||||
struct device_node *np = dev->ofdev->node;
|
||||
struct device_node *np = dev->ofdev->dev.of_node;
|
||||
const void *p;
|
||||
unsigned int plen;
|
||||
const char *pm, *phy_modes[] = {
|
||||
|
|
@ -2723,7 +2724,7 @@ static int __devinit emac_probe(struct of_device *ofdev,
|
|||
{
|
||||
struct net_device *ndev;
|
||||
struct emac_instance *dev;
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct device_node **blist = NULL;
|
||||
int err, i;
|
||||
|
||||
|
|
@ -2810,7 +2811,7 @@ static int __devinit emac_probe(struct of_device *ofdev,
|
|||
err = mal_register_commac(dev->mal, &dev->commac);
|
||||
if (err) {
|
||||
printk(KERN_ERR "%s: failed to register with mal %s!\n",
|
||||
np->full_name, dev->mal_dev->node->full_name);
|
||||
np->full_name, dev->mal_dev->dev.of_node->full_name);
|
||||
goto err_rel_deps;
|
||||
}
|
||||
dev->rx_skb_size = emac_rx_skb_size(ndev->mtu);
|
||||
|
|
@ -2995,9 +2996,11 @@ static struct of_device_id emac_match[] =
|
|||
MODULE_DEVICE_TABLE(of, emac_match);
|
||||
|
||||
static struct of_platform_driver emac_driver = {
|
||||
.name = "emac",
|
||||
.match_table = emac_match,
|
||||
|
||||
.driver = {
|
||||
.name = "emac",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = emac_match,
|
||||
},
|
||||
.probe = emac_probe,
|
||||
.remove = emac_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ static void emac_desc_dump(struct emac_instance *p)
|
|||
int i;
|
||||
printk("** EMAC %s TX BDs **\n"
|
||||
" tx_cnt = %d tx_slot = %d ack_slot = %d\n",
|
||||
p->ofdev->node->full_name,
|
||||
p->ofdev->dev.of_node->full_name,
|
||||
p->tx_cnt, p->tx_slot, p->ack_slot);
|
||||
for (i = 0; i < NUM_TX_BUFF / 2; ++i)
|
||||
printk
|
||||
|
|
@ -49,7 +49,7 @@ static void emac_desc_dump(struct emac_instance *p)
|
|||
printk("** EMAC %s RX BDs **\n"
|
||||
" rx_slot = %d flags = 0x%lx rx_skb_size = %d rx_sync_size = %d\n"
|
||||
" rx_sg_skb = 0x%p\n",
|
||||
p->ofdev->node->full_name,
|
||||
p->ofdev->dev.of_node->full_name,
|
||||
p->rx_slot, p->commac.flags, p->rx_skb_size,
|
||||
p->rx_sync_size, p->rx_sg_skb);
|
||||
for (i = 0; i < NUM_RX_BUFF / 2; ++i)
|
||||
|
|
@ -77,7 +77,8 @@ static void emac_mac_dump(struct emac_instance *dev)
|
|||
"MR0 = 0x%08x MR1 = 0x%08x TMR0 = 0x%08x TMR1 = 0x%08x\n"
|
||||
"RMR = 0x%08x ISR = 0x%08x ISER = 0x%08x\n"
|
||||
"IAR = %04x%08x VTPID = 0x%04x VTCI = 0x%04x\n",
|
||||
dev->ofdev->node->full_name, in_be32(&p->mr0), in_be32(&p->mr1),
|
||||
dev->ofdev->dev.of_node->full_name,
|
||||
in_be32(&p->mr0), in_be32(&p->mr1),
|
||||
in_be32(&p->tmr0), in_be32(&p->tmr1),
|
||||
in_be32(&p->rmr), in_be32(&p->isr), in_be32(&p->iser),
|
||||
in_be32(&p->iahr), in_be32(&p->ialr), in_be32(&p->vtpid),
|
||||
|
|
@ -128,7 +129,7 @@ static void emac_mal_dump(struct mal_instance *mal)
|
|||
"CFG = 0x%08x ESR = 0x%08x IER = 0x%08x\n"
|
||||
"TX|CASR = 0x%08x CARR = 0x%08x EOBISR = 0x%08x DEIR = 0x%08x\n"
|
||||
"RX|CASR = 0x%08x CARR = 0x%08x EOBISR = 0x%08x DEIR = 0x%08x\n",
|
||||
mal->ofdev->node->full_name,
|
||||
mal->ofdev->dev.of_node->full_name,
|
||||
get_mal_dcrn(mal, MAL_CFG), get_mal_dcrn(mal, MAL_ESR),
|
||||
get_mal_dcrn(mal, MAL_IER),
|
||||
get_mal_dcrn(mal, MAL_TXCASR), get_mal_dcrn(mal, MAL_TXCARR),
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ extern void emac_dbg_dump_all(void);
|
|||
|
||||
#endif
|
||||
|
||||
#define EMAC_DBG(dev, name, fmt, arg...) \
|
||||
printk(KERN_DEBUG #name "%s: " fmt, dev->ofdev->node->full_name, ## arg)
|
||||
#define EMAC_DBG(d, name, fmt, arg...) \
|
||||
printk(KERN_DEBUG #name "%s: " fmt, d->ofdev->dev.of_node->full_name, ## arg)
|
||||
|
||||
#if DBG_LEVEL > 0
|
||||
# define DBG(d,f,x...) EMAC_DBG(d, emac, f, ##x)
|
||||
|
|
|
|||
|
|
@ -538,11 +538,11 @@ static int __devinit mal_probe(struct of_device *ofdev,
|
|||
}
|
||||
mal->index = index;
|
||||
mal->ofdev = ofdev;
|
||||
mal->version = of_device_is_compatible(ofdev->node, "ibm,mcmal2") ? 2 : 1;
|
||||
mal->version = of_device_is_compatible(ofdev->dev.of_node, "ibm,mcmal2") ? 2 : 1;
|
||||
|
||||
MAL_DBG(mal, "probe" NL);
|
||||
|
||||
prop = of_get_property(ofdev->node, "num-tx-chans", NULL);
|
||||
prop = of_get_property(ofdev->dev.of_node, "num-tx-chans", NULL);
|
||||
if (prop == NULL) {
|
||||
printk(KERN_ERR
|
||||
"mal%d: can't find MAL num-tx-chans property!\n",
|
||||
|
|
@ -552,7 +552,7 @@ static int __devinit mal_probe(struct of_device *ofdev,
|
|||
}
|
||||
mal->num_tx_chans = prop[0];
|
||||
|
||||
prop = of_get_property(ofdev->node, "num-rx-chans", NULL);
|
||||
prop = of_get_property(ofdev->dev.of_node, "num-rx-chans", NULL);
|
||||
if (prop == NULL) {
|
||||
printk(KERN_ERR
|
||||
"mal%d: can't find MAL num-rx-chans property!\n",
|
||||
|
|
@ -562,14 +562,14 @@ static int __devinit mal_probe(struct of_device *ofdev,
|
|||
}
|
||||
mal->num_rx_chans = prop[0];
|
||||
|
||||
dcr_base = dcr_resource_start(ofdev->node, 0);
|
||||
dcr_base = dcr_resource_start(ofdev->dev.of_node, 0);
|
||||
if (dcr_base == 0) {
|
||||
printk(KERN_ERR
|
||||
"mal%d: can't find DCR resource!\n", index);
|
||||
err = -ENODEV;
|
||||
goto fail;
|
||||
}
|
||||
mal->dcr_host = dcr_map(ofdev->node, dcr_base, 0x100);
|
||||
mal->dcr_host = dcr_map(ofdev->dev.of_node, dcr_base, 0x100);
|
||||
if (!DCR_MAP_OK(mal->dcr_host)) {
|
||||
printk(KERN_ERR
|
||||
"mal%d: failed to map DCRs !\n", index);
|
||||
|
|
@ -577,28 +577,28 @@ static int __devinit mal_probe(struct of_device *ofdev,
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if (of_device_is_compatible(ofdev->node, "ibm,mcmal-405ez")) {
|
||||
if (of_device_is_compatible(ofdev->dev.of_node, "ibm,mcmal-405ez")) {
|
||||
#if defined(CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT) && \
|
||||
defined(CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR)
|
||||
mal->features |= (MAL_FTR_CLEAR_ICINTSTAT |
|
||||
MAL_FTR_COMMON_ERR_INT);
|
||||
#else
|
||||
printk(KERN_ERR "%s: Support for 405EZ not enabled!\n",
|
||||
ofdev->node->full_name);
|
||||
ofdev->dev.of_node->full_name);
|
||||
err = -ENODEV;
|
||||
goto fail;
|
||||
#endif
|
||||
}
|
||||
|
||||
mal->txeob_irq = irq_of_parse_and_map(ofdev->node, 0);
|
||||
mal->rxeob_irq = irq_of_parse_and_map(ofdev->node, 1);
|
||||
mal->serr_irq = irq_of_parse_and_map(ofdev->node, 2);
|
||||
mal->txeob_irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
|
||||
mal->rxeob_irq = irq_of_parse_and_map(ofdev->dev.of_node, 1);
|
||||
mal->serr_irq = irq_of_parse_and_map(ofdev->dev.of_node, 2);
|
||||
|
||||
if (mal_has_feature(mal, MAL_FTR_COMMON_ERR_INT)) {
|
||||
mal->txde_irq = mal->rxde_irq = mal->serr_irq;
|
||||
} else {
|
||||
mal->txde_irq = irq_of_parse_and_map(ofdev->node, 3);
|
||||
mal->rxde_irq = irq_of_parse_and_map(ofdev->node, 4);
|
||||
mal->txde_irq = irq_of_parse_and_map(ofdev->dev.of_node, 3);
|
||||
mal->rxde_irq = irq_of_parse_and_map(ofdev->dev.of_node, 4);
|
||||
}
|
||||
|
||||
if (mal->txeob_irq == NO_IRQ || mal->rxeob_irq == NO_IRQ ||
|
||||
|
|
@ -629,7 +629,7 @@ static int __devinit mal_probe(struct of_device *ofdev,
|
|||
/* Current Axon is not happy with priority being non-0, it can
|
||||
* deadlock, fix it up here
|
||||
*/
|
||||
if (of_device_is_compatible(ofdev->node, "ibm,mcmal-axon"))
|
||||
if (of_device_is_compatible(ofdev->dev.of_node, "ibm,mcmal-axon"))
|
||||
cfg &= ~(MAL2_CFG_RPP_10 | MAL2_CFG_WPP_10);
|
||||
|
||||
/* Apply configuration */
|
||||
|
|
@ -701,7 +701,7 @@ static int __devinit mal_probe(struct of_device *ofdev,
|
|||
|
||||
printk(KERN_INFO
|
||||
"MAL v%d %s, %d TX channels, %d RX channels\n",
|
||||
mal->version, ofdev->node->full_name,
|
||||
mal->version, ofdev->dev.of_node->full_name,
|
||||
mal->num_tx_chans, mal->num_rx_chans);
|
||||
|
||||
/* Advertise this instance to the rest of the world */
|
||||
|
|
@ -790,9 +790,11 @@ static struct of_device_id mal_platform_match[] =
|
|||
};
|
||||
|
||||
static struct of_platform_driver mal_of_driver = {
|
||||
.name = "mcmal",
|
||||
.match_table = mal_platform_match,
|
||||
|
||||
.driver = {
|
||||
.name = "mcmal",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mal_platform_match,
|
||||
},
|
||||
.probe = mal_probe,
|
||||
.remove = mal_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ int __devinit rgmii_attach(struct of_device *ofdev, int input, int mode)
|
|||
/* Check if we need to attach to a RGMII */
|
||||
if (input < 0 || !rgmii_valid_mode(mode)) {
|
||||
printk(KERN_ERR "%s: unsupported settings !\n",
|
||||
ofdev->node->full_name);
|
||||
ofdev->dev.of_node->full_name);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
@ -113,7 +113,7 @@ int __devinit rgmii_attach(struct of_device *ofdev, int input, int mode)
|
|||
out_be32(&p->fer, in_be32(&p->fer) | rgmii_mode_mask(mode, input));
|
||||
|
||||
printk(KERN_NOTICE "%s: input %d in %s mode\n",
|
||||
ofdev->node->full_name, input, rgmii_mode_name(mode));
|
||||
ofdev->dev.of_node->full_name, input, rgmii_mode_name(mode));
|
||||
|
||||
++dev->users;
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ void *rgmii_dump_regs(struct of_device *ofdev, void *buf)
|
|||
static int __devinit rgmii_probe(struct of_device *ofdev,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct rgmii_instance *dev;
|
||||
struct resource regs;
|
||||
int rc;
|
||||
|
|
@ -264,11 +264,11 @@ static int __devinit rgmii_probe(struct of_device *ofdev,
|
|||
}
|
||||
|
||||
/* Check for RGMII flags */
|
||||
if (of_get_property(ofdev->node, "has-mdio", NULL))
|
||||
if (of_get_property(ofdev->dev.of_node, "has-mdio", NULL))
|
||||
dev->flags |= EMAC_RGMII_FLAG_HAS_MDIO;
|
||||
|
||||
/* CAB lacks the right properties, fix this up */
|
||||
if (of_device_is_compatible(ofdev->node, "ibm,rgmii-axon"))
|
||||
if (of_device_is_compatible(ofdev->dev.of_node, "ibm,rgmii-axon"))
|
||||
dev->flags |= EMAC_RGMII_FLAG_HAS_MDIO;
|
||||
|
||||
DBG2(dev, " Boot FER = 0x%08x, SSR = 0x%08x\n",
|
||||
|
|
@ -279,7 +279,7 @@ static int __devinit rgmii_probe(struct of_device *ofdev,
|
|||
|
||||
printk(KERN_INFO
|
||||
"RGMII %s initialized with%s MDIO support\n",
|
||||
ofdev->node->full_name,
|
||||
ofdev->dev.of_node->full_name,
|
||||
(dev->flags & EMAC_RGMII_FLAG_HAS_MDIO) ? "" : "out");
|
||||
|
||||
wmb();
|
||||
|
|
@ -319,9 +319,11 @@ static struct of_device_id rgmii_match[] =
|
|||
};
|
||||
|
||||
static struct of_platform_driver rgmii_driver = {
|
||||
.name = "emac-rgmii",
|
||||
.match_table = rgmii_match,
|
||||
|
||||
.driver = {
|
||||
.name = "emac-rgmii",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = rgmii_match,
|
||||
},
|
||||
.probe = rgmii_probe,
|
||||
.remove = rgmii_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ void tah_reset(struct of_device *ofdev)
|
|||
--n;
|
||||
|
||||
if (unlikely(!n))
|
||||
printk(KERN_ERR "%s: reset timeout\n", ofdev->node->full_name);
|
||||
printk(KERN_ERR "%s: reset timeout\n",
|
||||
ofdev->dev.of_node->full_name);
|
||||
|
||||
/* 10KB TAH TX FIFO accomodates the max MTU of 9000 */
|
||||
out_be32(&p->mr,
|
||||
|
|
@ -89,7 +90,7 @@ void *tah_dump_regs(struct of_device *ofdev, void *buf)
|
|||
static int __devinit tah_probe(struct of_device *ofdev,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct tah_instance *dev;
|
||||
struct resource regs;
|
||||
int rc;
|
||||
|
|
@ -127,7 +128,7 @@ static int __devinit tah_probe(struct of_device *ofdev,
|
|||
tah_reset(ofdev);
|
||||
|
||||
printk(KERN_INFO
|
||||
"TAH %s initialized\n", ofdev->node->full_name);
|
||||
"TAH %s initialized\n", ofdev->dev.of_node->full_name);
|
||||
wmb();
|
||||
|
||||
return 0;
|
||||
|
|
@ -165,9 +166,11 @@ static struct of_device_id tah_match[] =
|
|||
};
|
||||
|
||||
static struct of_platform_driver tah_driver = {
|
||||
.name = "emac-tah",
|
||||
.match_table = tah_match,
|
||||
|
||||
.driver = {
|
||||
.name = "emac-tah",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = tah_match,
|
||||
},
|
||||
.probe = tah_probe,
|
||||
.remove = tah_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -121,13 +121,14 @@ int __devinit zmii_attach(struct of_device *ofdev, int input, int *mode)
|
|||
dev->mode = *mode;
|
||||
|
||||
printk(KERN_NOTICE "%s: bridge in %s mode\n",
|
||||
ofdev->node->full_name, zmii_mode_name(dev->mode));
|
||||
ofdev->dev.of_node->full_name,
|
||||
zmii_mode_name(dev->mode));
|
||||
} else {
|
||||
/* All inputs must use the same mode */
|
||||
if (*mode != PHY_MODE_NA && *mode != dev->mode) {
|
||||
printk(KERN_ERR
|
||||
"%s: invalid mode %d specified for input %d\n",
|
||||
ofdev->node->full_name, *mode, input);
|
||||
ofdev->dev.of_node->full_name, *mode, input);
|
||||
mutex_unlock(&dev->lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -233,7 +234,7 @@ void *zmii_dump_regs(struct of_device *ofdev, void *buf)
|
|||
static int __devinit zmii_probe(struct of_device *ofdev,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct zmii_instance *dev;
|
||||
struct resource regs;
|
||||
int rc;
|
||||
|
|
@ -273,7 +274,7 @@ static int __devinit zmii_probe(struct of_device *ofdev,
|
|||
out_be32(&dev->base->fer, 0);
|
||||
|
||||
printk(KERN_INFO
|
||||
"ZMII %s initialized\n", ofdev->node->full_name);
|
||||
"ZMII %s initialized\n", ofdev->dev.of_node->full_name);
|
||||
wmb();
|
||||
dev_set_drvdata(&ofdev->dev, dev);
|
||||
|
||||
|
|
@ -312,9 +313,11 @@ static struct of_device_id zmii_match[] =
|
|||
};
|
||||
|
||||
static struct of_platform_driver zmii_driver = {
|
||||
.name = "emac-zmii",
|
||||
.match_table = zmii_match,
|
||||
|
||||
.driver = {
|
||||
.name = "emac-zmii",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = zmii_match,
|
||||
},
|
||||
.probe = zmii_probe,
|
||||
.remove = zmii_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -107,8 +107,12 @@ static int bfin_sir_set_speed(struct bfin_sir_port *port, int speed)
|
|||
case 57600:
|
||||
case 115200:
|
||||
|
||||
quot = (port->clk + (8 * speed)) / (16 * speed)\
|
||||
- ANOMALY_05000230;
|
||||
/*
|
||||
* IRDA is not affected by anomaly 05000230, so there is no
|
||||
* need to tweak the divisor like he UART driver (which will
|
||||
* slightly speed up the baud rate on us).
|
||||
*/
|
||||
quot = (port->clk + (8 * speed)) / (16 * speed);
|
||||
|
||||
do {
|
||||
udelay(utime);
|
||||
|
|
|
|||
|
|
@ -360,6 +360,7 @@ struct ixgbe_adapter {
|
|||
u32 flags2;
|
||||
#define IXGBE_FLAG2_RSC_CAPABLE (u32)(1)
|
||||
#define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1)
|
||||
#define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2)
|
||||
/* default to trying for four seconds */
|
||||
#define IXGBE_TRY_LINK_TIMEOUT (4 * HZ)
|
||||
|
||||
|
|
@ -407,6 +408,8 @@ struct ixgbe_adapter {
|
|||
u16 eeprom_version;
|
||||
|
||||
int node;
|
||||
struct work_struct check_overtemp_task;
|
||||
u32 interrupt_event;
|
||||
|
||||
/* SR-IOV */
|
||||
DECLARE_BITMAP(active_vfs, IXGBE_MAX_VF_FUNCTIONS);
|
||||
|
|
|
|||
|
|
@ -1236,6 +1236,7 @@ static struct ixgbe_phy_operations phy_ops_82598 = {
|
|||
.setup_link = &ixgbe_setup_phy_link_generic,
|
||||
.setup_link_speed = &ixgbe_setup_phy_link_speed_generic,
|
||||
.read_i2c_eeprom = &ixgbe_read_i2c_eeprom_82598,
|
||||
.check_overtemp = &ixgbe_tn_check_overtemp,
|
||||
};
|
||||
|
||||
struct ixgbe_info ixgbe_82598_info = {
|
||||
|
|
|
|||
|
|
@ -2395,6 +2395,7 @@ static struct ixgbe_phy_operations phy_ops_82599 = {
|
|||
.write_i2c_byte = &ixgbe_write_i2c_byte_generic,
|
||||
.read_i2c_eeprom = &ixgbe_read_i2c_eeprom_generic,
|
||||
.write_i2c_eeprom = &ixgbe_write_i2c_eeprom_generic,
|
||||
.check_overtemp = &ixgbe_tn_check_overtemp,
|
||||
};
|
||||
|
||||
struct ixgbe_info ixgbe_82599_info = {
|
||||
|
|
|
|||
|
|
@ -1188,6 +1188,7 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
|
|||
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
|
||||
} else {
|
||||
hw_dbg(hw, "RAR index %d is out of range.\n", index);
|
||||
return IXGBE_ERR_RAR_INDEX;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -1219,6 +1220,7 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index)
|
|||
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
|
||||
} else {
|
||||
hw_dbg(hw, "RAR index %d is out of range.\n", index);
|
||||
return IXGBE_ERR_RAR_INDEX;
|
||||
}
|
||||
|
||||
/* clear VMDq pool/queue selection for this RAR */
|
||||
|
|
|
|||
|
|
@ -108,6 +108,8 @@ static DEFINE_PCI_DEVICE_TABLE(ixgbe_pci_tbl) = {
|
|||
board_82599 },
|
||||
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4),
|
||||
board_82599 },
|
||||
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_T3_LOM),
|
||||
board_82599 },
|
||||
{PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_COMBO_BACKPLANE),
|
||||
board_82599 },
|
||||
|
||||
|
|
@ -640,7 +642,7 @@ static inline bool ixgbe_tx_xon_state(struct ixgbe_adapter *adapter,
|
|||
u32 txoff = IXGBE_TFCS_TXOFF;
|
||||
|
||||
#ifdef CONFIG_IXGBE_DCB
|
||||
if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
|
||||
if (adapter->dcb_cfg.pfc_mode_enable) {
|
||||
int tc;
|
||||
int reg_idx = tx_ring->reg_idx;
|
||||
int dcb_i = adapter->ring_feature[RING_F_DCB].indices;
|
||||
|
|
@ -1618,6 +1620,48 @@ static void ixgbe_set_itr_msix(struct ixgbe_q_vector *q_vector)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_check_overtemp_task - worker thread to check over tempurature
|
||||
* @work: pointer to work_struct containing our data
|
||||
**/
|
||||
static void ixgbe_check_overtemp_task(struct work_struct *work)
|
||||
{
|
||||
struct ixgbe_adapter *adapter = container_of(work,
|
||||
struct ixgbe_adapter,
|
||||
check_overtemp_task);
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
u32 eicr = adapter->interrupt_event;
|
||||
|
||||
if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) {
|
||||
switch (hw->device_id) {
|
||||
case IXGBE_DEV_ID_82599_T3_LOM: {
|
||||
u32 autoneg;
|
||||
bool link_up = false;
|
||||
|
||||
if (hw->mac.ops.check_link)
|
||||
hw->mac.ops.check_link(hw, &autoneg, &link_up, false);
|
||||
|
||||
if (((eicr & IXGBE_EICR_GPI_SDP0) && (!link_up)) ||
|
||||
(eicr & IXGBE_EICR_LSC))
|
||||
/* Check if this is due to overtemp */
|
||||
if (hw->phy.ops.check_overtemp(hw) == IXGBE_ERR_OVERTEMP)
|
||||
break;
|
||||
}
|
||||
return;
|
||||
default:
|
||||
if (!(eicr & IXGBE_EICR_GPI_SDP0))
|
||||
return;
|
||||
break;
|
||||
}
|
||||
DPRINTK(DRV, ERR, "Network adapter has been stopped because it "
|
||||
"has over heated. Restart the computer. If the problem "
|
||||
"persists, power off the system and replace the "
|
||||
"adapter\n");
|
||||
/* write to clear the interrupt */
|
||||
IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0);
|
||||
}
|
||||
}
|
||||
|
||||
static void ixgbe_check_fan_failure(struct ixgbe_adapter *adapter, u32 eicr)
|
||||
{
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
|
|
@ -1689,6 +1733,10 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
|
|||
|
||||
if (hw->mac.type == ixgbe_mac_82599EB) {
|
||||
ixgbe_check_sfp_event(adapter, eicr);
|
||||
adapter->interrupt_event = eicr;
|
||||
if ((adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) &&
|
||||
((eicr & IXGBE_EICR_GPI_SDP0) || (eicr & IXGBE_EICR_LSC)))
|
||||
schedule_work(&adapter->check_overtemp_task);
|
||||
|
||||
/* Handle Flow Director Full threshold interrupt */
|
||||
if (eicr & IXGBE_EICR_FLOW_DIR) {
|
||||
|
|
@ -2190,6 +2238,8 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter)
|
|||
u32 mask;
|
||||
|
||||
mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE);
|
||||
if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE)
|
||||
mask |= IXGBE_EIMS_GPI_SDP0;
|
||||
if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE)
|
||||
mask |= IXGBE_EIMS_GPI_SDP1;
|
||||
if (adapter->hw.mac.type == ixgbe_mac_82599EB) {
|
||||
|
|
@ -2250,6 +2300,9 @@ static irqreturn_t ixgbe_intr(int irq, void *data)
|
|||
ixgbe_check_sfp_event(adapter, eicr);
|
||||
|
||||
ixgbe_check_fan_failure(adapter, eicr);
|
||||
if ((adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) &&
|
||||
((eicr & IXGBE_EICR_GPI_SDP0) || (eicr & IXGBE_EICR_LSC)))
|
||||
schedule_work(&adapter->check_overtemp_task);
|
||||
|
||||
if (napi_schedule_prep(&(q_vector->napi))) {
|
||||
adapter->tx_ring[0]->total_packets = 0;
|
||||
|
|
@ -3265,6 +3318,13 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
|
|||
IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE);
|
||||
}
|
||||
|
||||
/* Enable Thermal over heat sensor interrupt */
|
||||
if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) {
|
||||
gpie = IXGBE_READ_REG(hw, IXGBE_GPIE);
|
||||
gpie |= IXGBE_SDP0_GPIEN;
|
||||
IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie);
|
||||
}
|
||||
|
||||
/* Enable fan failure interrupt if media type is copper */
|
||||
if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) {
|
||||
gpie = IXGBE_READ_REG(hw, IXGBE_GPIE);
|
||||
|
|
@ -3666,6 +3726,9 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
|
|||
adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)
|
||||
cancel_work_sync(&adapter->fdir_reinit_task);
|
||||
|
||||
if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE)
|
||||
cancel_work_sync(&adapter->check_overtemp_task);
|
||||
|
||||
/* disable transmits in the hardware now that interrupts are off */
|
||||
for (i = 0; i < adapter->num_tx_queues; i++) {
|
||||
j = adapter->tx_ring[i]->reg_idx;
|
||||
|
|
@ -4645,6 +4708,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
|
|||
adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599;
|
||||
adapter->flags2 |= IXGBE_FLAG2_RSC_CAPABLE;
|
||||
adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED;
|
||||
if (hw->device_id == IXGBE_DEV_ID_82599_T3_LOM)
|
||||
adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_CAPABLE;
|
||||
if (dev->features & NETIF_F_NTUPLE) {
|
||||
/* Flow Director perfect filter enabled */
|
||||
adapter->flags |= IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
|
||||
|
|
@ -6561,7 +6626,9 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||
}
|
||||
|
||||
/* reset_hw fills in the perm_addr as well */
|
||||
hw->phy.reset_if_overtemp = true;
|
||||
err = hw->mac.ops.reset_hw(hw);
|
||||
hw->phy.reset_if_overtemp = false;
|
||||
if (err == IXGBE_ERR_SFP_NOT_PRESENT &&
|
||||
hw->mac.type == ixgbe_mac_82598EB) {
|
||||
/*
|
||||
|
|
@ -6730,6 +6797,8 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
|
|||
adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)
|
||||
INIT_WORK(&adapter->fdir_reinit_task, ixgbe_fdir_reinit_task);
|
||||
|
||||
if (adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE)
|
||||
INIT_WORK(&adapter->check_overtemp_task, ixgbe_check_overtemp_task);
|
||||
#ifdef CONFIG_IXGBE_DCA
|
||||
if (dca_add_requester(&pdev->dev) == 0) {
|
||||
adapter->flags |= IXGBE_FLAG_DCA_ENABLED;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,11 @@ static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
|
|||
**/
|
||||
s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
|
||||
{
|
||||
/* Don't reset PHY if it's shut down due to overtemp. */
|
||||
if (!hw->phy.reset_if_overtemp &&
|
||||
(IXGBE_ERR_OVERTEMP == hw->phy.ops.check_overtemp(hw)))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Perform soft PHY reset to the PHY_XS.
|
||||
* This will cause a soft reset to the PHY
|
||||
|
|
@ -1345,3 +1350,28 @@ s32 ixgbe_get_phy_firmware_version_tnx(struct ixgbe_hw *hw,
|
|||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_tn_check_overtemp - Checks if an overtemp occured.
|
||||
* @hw: pointer to hardware structure
|
||||
*
|
||||
* Checks if the LASI temp alarm status was triggered due to overtemp
|
||||
**/
|
||||
s32 ixgbe_tn_check_overtemp(struct ixgbe_hw *hw)
|
||||
{
|
||||
s32 status = 0;
|
||||
u16 phy_data = 0;
|
||||
|
||||
if (hw->device_id != IXGBE_DEV_ID_82599_T3_LOM)
|
||||
goto out;
|
||||
|
||||
/* Check that the LASI temp alarm status was triggered */
|
||||
hw->phy.ops.read_reg(hw, IXGBE_TN_LASI_STATUS_REG,
|
||||
MDIO_MMD_PMAPMD, &phy_data);
|
||||
|
||||
if (!(phy_data & IXGBE_TN_LASI_STATUS_TEMP_ALARM))
|
||||
goto out;
|
||||
|
||||
status = IXGBE_ERR_OVERTEMP;
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@
|
|||
#define IXGBE_I2C_T_SU_STO 4
|
||||
#define IXGBE_I2C_T_BUF 5
|
||||
|
||||
#define IXGBE_TN_LASI_STATUS_REG 0x9005
|
||||
#define IXGBE_TN_LASI_STATUS_TEMP_ALARM 0x0008
|
||||
|
||||
s32 ixgbe_init_phy_ops_generic(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw);
|
||||
|
|
@ -106,6 +108,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw);
|
|||
s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
|
||||
u16 *list_offset,
|
||||
u16 *data_offset);
|
||||
s32 ixgbe_tn_check_overtemp(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_read_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
|
||||
u8 dev_addr, u8 *data);
|
||||
s32 ixgbe_write_i2c_byte_generic(struct ixgbe_hw *hw, u8 byte_offset,
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
#define IXGBE_DEV_ID_82599_KX4 0x10F7
|
||||
#define IXGBE_DEV_ID_82599_KX4_MEZZ 0x1514
|
||||
#define IXGBE_DEV_ID_82599_KR 0x1517
|
||||
#define IXGBE_DEV_ID_82599_T3_LOM 0x151C
|
||||
#define IXGBE_DEV_ID_82599_CX4 0x10F9
|
||||
#define IXGBE_DEV_ID_82599_SFP 0x10FB
|
||||
#define IXGBE_DEV_ID_82599_SFP_EM 0x1507
|
||||
|
|
@ -2470,6 +2471,7 @@ struct ixgbe_phy_operations {
|
|||
s32 (*write_i2c_byte)(struct ixgbe_hw *, u8, u8, u8);
|
||||
s32 (*read_i2c_eeprom)(struct ixgbe_hw *, u8 , u8 *);
|
||||
s32 (*write_i2c_eeprom)(struct ixgbe_hw *, u8, u8);
|
||||
s32 (*check_overtemp)(struct ixgbe_hw *);
|
||||
};
|
||||
|
||||
struct ixgbe_eeprom_info {
|
||||
|
|
@ -2518,6 +2520,7 @@ struct ixgbe_phy_info {
|
|||
enum ixgbe_smart_speed smart_speed;
|
||||
bool smart_speed_active;
|
||||
bool multispeed_fiber;
|
||||
bool reset_if_overtemp;
|
||||
};
|
||||
|
||||
#include "ixgbe_mbx.h"
|
||||
|
|
@ -2605,6 +2608,8 @@ struct ixgbe_info {
|
|||
#define IXGBE_ERR_FDIR_REINIT_FAILED -23
|
||||
#define IXGBE_ERR_EEPROM_VERSION -24
|
||||
#define IXGBE_ERR_NO_SPACE -25
|
||||
#define IXGBE_ERR_OVERTEMP -26
|
||||
#define IXGBE_ERR_RAR_INDEX -27
|
||||
#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF
|
||||
|
||||
#endif /* _IXGBE_TYPE_H_ */
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ struct korina_private {
|
|||
struct napi_struct napi;
|
||||
struct timer_list media_check_timer;
|
||||
struct mii_if_info mii_if;
|
||||
struct work_struct restart_task;
|
||||
struct net_device *dev;
|
||||
int phy_addr;
|
||||
};
|
||||
|
|
@ -375,7 +376,7 @@ static int korina_rx(struct net_device *dev, int limit)
|
|||
if (devcs & ETH_RX_LE)
|
||||
dev->stats.rx_length_errors++;
|
||||
if (devcs & ETH_RX_OVR)
|
||||
dev->stats.rx_over_errors++;
|
||||
dev->stats.rx_fifo_errors++;
|
||||
if (devcs & ETH_RX_CV)
|
||||
dev->stats.rx_frame_errors++;
|
||||
if (devcs & ETH_RX_CES)
|
||||
|
|
@ -764,10 +765,9 @@ static int korina_alloc_ring(struct net_device *dev)
|
|||
|
||||
/* Initialize the receive descriptors */
|
||||
for (i = 0; i < KORINA_NUM_RDS; i++) {
|
||||
skb = dev_alloc_skb(KORINA_RBSIZE + 2);
|
||||
skb = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
skb_reserve(skb, 2);
|
||||
lp->rx_skb[i] = skb;
|
||||
lp->rd_ring[i].control = DMA_DESC_IOD |
|
||||
DMA_COUNT(KORINA_RBSIZE);
|
||||
|
|
@ -890,12 +890,12 @@ static int korina_init(struct net_device *dev)
|
|||
|
||||
/*
|
||||
* Restart the RC32434 ethernet controller.
|
||||
* FIXME: check the return status where we call it
|
||||
*/
|
||||
static int korina_restart(struct net_device *dev)
|
||||
static void korina_restart_task(struct work_struct *work)
|
||||
{
|
||||
struct korina_private *lp = netdev_priv(dev);
|
||||
int ret;
|
||||
struct korina_private *lp = container_of(work,
|
||||
struct korina_private, restart_task);
|
||||
struct net_device *dev = lp->dev;
|
||||
|
||||
/*
|
||||
* Disable interrupts
|
||||
|
|
@ -916,10 +916,9 @@ static int korina_restart(struct net_device *dev)
|
|||
|
||||
napi_disable(&lp->napi);
|
||||
|
||||
ret = korina_init(dev);
|
||||
if (ret < 0) {
|
||||
if (korina_init(dev) < 0) {
|
||||
printk(KERN_ERR "%s: cannot restart device\n", dev->name);
|
||||
return ret;
|
||||
return;
|
||||
}
|
||||
korina_multicast_list(dev);
|
||||
|
||||
|
|
@ -927,8 +926,6 @@ static int korina_restart(struct net_device *dev)
|
|||
enable_irq(lp->ovr_irq);
|
||||
enable_irq(lp->tx_irq);
|
||||
enable_irq(lp->rx_irq);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void korina_clear_and_restart(struct net_device *dev, u32 value)
|
||||
|
|
@ -937,7 +934,7 @@ static void korina_clear_and_restart(struct net_device *dev, u32 value)
|
|||
|
||||
netif_stop_queue(dev);
|
||||
writel(value, &lp->eth_regs->ethintfc);
|
||||
korina_restart(dev);
|
||||
schedule_work(&lp->restart_task);
|
||||
}
|
||||
|
||||
/* Ethernet Tx Underflow interrupt */
|
||||
|
|
@ -962,11 +959,8 @@ static irqreturn_t korina_und_interrupt(int irq, void *dev_id)
|
|||
static void korina_tx_timeout(struct net_device *dev)
|
||||
{
|
||||
struct korina_private *lp = netdev_priv(dev);
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&lp->lock, flags);
|
||||
korina_restart(dev);
|
||||
spin_unlock_irqrestore(&lp->lock, flags);
|
||||
schedule_work(&lp->restart_task);
|
||||
}
|
||||
|
||||
/* Ethernet Rx Overflow interrupt */
|
||||
|
|
@ -1086,6 +1080,8 @@ static int korina_close(struct net_device *dev)
|
|||
|
||||
napi_disable(&lp->napi);
|
||||
|
||||
cancel_work_sync(&lp->restart_task);
|
||||
|
||||
free_irq(lp->rx_irq, dev);
|
||||
free_irq(lp->tx_irq, dev);
|
||||
free_irq(lp->ovr_irq, dev);
|
||||
|
|
@ -1198,6 +1194,8 @@ static int korina_probe(struct platform_device *pdev)
|
|||
}
|
||||
setup_timer(&lp->media_check_timer, korina_poll_media, (unsigned long) dev);
|
||||
|
||||
INIT_WORK(&lp->restart_task, korina_restart_task);
|
||||
|
||||
printk(KERN_INFO "%s: " DRV_NAME "-" DRV_VERSION " " DRV_RELDATE "\n",
|
||||
dev->name);
|
||||
out:
|
||||
|
|
|
|||
|
|
@ -4854,7 +4854,7 @@ static inline void copy_old_skb(struct sk_buff *old, struct sk_buff *skb)
|
|||
*
|
||||
* Return 0 if successful; otherwise an error code indicating failure.
|
||||
*/
|
||||
static int netdev_tx(struct sk_buff *skb, struct net_device *dev)
|
||||
static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct dev_priv *priv = netdev_priv(dev);
|
||||
struct dev_info *hw_priv = priv->adapter;
|
||||
|
|
@ -6863,6 +6863,7 @@ static const struct net_device_ops netdev_ops = {
|
|||
.ndo_tx_timeout = netdev_tx_timeout,
|
||||
.ndo_change_mtu = netdev_change_mtu,
|
||||
.ndo_set_mac_address = netdev_set_mac_address,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_do_ioctl = netdev_ioctl,
|
||||
.ndo_set_rx_mode = netdev_set_rx_mode,
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
|
|
|
|||
|
|
@ -295,6 +295,10 @@ This option defaults to enabled (set) */
|
|||
|
||||
#define MULTICAST_CAM_TABLE_NUM 4
|
||||
|
||||
/* TEMAC Synthesis features */
|
||||
#define TEMAC_FEATURE_RX_CSUM (1 << 0)
|
||||
#define TEMAC_FEATURE_TX_CSUM (1 << 1)
|
||||
|
||||
/* TX/RX CURDESC_PTR points to first descriptor */
|
||||
/* TX/RX TAILDESC_PTR points to last descriptor in linked list */
|
||||
|
||||
|
|
@ -353,6 +357,7 @@ struct temac_local {
|
|||
struct mutex indirect_mutex;
|
||||
u32 options; /* Current options word */
|
||||
int last_link;
|
||||
unsigned int temac_features;
|
||||
|
||||
/* Buffer descriptors */
|
||||
struct cdmac_bd *tx_bd_v;
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ static int temac_dma_bd_init(struct net_device *ndev)
|
|||
CHNL_CTRL_IRQ_COAL_EN);
|
||||
/* 0x10220483 */
|
||||
/* 0x00100483 */
|
||||
lp->dma_out(lp, RX_CHNL_CTRL, 0xff010000 |
|
||||
lp->dma_out(lp, RX_CHNL_CTRL, 0xff070000 |
|
||||
CHNL_CTRL_IRQ_EN |
|
||||
CHNL_CTRL_IRQ_DLY_EN |
|
||||
CHNL_CTRL_IRQ_COAL_EN |
|
||||
|
|
@ -574,6 +574,10 @@ static void temac_start_xmit_done(struct net_device *ndev)
|
|||
if (cur_p->app4)
|
||||
dev_kfree_skb_irq((struct sk_buff *)cur_p->app4);
|
||||
cur_p->app0 = 0;
|
||||
cur_p->app1 = 0;
|
||||
cur_p->app2 = 0;
|
||||
cur_p->app3 = 0;
|
||||
cur_p->app4 = 0;
|
||||
|
||||
ndev->stats.tx_packets++;
|
||||
ndev->stats.tx_bytes += cur_p->len;
|
||||
|
|
@ -589,6 +593,29 @@ static void temac_start_xmit_done(struct net_device *ndev)
|
|||
netif_wake_queue(ndev);
|
||||
}
|
||||
|
||||
static inline int temac_check_tx_bd_space(struct temac_local *lp, int num_frag)
|
||||
{
|
||||
struct cdmac_bd *cur_p;
|
||||
int tail;
|
||||
|
||||
tail = lp->tx_bd_tail;
|
||||
cur_p = &lp->tx_bd_v[tail];
|
||||
|
||||
do {
|
||||
if (cur_p->app0)
|
||||
return NETDEV_TX_BUSY;
|
||||
|
||||
tail++;
|
||||
if (tail >= TX_BD_NUM)
|
||||
tail = 0;
|
||||
|
||||
cur_p = &lp->tx_bd_v[tail];
|
||||
num_frag--;
|
||||
} while (num_frag >= 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
||||
{
|
||||
struct temac_local *lp = netdev_priv(ndev);
|
||||
|
|
@ -603,7 +630,7 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|||
start_p = lp->tx_bd_p + sizeof(*lp->tx_bd_v) * lp->tx_bd_tail;
|
||||
cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
|
||||
|
||||
if (cur_p->app0 & STS_CTRL_APP0_CMPLT) {
|
||||
if (temac_check_tx_bd_space(lp, num_frag)) {
|
||||
if (!netif_queue_stopped(ndev)) {
|
||||
netif_stop_queue(ndev);
|
||||
return NETDEV_TX_BUSY;
|
||||
|
|
@ -613,29 +640,14 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
|
|||
|
||||
cur_p->app0 = 0;
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
const struct iphdr *ip = ip_hdr(skb);
|
||||
int length = 0, start = 0, insert = 0;
|
||||
unsigned int csum_start_off = skb_transport_offset(skb);
|
||||
unsigned int csum_index_off = csum_start_off + skb->csum_offset;
|
||||
|
||||
switch (ip->protocol) {
|
||||
case IPPROTO_TCP:
|
||||
start = sizeof(struct iphdr) + ETH_HLEN;
|
||||
insert = sizeof(struct iphdr) + ETH_HLEN + 16;
|
||||
length = ip->tot_len - sizeof(struct iphdr);
|
||||
break;
|
||||
case IPPROTO_UDP:
|
||||
start = sizeof(struct iphdr) + ETH_HLEN;
|
||||
insert = sizeof(struct iphdr) + ETH_HLEN + 6;
|
||||
length = ip->tot_len - sizeof(struct iphdr);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
cur_p->app1 = ((start << 16) | insert);
|
||||
cur_p->app2 = csum_tcpudp_magic(ip->saddr, ip->daddr,
|
||||
length, ip->protocol, 0);
|
||||
skb->data[insert] = 0;
|
||||
skb->data[insert + 1] = 0;
|
||||
cur_p->app0 |= 1; /* TX Checksum Enabled */
|
||||
cur_p->app1 = (csum_start_off << 16) | csum_index_off;
|
||||
cur_p->app2 = 0; /* initial checksum seed */
|
||||
}
|
||||
|
||||
cur_p->app0 |= STS_CTRL_APP0_SOP;
|
||||
cur_p->len = skb_headlen(skb);
|
||||
cur_p->phys = dma_map_single(ndev->dev.parent, skb->data, skb->len,
|
||||
|
|
@ -699,6 +711,15 @@ static void ll_temac_recv(struct net_device *ndev)
|
|||
skb->protocol = eth_type_trans(skb, ndev);
|
||||
skb->ip_summed = CHECKSUM_NONE;
|
||||
|
||||
/* if we're doing rx csum offload, set it up */
|
||||
if (((lp->temac_features & TEMAC_FEATURE_RX_CSUM) != 0) &&
|
||||
(skb->protocol == __constant_htons(ETH_P_IP)) &&
|
||||
(skb->len > 64)) {
|
||||
|
||||
skb->csum = cur_p->app3 & 0xFFFF;
|
||||
skb->ip_summed = CHECKSUM_COMPLETE;
|
||||
}
|
||||
|
||||
netif_rx(skb);
|
||||
|
||||
ndev->stats.rx_packets++;
|
||||
|
|
@ -883,6 +904,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
|
|||
struct temac_local *lp;
|
||||
struct net_device *ndev;
|
||||
const void *addr;
|
||||
__be32 *p;
|
||||
int size, rc = 0;
|
||||
|
||||
/* Init network device structure */
|
||||
|
|
@ -920,14 +942,26 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
|
|||
mutex_init(&lp->indirect_mutex);
|
||||
|
||||
/* map device registers */
|
||||
lp->regs = of_iomap(op->node, 0);
|
||||
lp->regs = of_iomap(op->dev.of_node, 0);
|
||||
if (!lp->regs) {
|
||||
dev_err(&op->dev, "could not map temac regs.\n");
|
||||
goto nodev;
|
||||
}
|
||||
|
||||
/* Setup checksum offload, but default to off if not specified */
|
||||
lp->temac_features = 0;
|
||||
p = (__be32 *)of_get_property(op->dev.of_node, "xlnx,txcsum", NULL);
|
||||
if (p && be32_to_cpu(*p)) {
|
||||
lp->temac_features |= TEMAC_FEATURE_TX_CSUM;
|
||||
/* Can checksum TCP/UDP over IPv4. */
|
||||
ndev->features |= NETIF_F_IP_CSUM;
|
||||
}
|
||||
p = (__be32 *)of_get_property(op->dev.of_node, "xlnx,rxcsum", NULL);
|
||||
if (p && be32_to_cpu(*p))
|
||||
lp->temac_features |= TEMAC_FEATURE_RX_CSUM;
|
||||
|
||||
/* Find the DMA node, map the DMA registers, and decode the DMA IRQs */
|
||||
np = of_parse_phandle(op->node, "llink-connected", 0);
|
||||
np = of_parse_phandle(op->dev.of_node, "llink-connected", 0);
|
||||
if (!np) {
|
||||
dev_err(&op->dev, "could not find DMA node\n");
|
||||
goto nodev;
|
||||
|
|
@ -950,7 +984,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
|
|||
|
||||
lp->rx_irq = irq_of_parse_and_map(np, 0);
|
||||
lp->tx_irq = irq_of_parse_and_map(np, 1);
|
||||
if (!lp->rx_irq || !lp->tx_irq) {
|
||||
if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) {
|
||||
dev_err(&op->dev, "could not determine irqs\n");
|
||||
rc = -ENOMEM;
|
||||
goto nodev;
|
||||
|
|
@ -959,7 +993,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
|
|||
of_node_put(np); /* Finished with the DMA node; drop the reference */
|
||||
|
||||
/* Retrieve the MAC address */
|
||||
addr = of_get_property(op->node, "local-mac-address", &size);
|
||||
addr = of_get_property(op->dev.of_node, "local-mac-address", &size);
|
||||
if ((!addr) || (size != 6)) {
|
||||
dev_err(&op->dev, "could not find MAC address\n");
|
||||
rc = -ENODEV;
|
||||
|
|
@ -967,11 +1001,11 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
|
|||
}
|
||||
temac_set_mac_address(ndev, (void *)addr);
|
||||
|
||||
rc = temac_mdio_setup(lp, op->node);
|
||||
rc = temac_mdio_setup(lp, op->dev.of_node);
|
||||
if (rc)
|
||||
dev_warn(&op->dev, "error registering MDIO bus\n");
|
||||
|
||||
lp->phy_node = of_parse_phandle(op->node, "phy-handle", 0);
|
||||
lp->phy_node = of_parse_phandle(op->dev.of_node, "phy-handle", 0);
|
||||
if (lp->phy_node)
|
||||
dev_dbg(lp->dev, "using PHY node %s (%p)\n", np->full_name, np);
|
||||
|
||||
|
|
@ -1024,12 +1058,12 @@ static struct of_device_id temac_of_match[] __devinitdata = {
|
|||
MODULE_DEVICE_TABLE(of, temac_of_match);
|
||||
|
||||
static struct of_platform_driver temac_of_driver = {
|
||||
.match_table = temac_of_match,
|
||||
.probe = temac_of_probe,
|
||||
.remove = __devexit_p(temac_of_remove),
|
||||
.driver = {
|
||||
.owner = THIS_MODULE,
|
||||
.name = "xilinx_temac",
|
||||
.of_match_table = temac_of_match,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -997,8 +997,11 @@ MODULE_DEVICE_TABLE (of, mace_match);
|
|||
|
||||
static struct macio_driver mace_driver =
|
||||
{
|
||||
.name = "mace",
|
||||
.match_table = mace_match,
|
||||
.driver = {
|
||||
.name = "mace",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mace_match,
|
||||
},
|
||||
.probe = mace_probe,
|
||||
.remove = mace_remove,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -634,11 +634,18 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
|
|||
|
||||
err = register_netdevice(dev);
|
||||
if (err < 0)
|
||||
return err;
|
||||
goto destroy_port;
|
||||
|
||||
list_add_tail(&vlan->list, &port->vlans);
|
||||
netif_stacked_transfer_operstate(lowerdev, dev);
|
||||
|
||||
return 0;
|
||||
|
||||
destroy_port:
|
||||
if (list_empty(&port->vlans))
|
||||
macvlan_port_destroy(lowerdev);
|
||||
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(macvlan_common_newlink);
|
||||
|
||||
|
|
|
|||
|
|
@ -163,28 +163,30 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
|
|||
ret = mlx4_alloc_icm_pages(&chunk->mem[chunk->npages],
|
||||
cur_order, gfp_mask);
|
||||
|
||||
if (!ret) {
|
||||
++chunk->npages;
|
||||
if (ret) {
|
||||
if (--cur_order < 0)
|
||||
goto fail;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
if (coherent)
|
||||
++chunk->nsg;
|
||||
else if (chunk->npages == MLX4_ICM_CHUNK_LEN) {
|
||||
chunk->nsg = pci_map_sg(dev->pdev, chunk->mem,
|
||||
chunk->npages,
|
||||
PCI_DMA_BIDIRECTIONAL);
|
||||
++chunk->npages;
|
||||
|
||||
if (chunk->nsg <= 0)
|
||||
goto fail;
|
||||
if (coherent)
|
||||
++chunk->nsg;
|
||||
else if (chunk->npages == MLX4_ICM_CHUNK_LEN) {
|
||||
chunk->nsg = pci_map_sg(dev->pdev, chunk->mem,
|
||||
chunk->npages,
|
||||
PCI_DMA_BIDIRECTIONAL);
|
||||
|
||||
chunk = NULL;
|
||||
}
|
||||
|
||||
npages -= 1 << cur_order;
|
||||
} else {
|
||||
--cur_order;
|
||||
if (cur_order < 0)
|
||||
if (chunk->nsg <= 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (chunk->npages == MLX4_ICM_CHUNK_LEN)
|
||||
chunk = NULL;
|
||||
|
||||
npages -= 1 << cur_order;
|
||||
}
|
||||
|
||||
if (!coherent && chunk) {
|
||||
|
|
|
|||
|
|
@ -928,7 +928,7 @@ static const struct net_device_ops myri_ops = {
|
|||
|
||||
static int __devinit myri_sbus_probe(struct of_device *op, const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = op->node;
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
static unsigned version_printed;
|
||||
struct net_device *dev;
|
||||
struct myri_eth *mp;
|
||||
|
|
@ -1161,8 +1161,11 @@ static const struct of_device_id myri_sbus_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, myri_sbus_match);
|
||||
|
||||
static struct of_platform_driver myri_sbus_driver = {
|
||||
.name = "myri",
|
||||
.match_table = myri_sbus_match,
|
||||
.driver = {
|
||||
.name = "myri",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = myri_sbus_match,
|
||||
},
|
||||
.probe = myri_sbus_probe,
|
||||
.remove = __devexit_p(myri_sbus_remove),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9115,7 +9115,7 @@ static int __devinit niu_n2_irq_init(struct niu *np, u8 *ldg_num_map)
|
|||
const u32 *int_prop;
|
||||
int i;
|
||||
|
||||
int_prop = of_get_property(op->node, "interrupts", NULL);
|
||||
int_prop = of_get_property(op->dev.of_node, "interrupts", NULL);
|
||||
if (!int_prop)
|
||||
return -ENODEV;
|
||||
|
||||
|
|
@ -9266,7 +9266,7 @@ static int __devinit niu_get_of_props(struct niu *np)
|
|||
int prop_len;
|
||||
|
||||
if (np->parent->plat_type == PLAT_TYPE_NIU)
|
||||
dp = np->op->node;
|
||||
dp = np->op->dev.of_node;
|
||||
else
|
||||
dp = pci_device_to_OF_node(np->pdev);
|
||||
|
||||
|
|
@ -10083,10 +10083,10 @@ static int __devinit niu_of_probe(struct of_device *op,
|
|||
|
||||
niu_driver_version();
|
||||
|
||||
reg = of_get_property(op->node, "reg", NULL);
|
||||
reg = of_get_property(op->dev.of_node, "reg", NULL);
|
||||
if (!reg) {
|
||||
dev_err(&op->dev, "%s: No 'reg' property, aborting\n",
|
||||
op->node->full_name);
|
||||
op->dev.of_node->full_name);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
@ -10099,7 +10099,7 @@ static int __devinit niu_of_probe(struct of_device *op,
|
|||
np = netdev_priv(dev);
|
||||
|
||||
memset(&parent_id, 0, sizeof(parent_id));
|
||||
parent_id.of = of_get_parent(op->node);
|
||||
parent_id.of = of_get_parent(op->dev.of_node);
|
||||
|
||||
np->parent = niu_get_parent(np, &parent_id,
|
||||
PLAT_TYPE_NIU);
|
||||
|
|
@ -10234,8 +10234,11 @@ static const struct of_device_id niu_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, niu_match);
|
||||
|
||||
static struct of_platform_driver niu_of_driver = {
|
||||
.name = "niu",
|
||||
.match_table = niu_match,
|
||||
.driver = {
|
||||
.name = "niu",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = niu_match,
|
||||
},
|
||||
.probe = niu_of_probe,
|
||||
.remove = __devexit_p(niu_of_remove),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -322,6 +322,7 @@ static int smc91c92_probe(struct pcmcia_device *link)
|
|||
return -ENOMEM;
|
||||
smc = netdev_priv(dev);
|
||||
smc->p_dev = link;
|
||||
link->priv = dev;
|
||||
|
||||
spin_lock_init(&smc->lock);
|
||||
link->io.NumPorts1 = 16;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,9 @@
|
|||
|
||||
#define MII_LXT971_ISR 19 /* Interrupt Status Register */
|
||||
|
||||
/* register definitions for the 973 */
|
||||
#define MII_LXT973_PCR 16 /* Port Configuration Register */
|
||||
#define PCR_FIBER_SELECT 1
|
||||
|
||||
MODULE_DESCRIPTION("Intel LXT PHY driver");
|
||||
MODULE_AUTHOR("Andy Fleming");
|
||||
|
|
@ -119,6 +122,33 @@ static int lxt971_config_intr(struct phy_device *phydev)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int lxt973_probe(struct phy_device *phydev)
|
||||
{
|
||||
int val = phy_read(phydev, MII_LXT973_PCR);
|
||||
|
||||
if (val & PCR_FIBER_SELECT) {
|
||||
/*
|
||||
* If fiber is selected, then the only correct setting
|
||||
* is 100Mbps, full duplex, and auto negotiation off.
|
||||
*/
|
||||
val = phy_read(phydev, MII_BMCR);
|
||||
val |= (BMCR_SPEED100 | BMCR_FULLDPLX);
|
||||
val &= ~BMCR_ANENABLE;
|
||||
phy_write(phydev, MII_BMCR, val);
|
||||
/* Remember that the port is in fiber mode. */
|
||||
phydev->priv = lxt973_probe;
|
||||
} else {
|
||||
phydev->priv = NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lxt973_config_aneg(struct phy_device *phydev)
|
||||
{
|
||||
/* Do nothing if port is in fiber mode. */
|
||||
return phydev->priv ? 0 : genphy_config_aneg(phydev);
|
||||
}
|
||||
|
||||
static struct phy_driver lxt970_driver = {
|
||||
.phy_id = 0x78100000,
|
||||
.name = "LXT970",
|
||||
|
|
@ -146,6 +176,18 @@ static struct phy_driver lxt971_driver = {
|
|||
.driver = { .owner = THIS_MODULE,},
|
||||
};
|
||||
|
||||
static struct phy_driver lxt973_driver = {
|
||||
.phy_id = 0x00137a10,
|
||||
.name = "LXT973",
|
||||
.phy_id_mask = 0xfffffff0,
|
||||
.features = PHY_BASIC_FEATURES,
|
||||
.flags = 0,
|
||||
.probe = lxt973_probe,
|
||||
.config_aneg = lxt973_config_aneg,
|
||||
.read_status = genphy_read_status,
|
||||
.driver = { .owner = THIS_MODULE,},
|
||||
};
|
||||
|
||||
static int __init lxt_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
|
@ -157,9 +199,15 @@ static int __init lxt_init(void)
|
|||
ret = phy_driver_register(&lxt971_driver);
|
||||
if (ret)
|
||||
goto err2;
|
||||
|
||||
ret = phy_driver_register(&lxt973_driver);
|
||||
if (ret)
|
||||
goto err3;
|
||||
return 0;
|
||||
|
||||
err2:
|
||||
err3:
|
||||
phy_driver_unregister(&lxt971_driver);
|
||||
err2:
|
||||
phy_driver_unregister(&lxt970_driver);
|
||||
err1:
|
||||
return ret;
|
||||
|
|
@ -169,6 +217,7 @@ static void __exit lxt_exit(void)
|
|||
{
|
||||
phy_driver_unregister(&lxt970_driver);
|
||||
phy_driver_unregister(&lxt971_driver);
|
||||
phy_driver_unregister(&lxt973_driver);
|
||||
}
|
||||
|
||||
module_init(lxt_init);
|
||||
|
|
|
|||
|
|
@ -199,12 +199,12 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
|
|||
if (!pdata)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = of_get_gpio(ofdev->node, 0);
|
||||
ret = of_get_gpio(ofdev->dev.of_node, 0);
|
||||
if (ret < 0)
|
||||
goto out_free;
|
||||
pdata->mdc = ret;
|
||||
|
||||
ret = of_get_gpio(ofdev->node, 1);
|
||||
ret = of_get_gpio(ofdev->dev.of_node, 1);
|
||||
if (ret < 0)
|
||||
goto out_free;
|
||||
pdata->mdio = ret;
|
||||
|
|
@ -213,7 +213,7 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
|
|||
if (!new_bus)
|
||||
goto out_free;
|
||||
|
||||
ret = of_mdiobus_register(new_bus, ofdev->node);
|
||||
ret = of_mdiobus_register(new_bus, ofdev->dev.of_node);
|
||||
if (ret)
|
||||
mdio_gpio_bus_deinit(&ofdev->dev);
|
||||
|
||||
|
|
@ -241,8 +241,11 @@ static struct of_device_id mdio_ofgpio_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, mdio_ofgpio_match);
|
||||
|
||||
static struct of_platform_driver mdio_ofgpio_driver = {
|
||||
.name = "mdio-gpio",
|
||||
.match_table = mdio_ofgpio_match,
|
||||
.driver = {
|
||||
.name = "mdio-gpio",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = mdio_ofgpio_match,
|
||||
},
|
||||
.probe = mdio_ofgpio_probe,
|
||||
.remove = __devexit_p(mdio_ofgpio_remove),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1422,7 +1422,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
|
|||
flen = len;
|
||||
if (nfree > 0) {
|
||||
if (pch->speed == 0) {
|
||||
flen = totlen/nfree;
|
||||
flen = len/nfree;
|
||||
if (nbigger > 0) {
|
||||
flen++;
|
||||
nbigger--;
|
||||
|
|
@ -2926,5 +2926,5 @@ EXPORT_SYMBOL(ppp_output_wakeup);
|
|||
EXPORT_SYMBOL(ppp_register_compressor);
|
||||
EXPORT_SYMBOL(ppp_unregister_compressor);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS_CHARDEV_MAJOR(PPP_MAJOR);
|
||||
MODULE_ALIAS("/dev/ppp");
|
||||
MODULE_ALIAS_CHARDEV(PPP_MAJOR, 0);
|
||||
MODULE_ALIAS("devname:ppp");
|
||||
|
|
|
|||
|
|
@ -289,6 +289,7 @@ static void pppoe_flush_dev(struct net_device *dev)
|
|||
struct pppoe_net *pn;
|
||||
int i;
|
||||
|
||||
pn = pppoe_pernet(dev_net(dev));
|
||||
write_lock_bh(&pn->hash_lock);
|
||||
for (i = 0; i < PPPOE_HASH_SIZE; i++) {
|
||||
struct pppox_sock *po = pn->hash_table[i];
|
||||
|
|
|
|||
|
|
@ -559,6 +559,11 @@ static void mdio_write(void __iomem *ioaddr, int reg_addr, int value)
|
|||
break;
|
||||
udelay(25);
|
||||
}
|
||||
/*
|
||||
* According to hardware specs a 20us delay is required after write
|
||||
* complete indication, but before sending next command.
|
||||
*/
|
||||
udelay(20);
|
||||
}
|
||||
|
||||
static int mdio_read(void __iomem *ioaddr, int reg_addr)
|
||||
|
|
@ -578,6 +583,12 @@ static int mdio_read(void __iomem *ioaddr, int reg_addr)
|
|||
}
|
||||
udelay(25);
|
||||
}
|
||||
/*
|
||||
* According to hardware specs a 20us delay is required after read
|
||||
* complete indication, but before sending next command.
|
||||
*/
|
||||
udelay(20);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -830,7 +830,7 @@ static inline const char *efx_dev_name(struct efx_nic *efx)
|
|||
|
||||
static inline unsigned int efx_port_num(struct efx_nic *efx)
|
||||
{
|
||||
return PCI_FUNC(efx->pci_dev->devfn);
|
||||
return efx->net_dev->dev_id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ static int siena_probe_nic(struct efx_nic *efx)
|
|||
{
|
||||
struct siena_nic_data *nic_data;
|
||||
bool already_attached = 0;
|
||||
efx_oword_t reg;
|
||||
int rc;
|
||||
|
||||
/* Allocate storage for hardware specific data */
|
||||
|
|
@ -220,6 +221,9 @@ static int siena_probe_nic(struct efx_nic *efx)
|
|||
goto fail1;
|
||||
}
|
||||
|
||||
efx_reado(efx, ®, FR_AZ_CS_DEBUG);
|
||||
efx->net_dev->dev_id = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
|
||||
|
||||
efx_mcdi_init(efx);
|
||||
|
||||
/* Recover from a failed assertion before probing */
|
||||
|
|
|
|||
|
|
@ -1294,6 +1294,9 @@ static int sh_mdio_release(struct net_device *ndev)
|
|||
/* remove mdio bus info from net_device */
|
||||
dev_set_drvdata(&ndev->dev, NULL);
|
||||
|
||||
/* free interrupts memory */
|
||||
kfree(bus->irq);
|
||||
|
||||
/* free bitbang info */
|
||||
free_mdio_bitbang(bus);
|
||||
|
||||
|
|
|
|||
|
|
@ -1131,8 +1131,8 @@ static int __devinit bigmac_ether_init(struct of_device *op,
|
|||
goto fail_and_cleanup;
|
||||
|
||||
/* Get supported SBUS burst sizes. */
|
||||
bsizes = of_getintprop_default(qec_op->node, "burst-sizes", 0xff);
|
||||
bsizes_more = of_getintprop_default(qec_op->node, "burst-sizes", 0xff);
|
||||
bsizes = of_getintprop_default(qec_op->dev.of_node, "burst-sizes", 0xff);
|
||||
bsizes_more = of_getintprop_default(qec_op->dev.of_node, "burst-sizes", 0xff);
|
||||
|
||||
bsizes &= 0xff;
|
||||
if (bsizes_more != 0xff)
|
||||
|
|
@ -1184,7 +1184,7 @@ static int __devinit bigmac_ether_init(struct of_device *op,
|
|||
}
|
||||
|
||||
/* Get the board revision of this BigMAC. */
|
||||
bp->board_rev = of_getintprop_default(bp->bigmac_op->node,
|
||||
bp->board_rev = of_getintprop_default(bp->bigmac_op->dev.of_node,
|
||||
"board-version", 1);
|
||||
|
||||
/* Init auto-negotiation timer state. */
|
||||
|
|
@ -1290,8 +1290,11 @@ static const struct of_device_id bigmac_sbus_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, bigmac_sbus_match);
|
||||
|
||||
static struct of_platform_driver bigmac_sbus_driver = {
|
||||
.name = "sunbmac",
|
||||
.match_table = bigmac_sbus_match,
|
||||
.driver = {
|
||||
.name = "sunbmac",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = bigmac_sbus_match,
|
||||
},
|
||||
.probe = bigmac_sbus_probe,
|
||||
.remove = __devexit_p(bigmac_sbus_remove),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2481,7 +2481,7 @@ static void hme_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
|
|||
else {
|
||||
const struct linux_prom_registers *regs;
|
||||
struct of_device *op = hp->happy_dev;
|
||||
regs = of_get_property(op->node, "regs", NULL);
|
||||
regs = of_get_property(op->dev.of_node, "regs", NULL);
|
||||
if (regs)
|
||||
sprintf(info->bus_info, "SBUS:%d",
|
||||
regs->which_io);
|
||||
|
|
@ -2641,14 +2641,14 @@ static const struct net_device_ops hme_netdev_ops = {
|
|||
#ifdef CONFIG_SBUS
|
||||
static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
|
||||
{
|
||||
struct device_node *dp = op->node, *sbus_dp;
|
||||
struct device_node *dp = op->dev.of_node, *sbus_dp;
|
||||
struct quattro *qp = NULL;
|
||||
struct happy_meal *hp;
|
||||
struct net_device *dev;
|
||||
int i, qfe_slot = -1;
|
||||
int err = -ENODEV;
|
||||
|
||||
sbus_dp = to_of_device(op->dev.parent)->node;
|
||||
sbus_dp = to_of_device(op->dev.parent)->dev.of_node;
|
||||
|
||||
/* We can match PCI devices too, do not accept those here. */
|
||||
if (strcmp(sbus_dp->name, "sbus"))
|
||||
|
|
@ -3237,7 +3237,7 @@ static void happy_meal_pci_exit(void)
|
|||
#ifdef CONFIG_SBUS
|
||||
static int __devinit hme_sbus_probe(struct of_device *op, const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = op->node;
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
const char *model = of_get_property(dp, "model", NULL);
|
||||
int is_qfe = (match->data != NULL);
|
||||
|
||||
|
|
@ -3291,8 +3291,11 @@ static const struct of_device_id hme_sbus_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, hme_sbus_match);
|
||||
|
||||
static struct of_platform_driver hme_sbus_driver = {
|
||||
.name = "hme",
|
||||
.match_table = hme_sbus_match,
|
||||
.driver = {
|
||||
.name = "hme",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = hme_sbus_match,
|
||||
},
|
||||
.probe = hme_sbus_probe,
|
||||
.remove = __devexit_p(hme_sbus_remove),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1323,7 +1323,7 @@ static int __devinit sparc_lance_probe_one(struct of_device *op,
|
|||
struct of_device *ledma,
|
||||
struct of_device *lebuffer)
|
||||
{
|
||||
struct device_node *dp = op->node;
|
||||
struct device_node *dp = op->dev.of_node;
|
||||
static unsigned version_printed;
|
||||
struct lance_private *lp;
|
||||
struct net_device *dev;
|
||||
|
|
@ -1410,7 +1410,7 @@ static int __devinit sparc_lance_probe_one(struct of_device *op,
|
|||
|
||||
lp->burst_sizes = 0;
|
||||
if (lp->ledma) {
|
||||
struct device_node *ledma_dp = ledma->node;
|
||||
struct device_node *ledma_dp = ledma->dev.of_node;
|
||||
struct device_node *sbus_dp;
|
||||
unsigned int sbmask;
|
||||
const char *prop;
|
||||
|
|
@ -1506,7 +1506,7 @@ fail:
|
|||
static int __devinit sunlance_sbus_probe(struct of_device *op, const struct of_device_id *match)
|
||||
{
|
||||
struct of_device *parent = to_of_device(op->dev.parent);
|
||||
struct device_node *parent_dp = parent->node;
|
||||
struct device_node *parent_dp = parent->dev.of_node;
|
||||
int err;
|
||||
|
||||
if (!strcmp(parent_dp->name, "ledma")) {
|
||||
|
|
@ -1545,8 +1545,11 @@ static const struct of_device_id sunlance_sbus_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, sunlance_sbus_match);
|
||||
|
||||
static struct of_platform_driver sunlance_sbus_driver = {
|
||||
.name = "sunlance",
|
||||
.match_table = sunlance_sbus_match,
|
||||
.driver = {
|
||||
.name = "sunlance",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = sunlance_sbus_match,
|
||||
},
|
||||
.probe = sunlance_sbus_probe,
|
||||
.remove = __devexit_p(sunlance_sbus_remove),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -695,7 +695,7 @@ static void qe_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
|||
strcpy(info->version, "3.0");
|
||||
|
||||
op = qep->op;
|
||||
regs = of_get_property(op->node, "reg", NULL);
|
||||
regs = of_get_property(op->dev.of_node, "reg", NULL);
|
||||
if (regs)
|
||||
sprintf(info->bus_info, "SBUS:%d", regs->which_io);
|
||||
|
||||
|
|
@ -799,7 +799,7 @@ static struct sunqec * __devinit get_qec(struct of_device *child)
|
|||
if (qec_global_reset(qecp->gregs))
|
||||
goto fail;
|
||||
|
||||
qecp->qec_bursts = qec_get_burst(op->node);
|
||||
qecp->qec_bursts = qec_get_burst(op->dev.of_node);
|
||||
|
||||
qec_init_once(qecp, op);
|
||||
|
||||
|
|
@ -857,7 +857,7 @@ static int __devinit qec_ether_init(struct of_device *op)
|
|||
|
||||
res = -ENODEV;
|
||||
|
||||
i = of_getintprop_default(op->node, "channel#", -1);
|
||||
i = of_getintprop_default(op->dev.of_node, "channel#", -1);
|
||||
if (i == -1)
|
||||
goto fail;
|
||||
qe->channel = i;
|
||||
|
|
@ -977,8 +977,11 @@ static const struct of_device_id qec_sbus_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, qec_sbus_match);
|
||||
|
||||
static struct of_platform_driver qec_sbus_driver = {
|
||||
.name = "qec",
|
||||
.match_table = qec_sbus_match,
|
||||
.driver = {
|
||||
.name = "qec",
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = qec_sbus_match,
|
||||
},
|
||||
.probe = qec_sbus_probe,
|
||||
.remove = __devexit_p(qec_sbus_remove),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -646,7 +646,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
|
|||
error = copy_from_user(data, ifr->ifr_data, sizeof(data));
|
||||
if (error) {
|
||||
pr_err("cant copy from user\n");
|
||||
RET(error);
|
||||
RET(-EFAULT);
|
||||
}
|
||||
DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]);
|
||||
}
|
||||
|
|
@ -665,7 +665,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
|
|||
data[2]);
|
||||
error = copy_to_user(ifr->ifr_data, data, sizeof(data));
|
||||
if (error)
|
||||
RET(error);
|
||||
RET(-EFAULT);
|
||||
break;
|
||||
|
||||
case BDX_OP_WRITE:
|
||||
|
|
|
|||
|
|
@ -526,6 +526,8 @@ static inline struct sk_buff *tun_alloc_skb(struct tun_struct *tun,
|
|||
struct sk_buff *skb;
|
||||
int err;
|
||||
|
||||
sock_update_classid(sk);
|
||||
|
||||
/* Under a page? Don't bother with paged skb. */
|
||||
if (prepad + len < PAGE_SIZE || !linear)
|
||||
linear = len;
|
||||
|
|
@ -1649,3 +1651,4 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
|||
MODULE_AUTHOR(DRV_COPYRIGHT);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS_MISCDEV(TUN_MINOR);
|
||||
MODULE_ALIAS("devname:net/tun");
|
||||
|
|
|
|||
|
|
@ -3719,7 +3719,7 @@ static const struct net_device_ops ucc_geth_netdev_ops = {
|
|||
static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *match)
|
||||
{
|
||||
struct device *device = &ofdev->dev;
|
||||
struct device_node *np = ofdev->node;
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct net_device *dev = NULL;
|
||||
struct ucc_geth_private *ugeth = NULL;
|
||||
struct ucc_geth_info *ug_info;
|
||||
|
|
@ -3963,8 +3963,11 @@ static struct of_device_id ucc_geth_match[] = {
|
|||
MODULE_DEVICE_TABLE(of, ucc_geth_match);
|
||||
|
||||
static struct of_platform_driver ucc_geth_driver = {
|
||||
.name = DRV_NAME,
|
||||
.match_table = ucc_geth_match,
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = ucc_geth_match,
|
||||
},
|
||||
.probe = ucc_geth_probe,
|
||||
.remove = ucc_geth_remove,
|
||||
.suspend = ucc_geth_suspend,
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
|
|||
size = (u16) (header & 0x0000ffff);
|
||||
|
||||
if ((skb->len) - ((size + 1) & 0xfffe) == 0) {
|
||||
u8 alignment = (u32)skb->data & 0x3;
|
||||
u8 alignment = (unsigned long)skb->data & 0x3;
|
||||
if (alignment != 0x2) {
|
||||
/*
|
||||
* not 16bit aligned so use the room provided by
|
||||
|
|
@ -344,14 +344,14 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
|
|||
return 2;
|
||||
}
|
||||
|
||||
if (size > ETH_FRAME_LEN) {
|
||||
if (size > dev->net->mtu + ETH_HLEN) {
|
||||
netdev_err(dev->net, "asix_rx_fixup() Bad RX Length %d\n",
|
||||
size);
|
||||
return 0;
|
||||
}
|
||||
ax_skb = skb_clone(skb, GFP_ATOMIC);
|
||||
if (ax_skb) {
|
||||
u8 alignment = (u32)packet & 0x3;
|
||||
u8 alignment = (unsigned long)packet & 0x3;
|
||||
ax_skb->len = size;
|
||||
|
||||
if (alignment != 0x2) {
|
||||
|
|
|
|||
|
|
@ -475,6 +475,9 @@ static const struct usb_device_id hso_ids[] = {
|
|||
{USB_DEVICE(0x0af0, 0x8302)},
|
||||
{USB_DEVICE(0x0af0, 0x8304)},
|
||||
{USB_DEVICE(0x0af0, 0x8400)},
|
||||
{USB_DEVICE(0x0af0, 0x8600)},
|
||||
{USB_DEVICE(0x0af0, 0x8800)},
|
||||
{USB_DEVICE(0x0af0, 0x8900)},
|
||||
{USB_DEVICE(0x0af0, 0xd035)},
|
||||
{USB_DEVICE(0x0af0, 0xd055)},
|
||||
{USB_DEVICE(0x0af0, 0xd155)},
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ static void skb_xmit_done(struct virtqueue *svq)
|
|||
struct virtnet_info *vi = svq->vdev->priv;
|
||||
|
||||
/* Suppress further interrupts. */
|
||||
svq->vq_ops->disable_cb(svq);
|
||||
virtqueue_disable_cb(svq);
|
||||
|
||||
/* We were probably waiting for more output buffers. */
|
||||
netif_wake_queue(vi->dev);
|
||||
|
|
@ -210,7 +210,7 @@ static int receive_mergeable(struct virtnet_info *vi, struct sk_buff *skb)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
page = vi->rvq->vq_ops->get_buf(vi->rvq, &len);
|
||||
page = virtqueue_get_buf(vi->rvq, &len);
|
||||
if (!page) {
|
||||
pr_debug("%s: rx error: %d buffers missing\n",
|
||||
skb->dev->name, hdr->mhdr.num_buffers);
|
||||
|
|
@ -340,7 +340,7 @@ static int add_recvbuf_small(struct virtnet_info *vi, gfp_t gfp)
|
|||
|
||||
skb_to_sgvec(skb, vi->rx_sg + 1, 0, skb->len);
|
||||
|
||||
err = vi->rvq->vq_ops->add_buf(vi->rvq, vi->rx_sg, 0, 2, skb);
|
||||
err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 2, skb, gfp);
|
||||
if (err < 0)
|
||||
dev_kfree_skb(skb);
|
||||
|
||||
|
|
@ -385,8 +385,8 @@ static int add_recvbuf_big(struct virtnet_info *vi, gfp_t gfp)
|
|||
|
||||
/* chain first in list head */
|
||||
first->private = (unsigned long)list;
|
||||
err = vi->rvq->vq_ops->add_buf(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
|
||||
first);
|
||||
err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, MAX_SKB_FRAGS + 2,
|
||||
first, gfp);
|
||||
if (err < 0)
|
||||
give_pages(vi, first);
|
||||
|
||||
|
|
@ -404,7 +404,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp)
|
|||
|
||||
sg_init_one(vi->rx_sg, page_address(page), PAGE_SIZE);
|
||||
|
||||
err = vi->rvq->vq_ops->add_buf(vi->rvq, vi->rx_sg, 0, 1, page);
|
||||
err = virtqueue_add_buf_gfp(vi->rvq, vi->rx_sg, 0, 1, page, gfp);
|
||||
if (err < 0)
|
||||
give_pages(vi, page);
|
||||
|
||||
|
|
@ -433,7 +433,7 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp)
|
|||
} while (err > 0);
|
||||
if (unlikely(vi->num > vi->max))
|
||||
vi->max = vi->num;
|
||||
vi->rvq->vq_ops->kick(vi->rvq);
|
||||
virtqueue_kick(vi->rvq);
|
||||
return !oom;
|
||||
}
|
||||
|
||||
|
|
@ -442,7 +442,7 @@ static void skb_recv_done(struct virtqueue *rvq)
|
|||
struct virtnet_info *vi = rvq->vdev->priv;
|
||||
/* Schedule NAPI, Suppress further interrupts if successful. */
|
||||
if (napi_schedule_prep(&vi->napi)) {
|
||||
rvq->vq_ops->disable_cb(rvq);
|
||||
virtqueue_disable_cb(rvq);
|
||||
__napi_schedule(&vi->napi);
|
||||
}
|
||||
}
|
||||
|
|
@ -471,7 +471,7 @@ static int virtnet_poll(struct napi_struct *napi, int budget)
|
|||
|
||||
again:
|
||||
while (received < budget &&
|
||||
(buf = vi->rvq->vq_ops->get_buf(vi->rvq, &len)) != NULL) {
|
||||
(buf = virtqueue_get_buf(vi->rvq, &len)) != NULL) {
|
||||
receive_buf(vi->dev, buf, len);
|
||||
--vi->num;
|
||||
received++;
|
||||
|
|
@ -485,9 +485,9 @@ again:
|
|||
/* Out of packets? */
|
||||
if (received < budget) {
|
||||
napi_complete(napi);
|
||||
if (unlikely(!vi->rvq->vq_ops->enable_cb(vi->rvq)) &&
|
||||
if (unlikely(!virtqueue_enable_cb(vi->rvq)) &&
|
||||
napi_schedule_prep(napi)) {
|
||||
vi->rvq->vq_ops->disable_cb(vi->rvq);
|
||||
virtqueue_disable_cb(vi->rvq);
|
||||
__napi_schedule(napi);
|
||||
goto again;
|
||||
}
|
||||
|
|
@ -501,7 +501,7 @@ static unsigned int free_old_xmit_skbs(struct virtnet_info *vi)
|
|||
struct sk_buff *skb;
|
||||
unsigned int len, tot_sgs = 0;
|
||||
|
||||
while ((skb = vi->svq->vq_ops->get_buf(vi->svq, &len)) != NULL) {
|
||||
while ((skb = virtqueue_get_buf(vi->svq, &len)) != NULL) {
|
||||
pr_debug("Sent skb %p\n", skb);
|
||||
vi->dev->stats.tx_bytes += skb->len;
|
||||
vi->dev->stats.tx_packets++;
|
||||
|
|
@ -554,7 +554,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
|
|||
sg_set_buf(vi->tx_sg, &hdr->hdr, sizeof hdr->hdr);
|
||||
|
||||
hdr->num_sg = skb_to_sgvec(skb, vi->tx_sg + 1, 0, skb->len) + 1;
|
||||
return vi->svq->vq_ops->add_buf(vi->svq, vi->tx_sg, hdr->num_sg,
|
||||
return virtqueue_add_buf(vi->svq, vi->tx_sg, hdr->num_sg,
|
||||
0, skb);
|
||||
}
|
||||
|
||||
|
|
@ -574,14 +574,14 @@ again:
|
|||
if (unlikely(capacity < 0)) {
|
||||
netif_stop_queue(dev);
|
||||
dev_warn(&dev->dev, "Unexpected full queue\n");
|
||||
if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
|
||||
vi->svq->vq_ops->disable_cb(vi->svq);
|
||||
if (unlikely(!virtqueue_enable_cb(vi->svq))) {
|
||||
virtqueue_disable_cb(vi->svq);
|
||||
netif_start_queue(dev);
|
||||
goto again;
|
||||
}
|
||||
return NETDEV_TX_BUSY;
|
||||
}
|
||||
vi->svq->vq_ops->kick(vi->svq);
|
||||
virtqueue_kick(vi->svq);
|
||||
|
||||
/* Don't wait up for transmitted skbs to be freed. */
|
||||
skb_orphan(skb);
|
||||
|
|
@ -591,12 +591,12 @@ again:
|
|||
* before it gets out of hand. Naturally, this wastes entries. */
|
||||
if (capacity < 2+MAX_SKB_FRAGS) {
|
||||
netif_stop_queue(dev);
|
||||
if (unlikely(!vi->svq->vq_ops->enable_cb(vi->svq))) {
|
||||
if (unlikely(!virtqueue_enable_cb(vi->svq))) {
|
||||
/* More just got used, free them then recheck. */
|
||||
capacity += free_old_xmit_skbs(vi);
|
||||
if (capacity >= 2+MAX_SKB_FRAGS) {
|
||||
netif_start_queue(dev);
|
||||
vi->svq->vq_ops->disable_cb(vi->svq);
|
||||
virtqueue_disable_cb(vi->svq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -641,7 +641,7 @@ static int virtnet_open(struct net_device *dev)
|
|||
* now. virtnet_poll wants re-enable the queue, so we disable here.
|
||||
* We synchronize against interrupts via NAPI_STATE_SCHED */
|
||||
if (napi_schedule_prep(&vi->napi)) {
|
||||
vi->rvq->vq_ops->disable_cb(vi->rvq);
|
||||
virtqueue_disable_cb(vi->rvq);
|
||||
__napi_schedule(&vi->napi);
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -678,15 +678,15 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
|
|||
sg_set_buf(&sg[i + 1], sg_virt(s), s->length);
|
||||
sg_set_buf(&sg[out + in - 1], &status, sizeof(status));
|
||||
|
||||
BUG_ON(vi->cvq->vq_ops->add_buf(vi->cvq, sg, out, in, vi) < 0);
|
||||
BUG_ON(virtqueue_add_buf(vi->cvq, sg, out, in, vi) < 0);
|
||||
|
||||
vi->cvq->vq_ops->kick(vi->cvq);
|
||||
virtqueue_kick(vi->cvq);
|
||||
|
||||
/*
|
||||
* Spin for a response, the kick causes an ioport write, trapping
|
||||
* into the hypervisor, so the request should be handled immediately.
|
||||
*/
|
||||
while (!vi->cvq->vq_ops->get_buf(vi->cvq, &tmp))
|
||||
while (!virtqueue_get_buf(vi->cvq, &tmp))
|
||||
cpu_relax();
|
||||
|
||||
return status == VIRTIO_NET_OK;
|
||||
|
|
@ -1003,13 +1003,13 @@ static void free_unused_bufs(struct virtnet_info *vi)
|
|||
{
|
||||
void *buf;
|
||||
while (1) {
|
||||
buf = vi->svq->vq_ops->detach_unused_buf(vi->svq);
|
||||
buf = virtqueue_detach_unused_buf(vi->svq);
|
||||
if (!buf)
|
||||
break;
|
||||
dev_kfree_skb(buf);
|
||||
}
|
||||
while (1) {
|
||||
buf = vi->rvq->vq_ops->detach_unused_buf(vi->rvq);
|
||||
buf = virtqueue_detach_unused_buf(vi->rvq);
|
||||
if (!buf)
|
||||
break;
|
||||
if (vi->mergeable_rx_bufs || vi->big_packets)
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@
|
|||
#include <net/x25device.h>
|
||||
#include "x25_asy.h"
|
||||
|
||||
#include <net/x25device.h>
|
||||
|
||||
static struct net_device **x25_asy_devs;
|
||||
static int x25_asy_maxdev = SL_NRUNIT;
|
||||
|
||||
|
|
|
|||
|
|
@ -1192,7 +1192,7 @@ int i2400m_fw_hdr_check(struct i2400m *i2400m,
|
|||
unsigned module_type, header_len, major_version, minor_version,
|
||||
module_id, module_vendor, date, size;
|
||||
|
||||
module_type = bcf_hdr->module_type;
|
||||
module_type = le32_to_cpu(bcf_hdr->module_type);
|
||||
header_len = sizeof(u32) * le32_to_cpu(bcf_hdr->header_len);
|
||||
major_version = (le32_to_cpu(bcf_hdr->header_version) & 0xffff0000)
|
||||
>> 16;
|
||||
|
|
|
|||
|
|
@ -1027,12 +1027,12 @@ void i2400m_rx_edata(struct i2400m *i2400m, struct sk_buff *skb_rx,
|
|||
ro_sn = (reorder >> I2400M_RO_SN_SHIFT) & I2400M_RO_SN;
|
||||
|
||||
spin_lock_irqsave(&i2400m->rx_lock, flags);
|
||||
roq = &i2400m->rx_roq[ro_cin];
|
||||
if (roq == NULL) {
|
||||
if (i2400m->rx_roq == NULL) {
|
||||
kfree_skb(skb); /* rx_roq is already destroyed */
|
||||
spin_unlock_irqrestore(&i2400m->rx_lock, flags);
|
||||
goto error;
|
||||
}
|
||||
roq = &i2400m->rx_roq[ro_cin];
|
||||
kref_get(&i2400m->rx_roq_refcount);
|
||||
spin_unlock_irqrestore(&i2400m->rx_lock, flags);
|
||||
|
||||
|
|
|
|||
|
|
@ -5162,13 +5162,6 @@ static void proc_SSID_on_close(struct inode *inode, struct file *file)
|
|||
enable_MAC(ai, 1);
|
||||
}
|
||||
|
||||
static inline u8 hexVal(char c) {
|
||||
if (c>='0' && c<='9') return c -= '0';
|
||||
if (c>='a' && c<='f') return c -= 'a'-10;
|
||||
if (c>='A' && c<='F') return c -= 'A'-10;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void proc_APList_on_close( struct inode *inode, struct file *file ) {
|
||||
struct proc_data *data = (struct proc_data *)file->private_data;
|
||||
struct proc_dir_entry *dp = PDE(inode);
|
||||
|
|
@ -5188,11 +5181,11 @@ static void proc_APList_on_close( struct inode *inode, struct file *file ) {
|
|||
switch(j%3) {
|
||||
case 0:
|
||||
APList_rid.ap[i][j/3]=
|
||||
hexVal(data->wbuffer[j+i*6*3])<<4;
|
||||
hex_to_bin(data->wbuffer[j+i*6*3])<<4;
|
||||
break;
|
||||
case 1:
|
||||
APList_rid.ap[i][j/3]|=
|
||||
hexVal(data->wbuffer[j+i*6*3]);
|
||||
hex_to_bin(data->wbuffer[j+i*6*3]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -5340,10 +5333,10 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
|
|||
for( i = 0; i < 16*3 && data->wbuffer[i+j]; i++ ) {
|
||||
switch(i%3) {
|
||||
case 0:
|
||||
key[i/3] = hexVal(data->wbuffer[i+j])<<4;
|
||||
key[i/3] = hex_to_bin(data->wbuffer[i+j])<<4;
|
||||
break;
|
||||
case 1:
|
||||
key[i/3] |= hexVal(data->wbuffer[i+j]);
|
||||
key[i/3] |= hex_to_bin(data->wbuffer[i+j]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -739,17 +739,27 @@ err_out:
|
|||
static void ar9170_usb_firmware_failed(struct ar9170_usb *aru)
|
||||
{
|
||||
struct device *parent = aru->udev->dev.parent;
|
||||
struct usb_device *udev;
|
||||
|
||||
/*
|
||||
* Store a copy of the usb_device pointer locally.
|
||||
* This is because device_release_driver initiates
|
||||
* ar9170_usb_disconnect, which in turn frees our
|
||||
* driver context (aru).
|
||||
*/
|
||||
udev = aru->udev;
|
||||
|
||||
complete(&aru->firmware_loading_complete);
|
||||
|
||||
/* unbind anything failed */
|
||||
if (parent)
|
||||
device_lock(parent);
|
||||
device_release_driver(&aru->udev->dev);
|
||||
|
||||
device_release_driver(&udev->dev);
|
||||
if (parent)
|
||||
device_unlock(parent);
|
||||
|
||||
usb_put_dev(aru->udev);
|
||||
usb_put_dev(udev);
|
||||
}
|
||||
|
||||
static void ar9170_usb_firmware_finish(const struct firmware *fw, void *context)
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ static const struct ieee80211_rate ath5k_rates[] = {
|
|||
static int __devinit ath5k_pci_probe(struct pci_dev *pdev,
|
||||
const struct pci_device_id *id);
|
||||
static void __devexit ath5k_pci_remove(struct pci_dev *pdev);
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int ath5k_pci_suspend(struct device *dev);
|
||||
static int ath5k_pci_resume(struct device *dev);
|
||||
|
||||
|
|
@ -203,7 +203,7 @@ static SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume);
|
|||
#define ATH5K_PM_OPS (&ath5k_pm_ops)
|
||||
#else
|
||||
#define ATH5K_PM_OPS NULL
|
||||
#endif /* CONFIG_PM */
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
static struct pci_driver ath5k_pci_driver = {
|
||||
.name = KBUILD_MODNAME,
|
||||
|
|
@ -222,7 +222,6 @@ static int ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
|
|||
static int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
|
||||
struct ath5k_txq *txq);
|
||||
static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan);
|
||||
static int ath5k_reset_wake(struct ath5k_softc *sc);
|
||||
static int ath5k_start(struct ieee80211_hw *hw);
|
||||
static void ath5k_stop(struct ieee80211_hw *hw);
|
||||
static int ath5k_add_interface(struct ieee80211_hw *hw,
|
||||
|
|
@ -709,7 +708,7 @@ ath5k_pci_remove(struct pci_dev *pdev)
|
|||
ieee80211_free_hw(hw);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
static int ath5k_pci_suspend(struct device *dev)
|
||||
{
|
||||
struct ieee80211_hw *hw = pci_get_drvdata(to_pci_dev(dev));
|
||||
|
|
@ -735,7 +734,7 @@ static int ath5k_pci_resume(struct device *dev)
|
|||
ath5k_led_enable(sc);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
|
||||
/***********************\
|
||||
|
|
@ -1214,6 +1213,7 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
|
|||
struct ath5k_hw *ah = sc->ah;
|
||||
struct sk_buff *skb = bf->skb;
|
||||
struct ath5k_desc *ds;
|
||||
int ret;
|
||||
|
||||
if (!skb) {
|
||||
skb = ath5k_rx_skb_alloc(sc, &bf->skbaddr);
|
||||
|
|
@ -1240,9 +1240,9 @@ ath5k_rxbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf)
|
|||
ds = bf->desc;
|
||||
ds->ds_link = bf->daddr; /* link to self */
|
||||
ds->ds_data = bf->skbaddr;
|
||||
ah->ah_setup_rx_desc(ah, ds,
|
||||
skb_tailroom(skb), /* buffer size */
|
||||
0);
|
||||
ret = ah->ah_setup_rx_desc(ah, ds, ah->common.rx_bufsize, 0);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (sc->rxlink != NULL)
|
||||
*sc->rxlink = bf->daddr;
|
||||
|
|
@ -2769,7 +2769,7 @@ ath5k_tasklet_reset(unsigned long data)
|
|||
{
|
||||
struct ath5k_softc *sc = (void *)data;
|
||||
|
||||
ath5k_reset_wake(sc);
|
||||
ath5k_reset(sc, sc->curchan);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2940,23 +2940,13 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
|
|||
ath5k_beacon_config(sc);
|
||||
/* intrs are enabled by ath5k_beacon_config */
|
||||
|
||||
ieee80211_wake_queues(sc->hw);
|
||||
|
||||
return 0;
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
ath5k_reset_wake(struct ath5k_softc *sc)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ath5k_reset(sc, sc->curchan);
|
||||
if (!ret)
|
||||
ieee80211_wake_queues(sc->hw);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ath5k_start(struct ieee80211_hw *hw)
|
||||
{
|
||||
return ath5k_init(hw->priv);
|
||||
|
|
@ -3150,13 +3140,15 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
|
|||
|
||||
if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) {
|
||||
if (*new_flags & FIF_PROMISC_IN_BSS) {
|
||||
rfilt |= AR5K_RX_FILTER_PROM;
|
||||
__set_bit(ATH_STAT_PROMISC, sc->status);
|
||||
} else {
|
||||
__clear_bit(ATH_STAT_PROMISC, sc->status);
|
||||
}
|
||||
}
|
||||
|
||||
if (test_bit(ATH_STAT_PROMISC, sc->status))
|
||||
rfilt |= AR5K_RX_FILTER_PROM;
|
||||
|
||||
/* Note, AR5K_RX_FILTER_MCAST is already enabled */
|
||||
if (*new_flags & FIF_ALLMULTI) {
|
||||
mfilt[0] = ~0;
|
||||
|
|
|
|||
|
|
@ -1814,6 +1814,13 @@ ath5k_hw_set_antenna_mode(struct ath5k_hw *ah, u8 ant_mode)
|
|||
u8 def_ant, tx_ant, ee_mode;
|
||||
u32 sta_id1 = 0;
|
||||
|
||||
/* if channel is not initialized yet we can't set the antennas
|
||||
* so just store the mode. it will be set on the next reset */
|
||||
if (channel == NULL) {
|
||||
ah->ah_ant_mode = ant_mode;
|
||||
return;
|
||||
}
|
||||
|
||||
def_ant = ah->ah_def_ant;
|
||||
|
||||
ATH5K_TRACE(ah->ah_sc);
|
||||
|
|
|
|||
|
|
@ -76,22 +76,13 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
|
|||
ds = bf->bf_desc;
|
||||
flags = ATH9K_TXDESC_NOACK;
|
||||
|
||||
if (((sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) ||
|
||||
(sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) &&
|
||||
(ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
|
||||
ds->ds_link = bf->bf_daddr; /* self-linked */
|
||||
flags |= ATH9K_TXDESC_VEOL;
|
||||
/* Let hardware handle antenna switching. */
|
||||
antenna = 0;
|
||||
} else {
|
||||
ds->ds_link = 0;
|
||||
/*
|
||||
* Switch antenna every beacon.
|
||||
* Should only switch every beacon period, not for every SWBA
|
||||
* XXX assumes two antennae
|
||||
*/
|
||||
antenna = ((sc->beacon.ast_be_xmit / sc->nbcnvifs) & 1 ? 2 : 1);
|
||||
}
|
||||
ds->ds_link = 0;
|
||||
/*
|
||||
* Switch antenna every beacon.
|
||||
* Should only switch every beacon period, not for every SWBA
|
||||
* XXX assumes two antennae
|
||||
*/
|
||||
antenna = ((sc->beacon.ast_be_xmit / sc->nbcnvifs) & 1 ? 2 : 1);
|
||||
|
||||
sband = &sc->sbands[common->hw->conf.channel->band];
|
||||
rate = sband->bitrates[rateidx].hw_value;
|
||||
|
|
@ -215,36 +206,6 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
|
|||
return bf;
|
||||
}
|
||||
|
||||
/*
|
||||
* Startup beacon transmission for adhoc mode when they are sent entirely
|
||||
* by the hardware using the self-linked descriptor + veol trick.
|
||||
*/
|
||||
static void ath_beacon_start_adhoc(struct ath_softc *sc,
|
||||
struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ath_hw *ah = sc->sc_ah;
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ath_buf *bf;
|
||||
struct ath_vif *avp;
|
||||
struct sk_buff *skb;
|
||||
|
||||
avp = (void *)vif->drv_priv;
|
||||
|
||||
if (avp->av_bcbuf == NULL)
|
||||
return;
|
||||
|
||||
bf = avp->av_bcbuf;
|
||||
skb = bf->bf_mpdu;
|
||||
|
||||
ath_beacon_setup(sc, avp, bf, 0);
|
||||
|
||||
/* NB: caller is known to have already stopped tx dma */
|
||||
ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bf->bf_daddr);
|
||||
ath9k_hw_txstart(ah, sc->beacon.beaconq);
|
||||
ath_print(common, ATH_DBG_BEACON, "TXDP%u = %llx (%p)\n",
|
||||
sc->beacon.beaconq, ito64(bf->bf_daddr), bf->bf_desc);
|
||||
}
|
||||
|
||||
int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
|
||||
{
|
||||
struct ath_softc *sc = aphy->sc;
|
||||
|
|
@ -265,7 +226,8 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
|
|||
list_del(&avp->av_bcbuf->list);
|
||||
|
||||
if (sc->sc_ah->opmode == NL80211_IFTYPE_AP ||
|
||||
!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)) {
|
||||
sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC ||
|
||||
sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT) {
|
||||
int slot;
|
||||
/*
|
||||
* Assign the vif to a beacon xmit slot. As
|
||||
|
|
@ -274,17 +236,11 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
|
|||
avp->av_bslot = 0;
|
||||
for (slot = 0; slot < ATH_BCBUF; slot++)
|
||||
if (sc->beacon.bslot[slot] == NULL) {
|
||||
/*
|
||||
* XXX hack, space out slots to better
|
||||
* deal with misses
|
||||
*/
|
||||
if (slot+1 < ATH_BCBUF &&
|
||||
sc->beacon.bslot[slot+1] == NULL) {
|
||||
avp->av_bslot = slot+1;
|
||||
break;
|
||||
}
|
||||
avp->av_bslot = slot;
|
||||
|
||||
/* NB: keep looking for a double slot */
|
||||
if (slot == 0 || !sc->beacon.bslot[slot-1])
|
||||
break;
|
||||
}
|
||||
BUG_ON(sc->beacon.bslot[avp->av_bslot] != NULL);
|
||||
sc->beacon.bslot[avp->av_bslot] = vif;
|
||||
|
|
@ -721,8 +677,7 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
|
|||
* self-linked tx descriptor and let the hardware deal with things.
|
||||
*/
|
||||
intval |= ATH9K_BEACON_ENA;
|
||||
if (!(ah->caps.hw_caps & ATH9K_HW_CAP_VEOL))
|
||||
ah->imask |= ATH9K_INT_SWBA;
|
||||
ah->imask |= ATH9K_INT_SWBA;
|
||||
|
||||
ath_beaconq_config(sc);
|
||||
|
||||
|
|
@ -732,10 +687,6 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
|
|||
ath9k_beacon_init(sc, nexttbtt, intval);
|
||||
sc->beacon.bmisscnt = 0;
|
||||
ath9k_hw_set_interrupts(ah, ah->imask);
|
||||
|
||||
/* FIXME: Handle properly when vif is NULL */
|
||||
if (vif && ah->caps.hw_caps & ATH9K_HW_CAP_VEOL)
|
||||
ath_beacon_start_adhoc(sc, vif);
|
||||
}
|
||||
|
||||
void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif)
|
||||
|
|
|
|||
|
|
@ -107,12 +107,14 @@ static inline void ath9k_skb_queue_purge(struct hif_device_usb *hif_dev,
|
|||
static void hif_usb_tx_cb(struct urb *urb)
|
||||
{
|
||||
struct tx_buf *tx_buf = (struct tx_buf *) urb->context;
|
||||
struct hif_device_usb *hif_dev = tx_buf->hif_dev;
|
||||
struct hif_device_usb *hif_dev;
|
||||
struct sk_buff *skb;
|
||||
|
||||
if (!hif_dev || !tx_buf)
|
||||
if (!tx_buf || !tx_buf->hif_dev)
|
||||
return;
|
||||
|
||||
hif_dev = tx_buf->hif_dev;
|
||||
|
||||
switch (urb->status) {
|
||||
case 0:
|
||||
break;
|
||||
|
|
@ -607,6 +609,10 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev)
|
|||
|
||||
return 0;
|
||||
err:
|
||||
if (tx_buf) {
|
||||
kfree(tx_buf->buf);
|
||||
kfree(tx_buf);
|
||||
}
|
||||
ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <linux/skbuff.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/leds.h>
|
||||
#include <linux/slab.h>
|
||||
#include <net/mac80211.h>
|
||||
|
||||
#include "common.h"
|
||||
|
|
|
|||
|
|
@ -752,7 +752,6 @@ static int ath_key_config(struct ath_common *common,
|
|||
struct ath_hw *ah = common->ah;
|
||||
struct ath9k_keyval hk;
|
||||
const u8 *mac = NULL;
|
||||
u8 gmac[ETH_ALEN];
|
||||
int ret = 0;
|
||||
int idx;
|
||||
|
||||
|
|
@ -776,30 +775,9 @@ static int ath_key_config(struct ath_common *common,
|
|||
memcpy(hk.kv_val, key->key, key->keylen);
|
||||
|
||||
if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
|
||||
|
||||
if (key->ap_addr) {
|
||||
/*
|
||||
* Group keys on hardware that supports multicast frame
|
||||
* key search use a mac that is the sender's address with
|
||||
* the high bit set instead of the app-specified address.
|
||||
*/
|
||||
memcpy(gmac, key->ap_addr, ETH_ALEN);
|
||||
gmac[0] |= 0x80;
|
||||
mac = gmac;
|
||||
|
||||
if (key->alg == ALG_TKIP)
|
||||
idx = ath_reserve_key_cache_slot_tkip(common);
|
||||
else
|
||||
idx = ath_reserve_key_cache_slot(common);
|
||||
if (idx < 0)
|
||||
mac = NULL; /* no free key cache entries */
|
||||
}
|
||||
|
||||
if (!mac) {
|
||||
/* For now, use the default keys for broadcast keys. This may
|
||||
* need to change with virtual interfaces. */
|
||||
idx = key->keyidx;
|
||||
}
|
||||
/* For now, use the default keys for broadcast keys. This may
|
||||
* need to change with virtual interfaces. */
|
||||
idx = key->keyidx;
|
||||
} else if (key->keyidx) {
|
||||
if (WARN_ON(!sta))
|
||||
return -EOPNOTSUPP;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
|
|||
{ PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x002E) }, /* PCI-E */
|
||||
{ PCI_VDEVICE(ATHEROS, 0x0030) }, /* PCI-E AR9300 */
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,12 @@
|
|||
|
||||
#define SKB_CB_ATHBUF(__skb) (*((struct ath_buf **)__skb->cb))
|
||||
|
||||
static inline bool ath9k_check_auto_sleep(struct ath_softc *sc)
|
||||
{
|
||||
return sc->ps_enabled &&
|
||||
(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP);
|
||||
}
|
||||
|
||||
static struct ieee80211_hw * ath_get_virt_hw(struct ath_softc *sc,
|
||||
struct ieee80211_hdr *hdr)
|
||||
{
|
||||
|
|
@ -616,8 +622,8 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb)
|
|||
hdr = (struct ieee80211_hdr *)skb->data;
|
||||
|
||||
/* Process Beacon and CAB receive in PS state */
|
||||
if ((sc->ps_flags & PS_WAIT_FOR_BEACON) &&
|
||||
ieee80211_is_beacon(hdr->frame_control))
|
||||
if (((sc->ps_flags & PS_WAIT_FOR_BEACON) || ath9k_check_auto_sleep(sc))
|
||||
&& ieee80211_is_beacon(hdr->frame_control))
|
||||
ath_rx_ps_beacon(sc, skb);
|
||||
else if ((sc->ps_flags & PS_WAIT_FOR_CAB) &&
|
||||
(ieee80211_is_data(hdr->frame_control) ||
|
||||
|
|
@ -932,9 +938,10 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
|
|||
sc->rx.rxotherant = 0;
|
||||
}
|
||||
|
||||
if (unlikely(sc->ps_flags & (PS_WAIT_FOR_BEACON |
|
||||
PS_WAIT_FOR_CAB |
|
||||
PS_WAIT_FOR_PSPOLL_DATA)))
|
||||
if (unlikely(ath9k_check_auto_sleep(sc) ||
|
||||
(sc->ps_flags & (PS_WAIT_FOR_BEACON |
|
||||
PS_WAIT_FOR_CAB |
|
||||
PS_WAIT_FOR_PSPOLL_DATA))))
|
||||
ath_rx_ps(sc, skb);
|
||||
|
||||
ath_rx_send_to_mac80211(hw, sc, skb, rxs);
|
||||
|
|
|
|||
|
|
@ -1198,7 +1198,7 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
|
|||
int r;
|
||||
|
||||
ath_print(common, ATH_DBG_FATAL,
|
||||
"Unable to stop TxDMA. Reset HAL!\n");
|
||||
"Failed to stop TX DMA. Resetting hardware!\n");
|
||||
|
||||
spin_lock_bh(&sc->sc_resetlock);
|
||||
r = ath9k_hw_reset(ah, sc->sc_ah->curchan, false);
|
||||
|
|
@ -1728,6 +1728,8 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
|
|||
} else
|
||||
bf->bf_isnullfunc = false;
|
||||
|
||||
bf->bf_tx_aborted = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1989,7 +1991,7 @@ static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf,
|
|||
int nbad = 0;
|
||||
int isaggr = 0;
|
||||
|
||||
if (bf->bf_tx_aborted)
|
||||
if (bf->bf_lastbf->bf_tx_aborted)
|
||||
return 0;
|
||||
|
||||
isaggr = bf_isaggr(bf);
|
||||
|
|
|
|||
|
|
@ -2618,15 +2618,6 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id)
|
|||
int events = 0;
|
||||
u16 ev;
|
||||
|
||||
/* Detect early interrupt before driver is fully configued */
|
||||
if (!dev->base_addr) {
|
||||
if (net_ratelimit()) {
|
||||
printk(KERN_DEBUG "%s: Interrupt, but dev not configured\n",
|
||||
dev->name);
|
||||
}
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
iface = netdev_priv(dev);
|
||||
local = iface->local;
|
||||
|
||||
|
|
|
|||
|
|
@ -2852,6 +2852,7 @@ static struct iwl_lib_ops iwl3945_lib = {
|
|||
.isr = iwl_isr_legacy,
|
||||
.config_ap = iwl3945_config_ap,
|
||||
.manage_ibss_station = iwl3945_manage_ibss_station,
|
||||
.recover_from_tx_stall = iwl_bg_monitor_recover,
|
||||
.check_plcp_health = iwl3945_good_plcp_health,
|
||||
|
||||
.debugfs_ops = {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <net/mac80211.h>
|
||||
|
||||
#include "iwl-dev.h"
|
||||
|
|
|
|||
|
|
@ -1119,10 +1119,9 @@ static int iwl_get_single_channel_for_scan(struct iwl_priv *priv,
|
|||
struct iwl_scan_channel *scan_ch)
|
||||
{
|
||||
const struct ieee80211_supported_band *sband;
|
||||
const struct iwl_channel_info *ch_info;
|
||||
u16 passive_dwell = 0;
|
||||
u16 active_dwell = 0;
|
||||
int i, added = 0;
|
||||
int added = 0;
|
||||
u16 channel = 0;
|
||||
|
||||
sband = iwl_get_hw_mode(priv, band);
|
||||
|
|
@ -1137,32 +1136,7 @@ static int iwl_get_single_channel_for_scan(struct iwl_priv *priv,
|
|||
if (passive_dwell <= active_dwell)
|
||||
passive_dwell = active_dwell + 1;
|
||||
|
||||
/* only scan single channel, good enough to reset the RF */
|
||||
/* pick the first valid not in-use channel */
|
||||
if (band == IEEE80211_BAND_5GHZ) {
|
||||
for (i = 14; i < priv->channel_count; i++) {
|
||||
if (priv->channel_info[i].channel !=
|
||||
le16_to_cpu(priv->staging_rxon.channel)) {
|
||||
channel = priv->channel_info[i].channel;
|
||||
ch_info = iwl_get_channel_info(priv,
|
||||
band, channel);
|
||||
if (is_channel_valid(ch_info))
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < 14; i++) {
|
||||
if (priv->channel_info[i].channel !=
|
||||
le16_to_cpu(priv->staging_rxon.channel)) {
|
||||
channel =
|
||||
priv->channel_info[i].channel;
|
||||
ch_info = iwl_get_channel_info(priv,
|
||||
band, channel);
|
||||
if (is_channel_valid(ch_info))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
channel = iwl_get_single_channel_number(priv, band);
|
||||
if (channel) {
|
||||
scan_ch->channel = cpu_to_le16(channel);
|
||||
scan_ch->type = SCAN_CHANNEL_TYPE_PASSIVE;
|
||||
|
|
|
|||
|
|
@ -1125,6 +1125,7 @@ static void iwlagn_tx_status(struct iwl_priv *priv, struct sk_buff *skb)
|
|||
struct ieee80211_sta *sta;
|
||||
struct iwl_station_priv *sta_priv;
|
||||
|
||||
rcu_read_lock();
|
||||
sta = ieee80211_find_sta(priv->vif, hdr->addr1);
|
||||
if (sta) {
|
||||
sta_priv = (void *)sta->drv_priv;
|
||||
|
|
@ -1133,6 +1134,7 @@ static void iwlagn_tx_status(struct iwl_priv *priv, struct sk_buff *skb)
|
|||
atomic_dec_return(&sta_priv->pending_frames) == 0)
|
||||
ieee80211_sta_block_awake(priv->hw, sta, false);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
ieee80211_tx_status_irqsafe(priv->hw, skb);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue