forked from Minki/linux
Merge branch '20101221_static_const' of git://repo.or.cz/linux-2.6/trivial-mods
This commit is contained in:
commit
503b1a529a
@ -158,8 +158,8 @@ static int mem_start;
|
|||||||
struct net_device * __init el1_probe(int unit)
|
struct net_device * __init el1_probe(int unit)
|
||||||
{
|
{
|
||||||
struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
|
struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
|
||||||
static unsigned ports[] = { 0x280, 0x300, 0};
|
static const unsigned ports[] = { 0x280, 0x300, 0};
|
||||||
unsigned *port;
|
const unsigned *port;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (!dev)
|
if (!dev)
|
||||||
|
@ -392,8 +392,8 @@ el2_open(struct net_device *dev)
|
|||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (dev->irq < 2) {
|
if (dev->irq < 2) {
|
||||||
int irqlist[] = {5, 9, 3, 4, 0};
|
static const int irqlist[] = {5, 9, 3, 4, 0};
|
||||||
int *irqp = irqlist;
|
const int *irqp = irqlist;
|
||||||
|
|
||||||
outb(EGACFR_NORM, E33G_GACFR); /* Enable RAM and interrupts. */
|
outb(EGACFR_NORM, E33G_GACFR); /* Enable RAM and interrupts. */
|
||||||
do {
|
do {
|
||||||
|
@ -311,8 +311,8 @@ static int mem_start;
|
|||||||
struct net_device * __init el16_probe(int unit)
|
struct net_device * __init el16_probe(int unit)
|
||||||
{
|
{
|
||||||
struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
|
struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
|
||||||
static unsigned ports[] = { 0x300, 0x320, 0x340, 0x280, 0};
|
static const unsigned ports[] = { 0x300, 0x320, 0x340, 0x280, 0};
|
||||||
unsigned *port;
|
const unsigned *port;
|
||||||
int err = -ENODEV;
|
int err = -ENODEV;
|
||||||
|
|
||||||
if (!dev)
|
if (!dev)
|
||||||
|
@ -317,13 +317,13 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
|
|||||||
u8 POS;
|
u8 POS;
|
||||||
u32 base;
|
u32 base;
|
||||||
struct mc32_local *lp = netdev_priv(dev);
|
struct mc32_local *lp = netdev_priv(dev);
|
||||||
static u16 mca_io_bases[]={
|
static const u16 mca_io_bases[] = {
|
||||||
0x7280,0x7290,
|
0x7280,0x7290,
|
||||||
0x7680,0x7690,
|
0x7680,0x7690,
|
||||||
0x7A80,0x7A90,
|
0x7A80,0x7A90,
|
||||||
0x7E80,0x7E90
|
0x7E80,0x7E90
|
||||||
};
|
};
|
||||||
static u32 mca_mem_bases[]={
|
static const u32 mca_mem_bases[] = {
|
||||||
0x00C0000,
|
0x00C0000,
|
||||||
0x00C4000,
|
0x00C4000,
|
||||||
0x00C8000,
|
0x00C8000,
|
||||||
@ -333,7 +333,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
|
|||||||
0x00D8000,
|
0x00D8000,
|
||||||
0x00DC000
|
0x00DC000
|
||||||
};
|
};
|
||||||
static char *failures[]={
|
static const char * const failures[] = {
|
||||||
"Processor instruction",
|
"Processor instruction",
|
||||||
"Processor data bus",
|
"Processor data bus",
|
||||||
"Processor data bus",
|
"Processor data bus",
|
||||||
|
@ -270,9 +270,9 @@ static const struct net_device_ops at1700_netdev_ops = {
|
|||||||
|
|
||||||
static int __init at1700_probe1(struct net_device *dev, int ioaddr)
|
static int __init at1700_probe1(struct net_device *dev, int ioaddr)
|
||||||
{
|
{
|
||||||
char fmv_irqmap[4] = {3, 7, 10, 15};
|
static const char fmv_irqmap[4] = {3, 7, 10, 15};
|
||||||
char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
|
static const char fmv_irqmap_pnp[8] = {3, 4, 5, 7, 9, 10, 11, 15};
|
||||||
char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
|
static const char at1700_irqmap[8] = {3, 4, 5, 9, 10, 11, 14, 15};
|
||||||
unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
|
unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
|
||||||
int slot, ret = -ENODEV;
|
int slot, ret = -ENODEV;
|
||||||
struct net_local *lp = netdev_priv(dev);
|
struct net_local *lp = netdev_priv(dev);
|
||||||
|
@ -549,7 +549,9 @@ be_test_ddr_dma(struct be_adapter *adapter)
|
|||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i;
|
||||||
struct be_dma_mem ddrdma_cmd;
|
struct be_dma_mem ddrdma_cmd;
|
||||||
u64 pattern[2] = {0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL};
|
static const u64 pattern[2] = {
|
||||||
|
0x5a5a5a5a5a5a5a5aULL, 0xa5a5a5a5a5a5a5a5ULL
|
||||||
|
};
|
||||||
|
|
||||||
ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
|
ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
|
||||||
ddrdma_cmd.va = pci_alloc_consistent(adapter->pdev, ddrdma_cmd.size,
|
ddrdma_cmd.va = pci_alloc_consistent(adapter->pdev, ddrdma_cmd.size,
|
||||||
|
@ -2398,10 +2398,10 @@ static int be_flash_data(struct be_adapter *adapter,
|
|||||||
int num_bytes;
|
int num_bytes;
|
||||||
const u8 *p = fw->data;
|
const u8 *p = fw->data;
|
||||||
struct be_cmd_write_flashrom *req = flash_cmd->va;
|
struct be_cmd_write_flashrom *req = flash_cmd->va;
|
||||||
struct flash_comp *pflashcomp;
|
const struct flash_comp *pflashcomp;
|
||||||
int num_comp;
|
int num_comp;
|
||||||
|
|
||||||
struct flash_comp gen3_flash_types[9] = {
|
static const struct flash_comp gen3_flash_types[9] = {
|
||||||
{ FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE,
|
{ FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE,
|
||||||
FLASH_IMAGE_MAX_SIZE_g3},
|
FLASH_IMAGE_MAX_SIZE_g3},
|
||||||
{ FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT,
|
{ FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT,
|
||||||
@ -2421,7 +2421,7 @@ static int be_flash_data(struct be_adapter *adapter,
|
|||||||
{ FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW,
|
{ FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW,
|
||||||
FLASH_NCSI_IMAGE_MAX_SIZE_g3}
|
FLASH_NCSI_IMAGE_MAX_SIZE_g3}
|
||||||
};
|
};
|
||||||
struct flash_comp gen2_flash_types[8] = {
|
static const struct flash_comp gen2_flash_types[8] = {
|
||||||
{ FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE,
|
{ FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE,
|
||||||
FLASH_IMAGE_MAX_SIZE_g2},
|
FLASH_IMAGE_MAX_SIZE_g2},
|
||||||
{ FLASH_REDBOOT_START_g2, IMG_TYPE_REDBOOT,
|
{ FLASH_REDBOOT_START_g2, IMG_TYPE_REDBOOT,
|
||||||
@ -2443,11 +2443,11 @@ static int be_flash_data(struct be_adapter *adapter,
|
|||||||
if (adapter->generation == BE_GEN3) {
|
if (adapter->generation == BE_GEN3) {
|
||||||
pflashcomp = gen3_flash_types;
|
pflashcomp = gen3_flash_types;
|
||||||
filehdr_size = sizeof(struct flash_file_hdr_g3);
|
filehdr_size = sizeof(struct flash_file_hdr_g3);
|
||||||
num_comp = 9;
|
num_comp = ARRAY_SIZE(gen3_flash_types);
|
||||||
} else {
|
} else {
|
||||||
pflashcomp = gen2_flash_types;
|
pflashcomp = gen2_flash_types;
|
||||||
filehdr_size = sizeof(struct flash_file_hdr_g2);
|
filehdr_size = sizeof(struct flash_file_hdr_g2);
|
||||||
num_comp = 8;
|
num_comp = ARRAY_SIZE(gen2_flash_types);
|
||||||
}
|
}
|
||||||
for (i = 0; i < num_comp; i++) {
|
for (i = 0; i < num_comp; i++) {
|
||||||
if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) &&
|
if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) &&
|
||||||
|
@ -6811,28 +6811,30 @@ bnx2_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *_p)
|
|||||||
u32 *p = _p, i, offset;
|
u32 *p = _p, i, offset;
|
||||||
u8 *orig_p = _p;
|
u8 *orig_p = _p;
|
||||||
struct bnx2 *bp = netdev_priv(dev);
|
struct bnx2 *bp = netdev_priv(dev);
|
||||||
u32 reg_boundaries[] = { 0x0000, 0x0098, 0x0400, 0x045c,
|
static const u32 reg_boundaries[] = {
|
||||||
0x0800, 0x0880, 0x0c00, 0x0c10,
|
0x0000, 0x0098, 0x0400, 0x045c,
|
||||||
0x0c30, 0x0d08, 0x1000, 0x101c,
|
0x0800, 0x0880, 0x0c00, 0x0c10,
|
||||||
0x1040, 0x1048, 0x1080, 0x10a4,
|
0x0c30, 0x0d08, 0x1000, 0x101c,
|
||||||
0x1400, 0x1490, 0x1498, 0x14f0,
|
0x1040, 0x1048, 0x1080, 0x10a4,
|
||||||
0x1500, 0x155c, 0x1580, 0x15dc,
|
0x1400, 0x1490, 0x1498, 0x14f0,
|
||||||
0x1600, 0x1658, 0x1680, 0x16d8,
|
0x1500, 0x155c, 0x1580, 0x15dc,
|
||||||
0x1800, 0x1820, 0x1840, 0x1854,
|
0x1600, 0x1658, 0x1680, 0x16d8,
|
||||||
0x1880, 0x1894, 0x1900, 0x1984,
|
0x1800, 0x1820, 0x1840, 0x1854,
|
||||||
0x1c00, 0x1c0c, 0x1c40, 0x1c54,
|
0x1880, 0x1894, 0x1900, 0x1984,
|
||||||
0x1c80, 0x1c94, 0x1d00, 0x1d84,
|
0x1c00, 0x1c0c, 0x1c40, 0x1c54,
|
||||||
0x2000, 0x2030, 0x23c0, 0x2400,
|
0x1c80, 0x1c94, 0x1d00, 0x1d84,
|
||||||
0x2800, 0x2820, 0x2830, 0x2850,
|
0x2000, 0x2030, 0x23c0, 0x2400,
|
||||||
0x2b40, 0x2c10, 0x2fc0, 0x3058,
|
0x2800, 0x2820, 0x2830, 0x2850,
|
||||||
0x3c00, 0x3c94, 0x4000, 0x4010,
|
0x2b40, 0x2c10, 0x2fc0, 0x3058,
|
||||||
0x4080, 0x4090, 0x43c0, 0x4458,
|
0x3c00, 0x3c94, 0x4000, 0x4010,
|
||||||
0x4c00, 0x4c18, 0x4c40, 0x4c54,
|
0x4080, 0x4090, 0x43c0, 0x4458,
|
||||||
0x4fc0, 0x5010, 0x53c0, 0x5444,
|
0x4c00, 0x4c18, 0x4c40, 0x4c54,
|
||||||
0x5c00, 0x5c18, 0x5c80, 0x5c90,
|
0x4fc0, 0x5010, 0x53c0, 0x5444,
|
||||||
0x5fc0, 0x6000, 0x6400, 0x6428,
|
0x5c00, 0x5c18, 0x5c80, 0x5c90,
|
||||||
0x6800, 0x6848, 0x684c, 0x6860,
|
0x5fc0, 0x6000, 0x6400, 0x6428,
|
||||||
0x6888, 0x6910, 0x8000 };
|
0x6800, 0x6848, 0x684c, 0x6860,
|
||||||
|
0x6888, 0x6910, 0x8000
|
||||||
|
};
|
||||||
|
|
||||||
regs->version = 0;
|
regs->version = 0;
|
||||||
|
|
||||||
|
@ -6208,7 +6208,7 @@ static int bnx2x_func_stop(struct bnx2x *bp)
|
|||||||
* @param cam_offset offset in a CAM to use
|
* @param cam_offset offset in a CAM to use
|
||||||
* @param is_bcast is the set MAC a broadcast address (for E1 only)
|
* @param is_bcast is the set MAC a broadcast address (for E1 only)
|
||||||
*/
|
*/
|
||||||
static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, u8 *mac,
|
static void bnx2x_set_mac_addr_gen(struct bnx2x *bp, int set, const u8 *mac,
|
||||||
u32 cl_bit_vec, u8 cam_offset,
|
u32 cl_bit_vec, u8 cam_offset,
|
||||||
u8 is_bcast)
|
u8 is_bcast)
|
||||||
{
|
{
|
||||||
@ -6400,7 +6400,9 @@ void bnx2x_set_eth_mac(struct bnx2x *bp, int set)
|
|||||||
|
|
||||||
if (CHIP_IS_E1(bp)) {
|
if (CHIP_IS_E1(bp)) {
|
||||||
/* broadcast MAC */
|
/* broadcast MAC */
|
||||||
u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
static const u8 bcast[ETH_ALEN] = {
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||||
|
};
|
||||||
bnx2x_set_mac_addr_gen(bp, set, bcast, 0, cam_offset + 1, 1);
|
bnx2x_set_mac_addr_gen(bp, set, bcast, 0, cam_offset + 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -383,7 +383,7 @@ static void plx_pci_reset_marathon(struct pci_dev *pdev)
|
|||||||
{
|
{
|
||||||
void __iomem *reset_addr;
|
void __iomem *reset_addr;
|
||||||
int i;
|
int i;
|
||||||
int reset_bar[2] = {3, 5};
|
static const int reset_bar[2] = {3, 5};
|
||||||
|
|
||||||
plx_pci_reset_common(pdev);
|
plx_pci_reset_common(pdev);
|
||||||
|
|
||||||
|
@ -273,6 +273,10 @@ struct sge {
|
|||||||
struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp;
|
struct cmdQ cmdQ[SGE_CMDQ_N] ____cacheline_aligned_in_smp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const u8 ch_mac_addr[ETH_ALEN] = {
|
||||||
|
0x0, 0x7, 0x43, 0x0, 0x0, 0x0
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* stop tasklet and free all pending skb's
|
* stop tasklet and free all pending skb's
|
||||||
*/
|
*/
|
||||||
@ -2012,10 +2016,6 @@ static void espibug_workaround_t204(unsigned long data)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!skb->cb[0]) {
|
if (!skb->cb[0]) {
|
||||||
u8 ch_mac_addr[ETH_ALEN] = {
|
|
||||||
0x0, 0x7, 0x43, 0x0, 0x0, 0x0
|
|
||||||
};
|
|
||||||
|
|
||||||
skb_copy_to_linear_data_offset(skb,
|
skb_copy_to_linear_data_offset(skb,
|
||||||
sizeof(struct cpl_tx_pkt),
|
sizeof(struct cpl_tx_pkt),
|
||||||
ch_mac_addr,
|
ch_mac_addr,
|
||||||
@ -2048,8 +2048,6 @@ static void espibug_workaround(unsigned long data)
|
|||||||
|
|
||||||
if ((seop & 0xfff0fff) == 0xfff && skb) {
|
if ((seop & 0xfff0fff) == 0xfff && skb) {
|
||||||
if (!skb->cb[0]) {
|
if (!skb->cb[0]) {
|
||||||
u8 ch_mac_addr[ETH_ALEN] =
|
|
||||||
{0x0, 0x7, 0x43, 0x0, 0x0, 0x0};
|
|
||||||
skb_copy_to_linear_data_offset(skb,
|
skb_copy_to_linear_data_offset(skb,
|
||||||
sizeof(struct cpl_tx_pkt),
|
sizeof(struct cpl_tx_pkt),
|
||||||
ch_mac_addr,
|
ch_mac_addr,
|
||||||
|
@ -292,7 +292,7 @@ unknown:
|
|||||||
*/
|
*/
|
||||||
static int ael2005_setup_sr_edc(struct cphy *phy)
|
static int ael2005_setup_sr_edc(struct cphy *phy)
|
||||||
{
|
{
|
||||||
static struct reg_val regs[] = {
|
static const struct reg_val regs[] = {
|
||||||
{ MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x181 },
|
{ MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x181 },
|
||||||
{ MDIO_MMD_PMAPMD, 0xc010, 0xffff, 0x448a },
|
{ MDIO_MMD_PMAPMD, 0xc010, 0xffff, 0x448a },
|
||||||
{ MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5200 },
|
{ MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5200 },
|
||||||
@ -324,11 +324,11 @@ static int ael2005_setup_sr_edc(struct cphy *phy)
|
|||||||
|
|
||||||
static int ael2005_setup_twinax_edc(struct cphy *phy, int modtype)
|
static int ael2005_setup_twinax_edc(struct cphy *phy, int modtype)
|
||||||
{
|
{
|
||||||
static struct reg_val regs[] = {
|
static const struct reg_val regs[] = {
|
||||||
{ MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5a00 },
|
{ MDIO_MMD_PMAPMD, 0xc04a, 0xffff, 0x5a00 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
static struct reg_val preemphasis[] = {
|
static const struct reg_val preemphasis[] = {
|
||||||
{ MDIO_MMD_PMAPMD, 0xc014, 0xffff, 0xfe16 },
|
{ MDIO_MMD_PMAPMD, 0xc014, 0xffff, 0xfe16 },
|
||||||
{ MDIO_MMD_PMAPMD, 0xc015, 0xffff, 0xa000 },
|
{ MDIO_MMD_PMAPMD, 0xc015, 0xffff, 0xa000 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
@ -393,7 +393,7 @@ static int ael2005_intr_clear(struct cphy *phy)
|
|||||||
|
|
||||||
static int ael2005_reset(struct cphy *phy, int wait)
|
static int ael2005_reset(struct cphy *phy, int wait)
|
||||||
{
|
{
|
||||||
static struct reg_val regs0[] = {
|
static const struct reg_val regs0[] = {
|
||||||
{ MDIO_MMD_PMAPMD, 0xc001, 0, 1 << 5 },
|
{ MDIO_MMD_PMAPMD, 0xc001, 0, 1 << 5 },
|
||||||
{ MDIO_MMD_PMAPMD, 0xc017, 0, 1 << 5 },
|
{ MDIO_MMD_PMAPMD, 0xc017, 0, 1 << 5 },
|
||||||
{ MDIO_MMD_PMAPMD, 0xc013, 0xffff, 0xf341 },
|
{ MDIO_MMD_PMAPMD, 0xc013, 0xffff, 0xf341 },
|
||||||
@ -403,7 +403,7 @@ static int ael2005_reset(struct cphy *phy, int wait)
|
|||||||
{ MDIO_MMD_PMAPMD, 0xc210, 0xffff, 0 },
|
{ MDIO_MMD_PMAPMD, 0xc210, 0xffff, 0 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
static struct reg_val regs1[] = {
|
static const struct reg_val regs1[] = {
|
||||||
{ MDIO_MMD_PMAPMD, 0xca00, 0xffff, 0x0080 },
|
{ MDIO_MMD_PMAPMD, 0xca00, 0xffff, 0x0080 },
|
||||||
{ MDIO_MMD_PMAPMD, 0xca12, 0xffff, 0 },
|
{ MDIO_MMD_PMAPMD, 0xca12, 0xffff, 0 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
@ -522,7 +522,7 @@ int t3_ael2005_phy_prep(struct cphy *phy, struct adapter *adapter,
|
|||||||
*/
|
*/
|
||||||
static int ael2020_setup_sr_edc(struct cphy *phy)
|
static int ael2020_setup_sr_edc(struct cphy *phy)
|
||||||
{
|
{
|
||||||
static struct reg_val regs[] = {
|
static const struct reg_val regs[] = {
|
||||||
/* set CDR offset to 10 */
|
/* set CDR offset to 10 */
|
||||||
{ MDIO_MMD_PMAPMD, 0xcc01, 0xffff, 0x488a },
|
{ MDIO_MMD_PMAPMD, 0xcc01, 0xffff, 0x488a },
|
||||||
|
|
||||||
@ -551,20 +551,20 @@ static int ael2020_setup_sr_edc(struct cphy *phy)
|
|||||||
static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype)
|
static int ael2020_setup_twinax_edc(struct cphy *phy, int modtype)
|
||||||
{
|
{
|
||||||
/* set uC to 40MHz */
|
/* set uC to 40MHz */
|
||||||
static struct reg_val uCclock40MHz[] = {
|
static const struct reg_val uCclock40MHz[] = {
|
||||||
{ MDIO_MMD_PMAPMD, 0xff28, 0xffff, 0x4001 },
|
{ MDIO_MMD_PMAPMD, 0xff28, 0xffff, 0x4001 },
|
||||||
{ MDIO_MMD_PMAPMD, 0xff2a, 0xffff, 0x0002 },
|
{ MDIO_MMD_PMAPMD, 0xff2a, 0xffff, 0x0002 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* activate uC clock */
|
/* activate uC clock */
|
||||||
static struct reg_val uCclockActivate[] = {
|
static const struct reg_val uCclockActivate[] = {
|
||||||
{ MDIO_MMD_PMAPMD, 0xd000, 0xffff, 0x5200 },
|
{ MDIO_MMD_PMAPMD, 0xd000, 0xffff, 0x5200 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* set PC to start of SRAM and activate uC */
|
/* set PC to start of SRAM and activate uC */
|
||||||
static struct reg_val uCactivate[] = {
|
static const struct reg_val uCactivate[] = {
|
||||||
{ MDIO_MMD_PMAPMD, 0xd080, 0xffff, 0x0100 },
|
{ MDIO_MMD_PMAPMD, 0xd080, 0xffff, 0x0100 },
|
||||||
{ MDIO_MMD_PMAPMD, 0xd092, 0xffff, 0x0000 },
|
{ MDIO_MMD_PMAPMD, 0xd092, 0xffff, 0x0000 },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
@ -624,7 +624,7 @@ static int ael2020_get_module_type(struct cphy *phy, int delay_ms)
|
|||||||
*/
|
*/
|
||||||
static int ael2020_intr_enable(struct cphy *phy)
|
static int ael2020_intr_enable(struct cphy *phy)
|
||||||
{
|
{
|
||||||
struct reg_val regs[] = {
|
static const struct reg_val regs[] = {
|
||||||
/* output Module's Loss Of Signal (LOS) to LED */
|
/* output Module's Loss Of Signal (LOS) to LED */
|
||||||
{ MDIO_MMD_PMAPMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT,
|
{ MDIO_MMD_PMAPMD, AEL2020_GPIO_CFG+AEL2020_GPIO_LSTAT,
|
||||||
0xffff, 0x4 },
|
0xffff, 0x4 },
|
||||||
@ -664,7 +664,7 @@ static int ael2020_intr_enable(struct cphy *phy)
|
|||||||
*/
|
*/
|
||||||
static int ael2020_intr_disable(struct cphy *phy)
|
static int ael2020_intr_disable(struct cphy *phy)
|
||||||
{
|
{
|
||||||
struct reg_val regs[] = {
|
static const struct reg_val regs[] = {
|
||||||
/* reset "link status" LED to "off" */
|
/* reset "link status" LED to "off" */
|
||||||
{ MDIO_MMD_PMAPMD, AEL2020_GPIO_CTRL,
|
{ MDIO_MMD_PMAPMD, AEL2020_GPIO_CTRL,
|
||||||
0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) },
|
0xffff, 0xb << (AEL2020_GPIO_LSTAT*4) },
|
||||||
@ -701,7 +701,7 @@ static int ael2020_intr_clear(struct cphy *phy)
|
|||||||
return err ? err : t3_phy_lasi_intr_clear(phy);
|
return err ? err : t3_phy_lasi_intr_clear(phy);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct reg_val ael2020_reset_regs[] = {
|
static const struct reg_val ael2020_reset_regs[] = {
|
||||||
/* Erratum #2: CDRLOL asserted, causing PMA link down status */
|
/* Erratum #2: CDRLOL asserted, causing PMA link down status */
|
||||||
{ MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x3101 },
|
{ MDIO_MMD_PMAPMD, 0xc003, 0xffff, 0x3101 },
|
||||||
|
|
||||||
|
@ -1562,7 +1562,7 @@ static void tp_intr_handler(struct adapter *adapter)
|
|||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct intr_info tp_intr_info_t3c[] = {
|
static const struct intr_info tp_intr_info_t3c[] = {
|
||||||
{0x1fffffff, "TP parity error", -1, 1},
|
{0x1fffffff, "TP parity error", -1, 1},
|
||||||
{F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1},
|
{F_FLMRXFLSTEMPTY, "TP out of Rx pages", -1, 1},
|
||||||
{F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1},
|
{F_FLMTXFLSTEMPTY, "TP out of Tx pages", -1, 1},
|
||||||
|
@ -116,7 +116,7 @@ static void dump_mbox(struct adapter *adapter, const char *tag, u32 mbox_data)
|
|||||||
int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
|
int t4vf_wr_mbox_core(struct adapter *adapter, const void *cmd, int size,
|
||||||
void *rpl, bool sleep_ok)
|
void *rpl, bool sleep_ok)
|
||||||
{
|
{
|
||||||
static int delay[] = {
|
static const int delay[] = {
|
||||||
1, 1, 3, 5, 10, 10, 20, 50, 100
|
1, 1, 3, 5, 10, 10, 20, 50, 100
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ static int __init e21_probe1(struct net_device *dev, int ioaddr)
|
|||||||
printk(" %02X", station_addr[i]);
|
printk(" %02X", station_addr[i]);
|
||||||
|
|
||||||
if (dev->irq < 2) {
|
if (dev->irq < 2) {
|
||||||
int irqlist[] = {15, 11, 10, 12, 5, 9, 3, 4};
|
static const int irqlist[] = {15, 11, 10, 12, 5, 9, 3, 4};
|
||||||
for (i = 0; i < ARRAY_SIZE(irqlist); i++)
|
for (i = 0; i < ARRAY_SIZE(irqlist); i++)
|
||||||
if (request_irq (irqlist[i], NULL, 0, "bogus", NULL) != -EBUSY) {
|
if (request_irq (irqlist[i], NULL, 0, "bogus", NULL) != -EBUSY) {
|
||||||
dev->irq = irqlist[i];
|
dev->irq = irqlist[i];
|
||||||
|
@ -891,12 +891,13 @@ err:
|
|||||||
there is non-reboot way to recover if something goes wrong.
|
there is non-reboot way to recover if something goes wrong.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static char irqrmap[] = {-1,-1,0,1,-1,2,-1,-1,-1,0,3,4,-1,-1,-1,-1};
|
static const char irqrmap[] = {-1,-1,0,1,-1,2,-1,-1,-1,0,3,4,-1,-1,-1,-1};
|
||||||
static char irqrmap2[] = {-1,-1,4,0,1,2,-1,3,-1,4,5,6,7,-1,-1,-1};
|
static const char irqrmap2[] = {-1,-1,4,0,1,2,-1,3,-1,4,5,6,7,-1,-1,-1};
|
||||||
static int eepro_grab_irq(struct net_device *dev)
|
static int eepro_grab_irq(struct net_device *dev)
|
||||||
{
|
{
|
||||||
int irqlist[] = { 3, 4, 5, 7, 9, 10, 11, 12, 0 };
|
static const int irqlist[] = { 3, 4, 5, 7, 9, 10, 11, 12, 0 };
|
||||||
int *irqp = irqlist, temp_reg, ioaddr = dev->base_addr;
|
const int *irqp = irqlist;
|
||||||
|
int temp_reg, ioaddr = dev->base_addr;
|
||||||
|
|
||||||
eepro_sw2bank1(ioaddr); /* be CAREFUL, BANK 1 now */
|
eepro_sw2bank1(ioaddr); /* be CAREFUL, BANK 1 now */
|
||||||
|
|
||||||
|
@ -1103,7 +1103,7 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
|
|||||||
dev->dev_addr[i] = ((unsigned char *)hw_addr)[5-i];
|
dev->dev_addr[i] = ((unsigned char *)hw_addr)[5-i];
|
||||||
|
|
||||||
{
|
{
|
||||||
static char irqmap[]={0, 9, 3, 4, 5, 10, 11, 0};
|
static const char irqmap[] = { 0, 9, 3, 4, 5, 10, 11, 0 };
|
||||||
unsigned short setupval = eexp_hw_readeeprom(ioaddr,0);
|
unsigned short setupval = eexp_hw_readeeprom(ioaddr,0);
|
||||||
|
|
||||||
/* Use the IRQ from EEPROM if none was given */
|
/* Use the IRQ from EEPROM if none was given */
|
||||||
|
@ -143,7 +143,8 @@ void gfar_halt(struct net_device *dev);
|
|||||||
static void gfar_halt_nodisable(struct net_device *dev);
|
static void gfar_halt_nodisable(struct net_device *dev);
|
||||||
void gfar_start(struct net_device *dev);
|
void gfar_start(struct net_device *dev);
|
||||||
static void gfar_clear_exact_match(struct net_device *dev);
|
static void gfar_clear_exact_match(struct net_device *dev);
|
||||||
static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr);
|
static void gfar_set_mac_for_addr(struct net_device *dev, int num,
|
||||||
|
const u8 *addr);
|
||||||
static int gfar_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
static int gfar_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||||
|
|
||||||
MODULE_AUTHOR("Freescale Semiconductor, Inc");
|
MODULE_AUTHOR("Freescale Semiconductor, Inc");
|
||||||
@ -3094,10 +3095,10 @@ static void gfar_set_multi(struct net_device *dev)
|
|||||||
static void gfar_clear_exact_match(struct net_device *dev)
|
static void gfar_clear_exact_match(struct net_device *dev)
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
u8 zero_arr[MAC_ADDR_LEN] = {0,0,0,0,0,0};
|
static const u8 zero_arr[MAC_ADDR_LEN] = {0, 0, 0, 0, 0, 0};
|
||||||
|
|
||||||
for(idx = 1;idx < GFAR_EM_NUM + 1;idx++)
|
for(idx = 1;idx < GFAR_EM_NUM + 1;idx++)
|
||||||
gfar_set_mac_for_addr(dev, idx, (u8 *)zero_arr);
|
gfar_set_mac_for_addr(dev, idx, zero_arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set the appropriate hash bit for the given addr */
|
/* Set the appropriate hash bit for the given addr */
|
||||||
@ -3132,7 +3133,8 @@ static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr)
|
|||||||
/* There are multiple MAC Address register pairs on some controllers
|
/* There are multiple MAC Address register pairs on some controllers
|
||||||
* This function sets the numth pair to a given address
|
* This function sets the numth pair to a given address
|
||||||
*/
|
*/
|
||||||
static void gfar_set_mac_for_addr(struct net_device *dev, int num, u8 *addr)
|
static void gfar_set_mac_for_addr(struct net_device *dev, int num,
|
||||||
|
const u8 *addr)
|
||||||
{
|
{
|
||||||
struct gfar_private *priv = netdev_priv(dev);
|
struct gfar_private *priv = netdev_priv(dev);
|
||||||
struct gfar __iomem *regs = priv->gfargrp[0].regs;
|
struct gfar __iomem *regs = priv->gfargrp[0].regs;
|
||||||
|
@ -162,9 +162,9 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
|
|||||||
|
|
||||||
/* Snarf the interrupt now. Someday this could be moved to open(). */
|
/* Snarf the interrupt now. Someday this could be moved to open(). */
|
||||||
if (dev->irq < 2) {
|
if (dev->irq < 2) {
|
||||||
int irq_16list[] = { 11, 10, 5, 3, 4, 7, 9, 0};
|
static const int irq_16list[] = { 11, 10, 5, 3, 4, 7, 9, 0};
|
||||||
int irq_8list[] = { 7, 5, 3, 4, 9, 0};
|
static const int irq_8list[] = { 7, 5, 3, 4, 9, 0};
|
||||||
int *irqp = wordmode ? irq_16list : irq_8list;
|
const int *irqp = wordmode ? irq_16list : irq_8list;
|
||||||
do {
|
do {
|
||||||
int irq = *irqp;
|
int irq = *irqp;
|
||||||
if (request_irq (irq, NULL, 0, "bogus", NULL) != -EBUSY) {
|
if (request_irq (irq, NULL, 0, "bogus", NULL) != -EBUSY) {
|
||||||
|
@ -199,7 +199,7 @@ static int act200l_reset(struct sir_dev *dev)
|
|||||||
{
|
{
|
||||||
unsigned state = dev->fsm.substate;
|
unsigned state = dev->fsm.substate;
|
||||||
unsigned delay = 0;
|
unsigned delay = 0;
|
||||||
u8 control[9] = {
|
static const u8 control[9] = {
|
||||||
ACT200L_REG15,
|
ACT200L_REG15,
|
||||||
ACT200L_REG13 | ACT200L_SHDW,
|
ACT200L_REG13 | ACT200L_SHDW,
|
||||||
ACT200L_REG21 | ACT200L_EXCK | ACT200L_OSCL,
|
ACT200L_REG21 | ACT200L_EXCK | ACT200L_OSCL,
|
||||||
|
@ -818,9 +818,9 @@ toshoboe_probe (struct toshoboe_cb *self)
|
|||||||
{
|
{
|
||||||
int i, j, n;
|
int i, j, n;
|
||||||
#ifdef USE_MIR
|
#ifdef USE_MIR
|
||||||
int bauds[] = { 9600, 115200, 4000000, 1152000 };
|
static const int bauds[] = { 9600, 115200, 4000000, 1152000 };
|
||||||
#else
|
#else
|
||||||
int bauds[] = { 9600, 115200, 4000000 };
|
static const int bauds[] = { 9600, 115200, 4000000 };
|
||||||
#endif
|
#endif
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ jme_reset_phy_processor(struct jme_adapter *jme)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
jme_setup_wakeup_frame(struct jme_adapter *jme,
|
jme_setup_wakeup_frame(struct jme_adapter *jme,
|
||||||
u32 *mask, u32 crc, int fnr)
|
const u32 *mask, u32 crc, int fnr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ jme_setup_wakeup_frame(struct jme_adapter *jme,
|
|||||||
static inline void
|
static inline void
|
||||||
jme_reset_mac_processor(struct jme_adapter *jme)
|
jme_reset_mac_processor(struct jme_adapter *jme)
|
||||||
{
|
{
|
||||||
u32 mask[WAKEUP_FRAME_MASK_DWNR] = {0, 0, 0, 0};
|
static const u32 mask[WAKEUP_FRAME_MASK_DWNR] = {0, 0, 0, 0};
|
||||||
u32 crc = 0xCDCDCDCD;
|
u32 crc = 0xCDCDCDCD;
|
||||||
u32 gpreg0;
|
u32 gpreg0;
|
||||||
int i;
|
int i;
|
||||||
|
@ -3570,7 +3570,7 @@ static void hw_cfg_wol(struct ksz_hw *hw, u16 frame, int set)
|
|||||||
* This routine is used to program Wake-on-LAN pattern.
|
* This routine is used to program Wake-on-LAN pattern.
|
||||||
*/
|
*/
|
||||||
static void hw_set_wol_frame(struct ksz_hw *hw, int i, uint mask_size,
|
static void hw_set_wol_frame(struct ksz_hw *hw, int i, uint mask_size,
|
||||||
u8 *mask, uint frame_size, u8 *pattern)
|
const u8 *mask, uint frame_size, const u8 *pattern)
|
||||||
{
|
{
|
||||||
int bits;
|
int bits;
|
||||||
int from;
|
int from;
|
||||||
@ -3626,9 +3626,9 @@ static void hw_set_wol_frame(struct ksz_hw *hw, int i, uint mask_size,
|
|||||||
*
|
*
|
||||||
* This routine is used to add ARP pattern for waking up the host.
|
* This routine is used to add ARP pattern for waking up the host.
|
||||||
*/
|
*/
|
||||||
static void hw_add_wol_arp(struct ksz_hw *hw, u8 *ip_addr)
|
static void hw_add_wol_arp(struct ksz_hw *hw, const u8 *ip_addr)
|
||||||
{
|
{
|
||||||
u8 mask[6] = { 0x3F, 0xF0, 0x3F, 0x00, 0xC0, 0x03 };
|
static const u8 mask[6] = { 0x3F, 0xF0, 0x3F, 0x00, 0xC0, 0x03 };
|
||||||
u8 pattern[42] = {
|
u8 pattern[42] = {
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
@ -3651,8 +3651,8 @@ static void hw_add_wol_arp(struct ksz_hw *hw, u8 *ip_addr)
|
|||||||
*/
|
*/
|
||||||
static void hw_add_wol_bcast(struct ksz_hw *hw)
|
static void hw_add_wol_bcast(struct ksz_hw *hw)
|
||||||
{
|
{
|
||||||
u8 mask[] = { 0x3F };
|
static const u8 mask[] = { 0x3F };
|
||||||
u8 pattern[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
static const u8 pattern[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
|
||||||
|
|
||||||
hw_set_wol_frame(hw, 2, 1, mask, MAC_ADDR_LEN, pattern);
|
hw_set_wol_frame(hw, 2, 1, mask, MAC_ADDR_LEN, pattern);
|
||||||
}
|
}
|
||||||
@ -3669,7 +3669,7 @@ static void hw_add_wol_bcast(struct ksz_hw *hw)
|
|||||||
*/
|
*/
|
||||||
static void hw_add_wol_mcast(struct ksz_hw *hw)
|
static void hw_add_wol_mcast(struct ksz_hw *hw)
|
||||||
{
|
{
|
||||||
u8 mask[] = { 0x3F };
|
static const u8 mask[] = { 0x3F };
|
||||||
u8 pattern[] = { 0x33, 0x33, 0xFF, 0x00, 0x00, 0x00 };
|
u8 pattern[] = { 0x33, 0x33, 0xFF, 0x00, 0x00, 0x00 };
|
||||||
|
|
||||||
memcpy(&pattern[3], &hw->override_addr[3], 3);
|
memcpy(&pattern[3], &hw->override_addr[3], 3);
|
||||||
@ -3687,7 +3687,7 @@ static void hw_add_wol_mcast(struct ksz_hw *hw)
|
|||||||
*/
|
*/
|
||||||
static void hw_add_wol_ucast(struct ksz_hw *hw)
|
static void hw_add_wol_ucast(struct ksz_hw *hw)
|
||||||
{
|
{
|
||||||
u8 mask[] = { 0x3F };
|
static const u8 mask[] = { 0x3F };
|
||||||
|
|
||||||
hw_set_wol_frame(hw, 0, 1, mask, MAC_ADDR_LEN, hw->override_addr);
|
hw_set_wol_frame(hw, 0, 1, mask, MAC_ADDR_LEN, hw->override_addr);
|
||||||
}
|
}
|
||||||
@ -3700,7 +3700,7 @@ static void hw_add_wol_ucast(struct ksz_hw *hw)
|
|||||||
*
|
*
|
||||||
* This routine is used to enable Wake-on-LAN depending on driver settings.
|
* This routine is used to enable Wake-on-LAN depending on driver settings.
|
||||||
*/
|
*/
|
||||||
static void hw_enable_wol(struct ksz_hw *hw, u32 wol_enable, u8 *net_addr)
|
static void hw_enable_wol(struct ksz_hw *hw, u32 wol_enable, const u8 *net_addr)
|
||||||
{
|
{
|
||||||
hw_cfg_wol(hw, KS8841_WOL_MAGIC_ENABLE, (wol_enable & WAKE_MAGIC));
|
hw_cfg_wol(hw, KS8841_WOL_MAGIC_ENABLE, (wol_enable & WAKE_MAGIC));
|
||||||
hw_cfg_wol(hw, KS8841_WOL_FRAME0_ENABLE, (wol_enable & WAKE_UCAST));
|
hw_cfg_wol(hw, KS8841_WOL_FRAME0_ENABLE, (wol_enable & WAKE_UCAST));
|
||||||
@ -6208,7 +6208,7 @@ static int netdev_set_wol(struct net_device *dev,
|
|||||||
struct dev_info *hw_priv = priv->adapter;
|
struct dev_info *hw_priv = priv->adapter;
|
||||||
|
|
||||||
/* Need to find a way to retrieve the device IP address. */
|
/* Need to find a way to retrieve the device IP address. */
|
||||||
u8 net_addr[] = { 192, 168, 1, 1 };
|
static const u8 net_addr[] = { 192, 168, 1, 1 };
|
||||||
|
|
||||||
if (wol->wolopts & ~hw_priv->wol_support)
|
if (wol->wolopts & ~hw_priv->wol_support)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@ -7241,7 +7241,7 @@ static int pcidev_suspend(struct pci_dev *pdev, pm_message_t state)
|
|||||||
struct ksz_hw *hw = &hw_priv->hw;
|
struct ksz_hw *hw = &hw_priv->hw;
|
||||||
|
|
||||||
/* Need to find a way to retrieve the device IP address. */
|
/* Need to find a way to retrieve the device IP address. */
|
||||||
u8 net_addr[] = { 192, 168, 1, 1 };
|
static const u8 net_addr[] = { 192, 168, 1, 1 };
|
||||||
|
|
||||||
for (i = 0; i < hw->dev_count; i++) {
|
for (i = 0; i < hw->dev_count; i++) {
|
||||||
if (info->netdev[i]) {
|
if (info->netdev[i]) {
|
||||||
|
@ -655,7 +655,7 @@ nx_p3_sre_macaddr_change(struct netxen_adapter *adapter, u8 *addr, unsigned op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int nx_p3_nic_add_mac(struct netxen_adapter *adapter,
|
static int nx_p3_nic_add_mac(struct netxen_adapter *adapter,
|
||||||
u8 *addr, struct list_head *del_list)
|
const u8 *addr, struct list_head *del_list)
|
||||||
{
|
{
|
||||||
struct list_head *head;
|
struct list_head *head;
|
||||||
nx_mac_list_t *cur;
|
nx_mac_list_t *cur;
|
||||||
@ -686,7 +686,9 @@ static void netxen_p3_nic_set_multi(struct net_device *netdev)
|
|||||||
{
|
{
|
||||||
struct netxen_adapter *adapter = netdev_priv(netdev);
|
struct netxen_adapter *adapter = netdev_priv(netdev);
|
||||||
struct netdev_hw_addr *ha;
|
struct netdev_hw_addr *ha;
|
||||||
u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
static const u8 bcast_addr[ETH_ALEN] = {
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||||
|
};
|
||||||
u32 mode = VPORT_MISS_MODE_DROP;
|
u32 mode = VPORT_MISS_MODE_DROP;
|
||||||
LIST_HEAD(del_list);
|
LIST_HEAD(del_list);
|
||||||
struct list_head *head;
|
struct list_head *head;
|
||||||
@ -869,9 +871,11 @@ int netxen_config_rss(struct netxen_adapter *adapter, int enable)
|
|||||||
u64 word;
|
u64 word;
|
||||||
int i, rv;
|
int i, rv;
|
||||||
|
|
||||||
u64 key[] = { 0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
|
static const u64 key[] = {
|
||||||
0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
|
0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
|
||||||
0x255b0ec26d5a56daULL };
|
0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
|
||||||
|
0x255b0ec26d5a56daULL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
memset(&req, 0, sizeof(nx_nic_req_t));
|
memset(&req, 0, sizeof(nx_nic_req_t));
|
||||||
@ -895,7 +899,7 @@ int netxen_config_rss(struct netxen_adapter *adapter, int enable)
|
|||||||
((u64)(enable & 0x1) << 8) |
|
((u64)(enable & 0x1) << 8) |
|
||||||
((0x7ULL) << 48);
|
((0x7ULL) << 48);
|
||||||
req.words[0] = cpu_to_le64(word);
|
req.words[0] = cpu_to_le64(word);
|
||||||
for (i = 0; i < 5; i++)
|
for (i = 0; i < ARRAY_SIZE(key); i++)
|
||||||
req.words[i+1] = cpu_to_le64(key[i]);
|
req.words[i+1] = cpu_to_le64(key[i]);
|
||||||
|
|
||||||
|
|
||||||
|
@ -388,9 +388,9 @@ static long memend; /* e.g 0xd4000 */
|
|||||||
struct net_device * __init ni52_probe(int unit)
|
struct net_device * __init ni52_probe(int unit)
|
||||||
{
|
{
|
||||||
struct net_device *dev = alloc_etherdev(sizeof(struct priv));
|
struct net_device *dev = alloc_etherdev(sizeof(struct priv));
|
||||||
static int ports[] = {0x300, 0x280, 0x360 , 0x320 , 0x340, 0};
|
static const int ports[] = {0x300, 0x280, 0x360, 0x320, 0x340, 0};
|
||||||
|
const int *port;
|
||||||
struct priv *p;
|
struct priv *p;
|
||||||
int *port;
|
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (!dev)
|
if (!dev)
|
||||||
|
@ -361,8 +361,8 @@ static int dma;
|
|||||||
struct net_device * __init ni65_probe(int unit)
|
struct net_device * __init ni65_probe(int unit)
|
||||||
{
|
{
|
||||||
struct net_device *dev = alloc_etherdev(0);
|
struct net_device *dev = alloc_etherdev(0);
|
||||||
static int ports[] = {0x360,0x300,0x320,0x340, 0};
|
static const int ports[] = { 0x360, 0x300, 0x320, 0x340, 0 };
|
||||||
int *port;
|
const int *port;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
if (!dev)
|
if (!dev)
|
||||||
|
@ -1291,7 +1291,7 @@ updateCRC
|
|||||||
|
|
||||||
static void updateCRC(int *CRC, int bit)
|
static void updateCRC(int *CRC, int bit)
|
||||||
{
|
{
|
||||||
int poly[]={
|
static const int poly[]={
|
||||||
1,1,1,0, 1,1,0,1,
|
1,1,1,0, 1,1,0,1,
|
||||||
1,0,1,1, 1,0,0,0,
|
1,0,1,1, 1,0,0,0,
|
||||||
1,0,0,0, 0,0,1,1,
|
1,0,0,0, 0,0,1,1,
|
||||||
|
@ -381,7 +381,7 @@ qlcnic_sre_macaddr_change(struct qlcnic_adapter *adapter, u8 *addr,
|
|||||||
return qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
|
return qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, u8 *addr)
|
static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, const u8 *addr)
|
||||||
{
|
{
|
||||||
struct list_head *head;
|
struct list_head *head;
|
||||||
struct qlcnic_mac_list_s *cur;
|
struct qlcnic_mac_list_s *cur;
|
||||||
@ -415,7 +415,9 @@ void qlcnic_set_multi(struct net_device *netdev)
|
|||||||
{
|
{
|
||||||
struct qlcnic_adapter *adapter = netdev_priv(netdev);
|
struct qlcnic_adapter *adapter = netdev_priv(netdev);
|
||||||
struct netdev_hw_addr *ha;
|
struct netdev_hw_addr *ha;
|
||||||
u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
static const u8 bcast_addr[ETH_ALEN] = {
|
||||||
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff
|
||||||
|
};
|
||||||
u32 mode = VPORT_MISS_MODE_DROP;
|
u32 mode = VPORT_MISS_MODE_DROP;
|
||||||
|
|
||||||
if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state))
|
if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state))
|
||||||
@ -621,10 +623,11 @@ int qlcnic_config_rss(struct qlcnic_adapter *adapter, int enable)
|
|||||||
u64 word;
|
u64 word;
|
||||||
int i, rv;
|
int i, rv;
|
||||||
|
|
||||||
const u64 key[] = { 0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
|
static const u64 key[] = {
|
||||||
0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
|
0xbeac01fa6a42b73bULL, 0x8030f20c77cb2da3ULL,
|
||||||
0x255b0ec26d5a56daULL };
|
0xae7b30b4d0ca2bcbULL, 0x43a38fb04167253dULL,
|
||||||
|
0x255b0ec26d5a56daULL
|
||||||
|
};
|
||||||
|
|
||||||
memset(&req, 0, sizeof(struct qlcnic_nic_req));
|
memset(&req, 0, sizeof(struct qlcnic_nic_req));
|
||||||
req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23);
|
req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23);
|
||||||
|
@ -3548,12 +3548,13 @@ err_irq:
|
|||||||
|
|
||||||
static int ql_start_rss(struct ql_adapter *qdev)
|
static int ql_start_rss(struct ql_adapter *qdev)
|
||||||
{
|
{
|
||||||
u8 init_hash_seed[] = {0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
|
static const u8 init_hash_seed[] = {
|
||||||
0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f,
|
0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
|
||||||
0xb0, 0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b,
|
0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
|
||||||
0x30, 0xb4, 0x77, 0xcb, 0x2d, 0xa3, 0x80,
|
0xd0, 0xca, 0x2b, 0xcb, 0xae, 0x7b, 0x30, 0xb4,
|
||||||
0x30, 0xf2, 0x0c, 0x6a, 0x42, 0xb7, 0x3b,
|
0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c,
|
||||||
0xbe, 0xac, 0x01, 0xfa};
|
0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa
|
||||||
|
};
|
||||||
struct ricb *ricb = &qdev->ricb;
|
struct ricb *ricb = &qdev->ricb;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
int i;
|
int i;
|
||||||
|
@ -2526,7 +2526,7 @@ static void rtl8168d_2_hw_phy_config(void __iomem *ioaddr)
|
|||||||
|
|
||||||
val = mdio_read(ioaddr, 0x0d);
|
val = mdio_read(ioaddr, 0x0d);
|
||||||
if ((val & 0x00ff) != 0x006c) {
|
if ((val & 0x00ff) != 0x006c) {
|
||||||
u32 set[] = {
|
static const u32 set[] = {
|
||||||
0x0065, 0x0066, 0x0067, 0x0068,
|
0x0065, 0x0066, 0x0067, 0x0068,
|
||||||
0x0069, 0x006a, 0x006b, 0x006c
|
0x0069, 0x006a, 0x006b, 0x006c
|
||||||
};
|
};
|
||||||
|
@ -1263,7 +1263,7 @@ void smt_set_timestamp(struct s_smc *smc, u_char *p)
|
|||||||
static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy)
|
static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy)
|
||||||
{
|
{
|
||||||
int i ;
|
int i ;
|
||||||
u_char *map ;
|
const u_char *map ;
|
||||||
u_short in ;
|
u_short in ;
|
||||||
u_short out ;
|
u_short out ;
|
||||||
|
|
||||||
@ -1271,7 +1271,7 @@ static void smt_fill_policy(struct s_smc *smc, struct smt_p_policy *policy)
|
|||||||
* MIB para 101b (fddiSMTConnectionPolicy) coding
|
* MIB para 101b (fddiSMTConnectionPolicy) coding
|
||||||
* is different from 0005 coding
|
* is different from 0005 coding
|
||||||
*/
|
*/
|
||||||
static u_char ansi_weirdness[16] = {
|
static const u_char ansi_weirdness[16] = {
|
||||||
0,7,5,3,8,1,6,4,9,10,2,11,12,13,14,15
|
0,7,5,3,8,1,6,4,9,10,2,11,12,13,14,15
|
||||||
} ;
|
} ;
|
||||||
SMTSETPARA(policy,SMT_P_POLICY) ;
|
SMTSETPARA(policy,SMT_P_POLICY) ;
|
||||||
|
@ -1191,7 +1191,7 @@ static void genesis_init(struct skge_hw *hw)
|
|||||||
|
|
||||||
static void genesis_reset(struct skge_hw *hw, int port)
|
static void genesis_reset(struct skge_hw *hw, int port)
|
||||||
{
|
{
|
||||||
const u8 zero[8] = { 0 };
|
static const u8 zero[8] = { 0 };
|
||||||
u32 reg;
|
u32 reg;
|
||||||
|
|
||||||
skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0);
|
skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0);
|
||||||
@ -1557,7 +1557,7 @@ static void genesis_mac_init(struct skge_hw *hw, int port)
|
|||||||
int jumbo = hw->dev[port]->mtu > ETH_DATA_LEN;
|
int jumbo = hw->dev[port]->mtu > ETH_DATA_LEN;
|
||||||
int i;
|
int i;
|
||||||
u32 r;
|
u32 r;
|
||||||
const u8 zero[6] = { 0 };
|
static const u8 zero[6] = { 0 };
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
skge_write16(hw, SK_REG(port, TX_MFF_CTRL1),
|
skge_write16(hw, SK_REG(port, TX_MFF_CTRL1),
|
||||||
|
@ -277,8 +277,12 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
|
|||||||
dev->base_addr = ioaddr+ULTRA_NIC_OFFSET;
|
dev->base_addr = ioaddr+ULTRA_NIC_OFFSET;
|
||||||
|
|
||||||
{
|
{
|
||||||
int addr_tbl[4] = {0x0C0000, 0x0E0000, 0xFC0000, 0xFE0000};
|
static const int addr_tbl[4] = {
|
||||||
short num_pages_tbl[4] = {0x20, 0x40, 0x80, 0xff};
|
0x0C0000, 0x0E0000, 0xFC0000, 0xFE0000
|
||||||
|
};
|
||||||
|
static const short num_pages_tbl[4] = {
|
||||||
|
0x20, 0x40, 0x80, 0xff
|
||||||
|
};
|
||||||
|
|
||||||
dev->mem_start = ((addr & 0x0f) << 13) + addr_tbl[(addr >> 6) & 3] ;
|
dev->mem_start = ((addr & 0x0f) << 13) + addr_tbl[(addr >> 6) & 3] ;
|
||||||
num_pages = num_pages_tbl[(addr >> 4) & 3];
|
num_pages = num_pages_tbl[(addr >> 4) & 3];
|
||||||
|
@ -13086,17 +13086,15 @@ static inline u32 tg3_rx_ret_ring_size(struct tg3 *tp)
|
|||||||
return 512;
|
return 512;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_PCI_DEVICE_TABLE(write_reorder_chipsets) = {
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_700C) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8385_0) },
|
||||||
|
{ },
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit tg3_get_invariants(struct tg3 *tp)
|
static int __devinit tg3_get_invariants(struct tg3 *tp)
|
||||||
{
|
{
|
||||||
static struct pci_device_id write_reorder_chipsets[] = {
|
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_AMD,
|
|
||||||
PCI_DEVICE_ID_AMD_FE_GATE_700C) },
|
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_AMD,
|
|
||||||
PCI_DEVICE_ID_AMD_8131_BRIDGE) },
|
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_VIA,
|
|
||||||
PCI_DEVICE_ID_VIA_8385_0) },
|
|
||||||
{ },
|
|
||||||
};
|
|
||||||
u32 misc_ctrl_reg;
|
u32 misc_ctrl_reg;
|
||||||
u32 pci_state_reg, grc_misc_cfg;
|
u32 pci_state_reg, grc_misc_cfg;
|
||||||
u32 val;
|
u32 val;
|
||||||
@ -14229,6 +14227,11 @@ static int __devinit tg3_do_test_dma(struct tg3 *tp, u32 *buf, dma_addr_t buf_dm
|
|||||||
|
|
||||||
#define TEST_BUFFER_SIZE 0x2000
|
#define TEST_BUFFER_SIZE 0x2000
|
||||||
|
|
||||||
|
DEFINE_PCI_DEVICE_TABLE(dma_wait_state_chipsets) = {
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_PCI15) },
|
||||||
|
{ },
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit tg3_test_dma(struct tg3 *tp)
|
static int __devinit tg3_test_dma(struct tg3 *tp)
|
||||||
{
|
{
|
||||||
dma_addr_t buf_dma;
|
dma_addr_t buf_dma;
|
||||||
@ -14398,11 +14401,6 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
|
|||||||
}
|
}
|
||||||
if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) !=
|
if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) !=
|
||||||
DMA_RWCTRL_WRITE_BNDRY_16) {
|
DMA_RWCTRL_WRITE_BNDRY_16) {
|
||||||
static struct pci_device_id dma_wait_state_chipsets[] = {
|
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_APPLE,
|
|
||||||
PCI_DEVICE_ID_APPLE_UNI_N_PCI15) },
|
|
||||||
{ },
|
|
||||||
};
|
|
||||||
|
|
||||||
/* DMA test passed without adjusting DMA boundary,
|
/* DMA test passed without adjusting DMA boundary,
|
||||||
* now look for chipsets that are known to expose the
|
* now look for chipsets that are known to expose the
|
||||||
|
@ -657,8 +657,9 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
|
|||||||
#ifndef PCMCIA
|
#ifndef PCMCIA
|
||||||
/* finish figuring the shared RAM address */
|
/* finish figuring the shared RAM address */
|
||||||
if (cardpresent == TR_ISA) {
|
if (cardpresent == TR_ISA) {
|
||||||
static __u32 ram_bndry_mask[] =
|
static const __u32 ram_bndry_mask[] = {
|
||||||
{ 0xffffe000, 0xffffc000, 0xffff8000, 0xffff0000 };
|
0xffffe000, 0xffffc000, 0xffff8000, 0xffff0000
|
||||||
|
};
|
||||||
__u32 new_base, rrr_32, chk_base, rbm;
|
__u32 new_base, rrr_32, chk_base, rbm;
|
||||||
|
|
||||||
rrr_32=readb(ti->mmio+ACA_OFFSET+ACA_RW+RRR_ODD) >> 2 & 0x03;
|
rrr_32=readb(ti->mmio+ACA_OFFSET+ACA_RW+RRR_ODD) >> 2 & 0x03;
|
||||||
|
@ -964,7 +964,7 @@ static void de_set_media (struct de_private *de)
|
|||||||
dw32(MacMode, macmode);
|
dw32(MacMode, macmode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void de_next_media (struct de_private *de, u32 *media,
|
static void de_next_media (struct de_private *de, const u32 *media,
|
||||||
unsigned int n_media)
|
unsigned int n_media)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@ -1008,10 +1008,10 @@ static void de21040_media_timer (unsigned long data)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (de->media_type == DE_MEDIA_AUI) {
|
if (de->media_type == DE_MEDIA_AUI) {
|
||||||
u32 next_state = DE_MEDIA_TP;
|
static const u32 next_state = DE_MEDIA_TP;
|
||||||
de_next_media(de, &next_state, 1);
|
de_next_media(de, &next_state, 1);
|
||||||
} else {
|
} else {
|
||||||
u32 next_state = DE_MEDIA_AUI;
|
static const u32 next_state = DE_MEDIA_AUI;
|
||||||
de_next_media(de, &next_state, 1);
|
de_next_media(de, &next_state, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1136,13 +1136,19 @@ static void de21041_media_timer (unsigned long data)
|
|||||||
* simply resets the PHY and reloads the current media settings.
|
* simply resets the PHY and reloads the current media settings.
|
||||||
*/
|
*/
|
||||||
if (de->media_type == DE_MEDIA_AUI) {
|
if (de->media_type == DE_MEDIA_AUI) {
|
||||||
u32 next_states[] = { DE_MEDIA_BNC, DE_MEDIA_TP_AUTO };
|
static const u32 next_states[] = {
|
||||||
|
DE_MEDIA_BNC, DE_MEDIA_TP_AUTO
|
||||||
|
};
|
||||||
de_next_media(de, next_states, ARRAY_SIZE(next_states));
|
de_next_media(de, next_states, ARRAY_SIZE(next_states));
|
||||||
} else if (de->media_type == DE_MEDIA_BNC) {
|
} else if (de->media_type == DE_MEDIA_BNC) {
|
||||||
u32 next_states[] = { DE_MEDIA_TP_AUTO, DE_MEDIA_AUI };
|
static const u32 next_states[] = {
|
||||||
|
DE_MEDIA_TP_AUTO, DE_MEDIA_AUI
|
||||||
|
};
|
||||||
de_next_media(de, next_states, ARRAY_SIZE(next_states));
|
de_next_media(de, next_states, ARRAY_SIZE(next_states));
|
||||||
} else {
|
} else {
|
||||||
u32 next_states[] = { DE_MEDIA_AUI, DE_MEDIA_BNC, DE_MEDIA_TP_AUTO };
|
static const u32 next_states[] = {
|
||||||
|
DE_MEDIA_AUI, DE_MEDIA_BNC, DE_MEDIA_TP_AUTO
|
||||||
|
};
|
||||||
de_next_media(de, next_states, ARRAY_SIZE(next_states));
|
de_next_media(de, next_states, ARRAY_SIZE(next_states));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1302,17 +1302,18 @@ static const struct net_device_ops tulip_netdev_ops = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
DEFINE_PCI_DEVICE_TABLE(early_486_chipsets) = {
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424) },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496) },
|
||||||
|
{ },
|
||||||
|
};
|
||||||
|
|
||||||
static int __devinit tulip_init_one (struct pci_dev *pdev,
|
static int __devinit tulip_init_one (struct pci_dev *pdev,
|
||||||
const struct pci_device_id *ent)
|
const struct pci_device_id *ent)
|
||||||
{
|
{
|
||||||
struct tulip_private *tp;
|
struct tulip_private *tp;
|
||||||
/* See note below on the multiport cards. */
|
/* See note below on the multiport cards. */
|
||||||
static unsigned char last_phys_addr[6] = {0x00, 'L', 'i', 'n', 'u', 'x'};
|
static unsigned char last_phys_addr[6] = {0x00, 'L', 'i', 'n', 'u', 'x'};
|
||||||
static struct pci_device_id early_486_chipsets[] = {
|
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82424) },
|
|
||||||
{ PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496) },
|
|
||||||
{ },
|
|
||||||
};
|
|
||||||
static int last_irq;
|
static int last_irq;
|
||||||
static int multiport_cnt; /* For four-port boards w/one EEPROM */
|
static int multiport_cnt; /* For four-port boards w/one EEPROM */
|
||||||
int i, irq;
|
int i, irq;
|
||||||
@ -1682,7 +1683,9 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
|
|||||||
tp->full_duplex_lock = 1;
|
tp->full_duplex_lock = 1;
|
||||||
|
|
||||||
if (tulip_media_cap[tp->default_port] & MediaIsMII) {
|
if (tulip_media_cap[tp->default_port] & MediaIsMII) {
|
||||||
u16 media2advert[] = { 0x20, 0x40, 0x03e0, 0x60, 0x80, 0x100, 0x200 };
|
static const u16 media2advert[] = {
|
||||||
|
0x20, 0x40, 0x03e0, 0x60, 0x80, 0x100, 0x200
|
||||||
|
};
|
||||||
tp->mii_advertise = media2advert[tp->default_port - 9];
|
tp->mii_advertise = media2advert[tp->default_port - 9];
|
||||||
tp->mii_advertise |= (tp->flags & HAS_8023X); /* Matching bits! */
|
tp->mii_advertise |= (tp->flags & HAS_8023X); /* Matching bits! */
|
||||||
}
|
}
|
||||||
|
@ -997,6 +997,18 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void fix_crc_bug(struct urb *urb, __le16 max_packet_size)
|
||||||
|
{
|
||||||
|
static const u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF };
|
||||||
|
u32 rest = urb->actual_length % le16_to_cpu(max_packet_size);
|
||||||
|
|
||||||
|
if (((rest == 5) || (rest == 6)) &&
|
||||||
|
!memcmp(((u8 *)urb->transfer_buffer) + urb->actual_length - 4,
|
||||||
|
crc_check, 4)) {
|
||||||
|
urb->actual_length -= 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Moving data from usb to kernel (in interrupt state) */
|
/* Moving data from usb to kernel (in interrupt state) */
|
||||||
static void read_bulk_callback(struct urb *urb)
|
static void read_bulk_callback(struct urb *urb)
|
||||||
{
|
{
|
||||||
@ -1025,17 +1037,8 @@ static void read_bulk_callback(struct urb *urb)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (odev->parent->port_spec & HSO_INFO_CRC_BUG) {
|
if (odev->parent->port_spec & HSO_INFO_CRC_BUG)
|
||||||
u32 rest;
|
fix_crc_bug(urb, odev->in_endp->wMaxPacketSize);
|
||||||
u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF };
|
|
||||||
rest = urb->actual_length %
|
|
||||||
le16_to_cpu(odev->in_endp->wMaxPacketSize);
|
|
||||||
if (((rest == 5) || (rest == 6)) &&
|
|
||||||
!memcmp(((u8 *) urb->transfer_buffer) +
|
|
||||||
urb->actual_length - 4, crc_check, 4)) {
|
|
||||||
urb->actual_length -= 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do we even have a packet? */
|
/* do we even have a packet? */
|
||||||
if (urb->actual_length) {
|
if (urb->actual_length) {
|
||||||
@ -1227,18 +1230,8 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
if (serial->parent->port_spec & HSO_INFO_CRC_BUG) {
|
if (serial->parent->port_spec & HSO_INFO_CRC_BUG)
|
||||||
u32 rest;
|
fix_crc_bug(urb, serial->in_endp->wMaxPacketSize);
|
||||||
u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF };
|
|
||||||
rest =
|
|
||||||
urb->actual_length %
|
|
||||||
le16_to_cpu(serial->in_endp->wMaxPacketSize);
|
|
||||||
if (((rest == 5) || (rest == 6)) &&
|
|
||||||
!memcmp(((u8 *) urb->transfer_buffer) +
|
|
||||||
urb->actual_length - 4, crc_check, 4)) {
|
|
||||||
urb->actual_length -= 4;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* Valid data, handle RX data */
|
/* Valid data, handle RX data */
|
||||||
spin_lock(&serial->serial_lock);
|
spin_lock(&serial->serial_lock);
|
||||||
serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1;
|
serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1;
|
||||||
|
@ -1131,7 +1131,9 @@ static int
|
|||||||
vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
|
vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
|
||||||
struct vmxnet3_adapter *adapter, int quota)
|
struct vmxnet3_adapter *adapter, int quota)
|
||||||
{
|
{
|
||||||
static u32 rxprod_reg[2] = {VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2};
|
static const u32 rxprod_reg[2] = {
|
||||||
|
VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2
|
||||||
|
};
|
||||||
u32 num_rxd = 0;
|
u32 num_rxd = 0;
|
||||||
struct Vmxnet3_RxCompDesc *rcd;
|
struct Vmxnet3_RxCompDesc *rcd;
|
||||||
struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx;
|
struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx;
|
||||||
|
@ -1358,7 +1358,7 @@ static int dscc4_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dscc4_match(struct thingie *p, int value)
|
static int dscc4_match(const struct thingie *p, int value)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -1403,7 +1403,7 @@ done:
|
|||||||
static int dscc4_encoding_setting(struct dscc4_dev_priv *dpriv,
|
static int dscc4_encoding_setting(struct dscc4_dev_priv *dpriv,
|
||||||
struct net_device *dev)
|
struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct thingie encoding[] = {
|
static const struct thingie encoding[] = {
|
||||||
{ ENCODING_NRZ, 0x00000000 },
|
{ ENCODING_NRZ, 0x00000000 },
|
||||||
{ ENCODING_NRZI, 0x00200000 },
|
{ ENCODING_NRZI, 0x00200000 },
|
||||||
{ ENCODING_FM_MARK, 0x00400000 },
|
{ ENCODING_FM_MARK, 0x00400000 },
|
||||||
@ -1442,7 +1442,7 @@ static int dscc4_loopback_setting(struct dscc4_dev_priv *dpriv,
|
|||||||
static int dscc4_crc_setting(struct dscc4_dev_priv *dpriv,
|
static int dscc4_crc_setting(struct dscc4_dev_priv *dpriv,
|
||||||
struct net_device *dev)
|
struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct thingie crc[] = {
|
static const struct thingie crc[] = {
|
||||||
{ PARITY_CRC16_PR0_CCITT, 0x00000010 },
|
{ PARITY_CRC16_PR0_CCITT, 0x00000010 },
|
||||||
{ PARITY_CRC16_PR1_CCITT, 0x00000000 },
|
{ PARITY_CRC16_PR1_CCITT, 0x00000000 },
|
||||||
{ PARITY_CRC32_PR0_CCITT, 0x00000011 },
|
{ PARITY_CRC32_PR0_CCITT, 0x00000011 },
|
||||||
|
@ -275,7 +275,7 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
|
|||||||
dev->base_addr = ioaddr+WD_NIC_OFFSET;
|
dev->base_addr = ioaddr+WD_NIC_OFFSET;
|
||||||
|
|
||||||
if (dev->irq < 2) {
|
if (dev->irq < 2) {
|
||||||
int irqmap[] = {9,3,5,7,10,11,15,4};
|
static const int irqmap[] = {9, 3, 5, 7, 10, 11, 15, 4};
|
||||||
int reg1 = inb(ioaddr+1);
|
int reg1 = inb(ioaddr+1);
|
||||||
int reg4 = inb(ioaddr+4);
|
int reg4 = inb(ioaddr+4);
|
||||||
if (ancient || reg1 == 0xff) { /* Ack!! No way to read the IRQ! */
|
if (ancient || reg1 == 0xff) { /* Ack!! No way to read the IRQ! */
|
||||||
|
Loading…
Reference in New Issue
Block a user