You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
This commit is contained in:
+1
-1
@@ -2136,7 +2136,7 @@ static int __init b44_init(void)
|
||||
|
||||
/* Setup paramaters for syncing RX/TX DMA descriptors */
|
||||
dma_desc_align_mask = ~(dma_desc_align_size - 1);
|
||||
dma_desc_sync_size = max(dma_desc_align_size, sizeof(struct dma_desc));
|
||||
dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
|
||||
|
||||
return pci_module_init(&b44_driver);
|
||||
}
|
||||
|
||||
+96
-46
@@ -1,25 +1,25 @@
|
||||
/*******************************************************************************
|
||||
|
||||
|
||||
|
||||
Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
Software Foundation; either version 2 of the License, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59
|
||||
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
The full GNU General Public License is included in this distribution in the
|
||||
file called LICENSE.
|
||||
|
||||
|
||||
Contact Information:
|
||||
Linux NICS <linux.nics@intel.com>
|
||||
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
@@ -160,7 +160,7 @@
|
||||
|
||||
#define DRV_NAME "e100"
|
||||
#define DRV_EXT "-NAPI"
|
||||
#define DRV_VERSION "3.4.14-k4"DRV_EXT
|
||||
#define DRV_VERSION "3.5.10-k2"DRV_EXT
|
||||
#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"
|
||||
#define DRV_COPYRIGHT "Copyright(c) 1999-2005 Intel Corporation"
|
||||
#define PFX DRV_NAME ": "
|
||||
@@ -320,7 +320,7 @@ enum cuc_dump {
|
||||
cuc_dump_complete = 0x0000A005,
|
||||
cuc_dump_reset_complete = 0x0000A007,
|
||||
};
|
||||
|
||||
|
||||
enum port {
|
||||
software_reset = 0x0000,
|
||||
selftest = 0x0001,
|
||||
@@ -715,10 +715,10 @@ static u16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr)
|
||||
ctrl = (cmd_addr_data & (1 << i)) ? eecs | eedi : eecs;
|
||||
writeb(ctrl, &nic->csr->eeprom_ctrl_lo);
|
||||
e100_write_flush(nic); udelay(4);
|
||||
|
||||
|
||||
writeb(ctrl | eesk, &nic->csr->eeprom_ctrl_lo);
|
||||
e100_write_flush(nic); udelay(4);
|
||||
|
||||
|
||||
/* Eeprom drives a dummy zero to EEDO after receiving
|
||||
* complete address. Use this to adjust addr_len. */
|
||||
ctrl = readb(&nic->csr->eeprom_ctrl_lo);
|
||||
@@ -726,7 +726,7 @@ static u16 e100_eeprom_read(struct nic *nic, u16 *addr_len, u16 addr)
|
||||
*addr_len -= (i - 16);
|
||||
i = 17;
|
||||
}
|
||||
|
||||
|
||||
data = (data << 1) | (ctrl & eedo ? 1 : 0);
|
||||
}
|
||||
|
||||
@@ -1170,7 +1170,7 @@ static void e100_configure(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
0x00000000, 0x00000000, 0x00000000, 0x00000000, \
|
||||
}
|
||||
|
||||
static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
static void e100_setup_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
{
|
||||
/* *INDENT-OFF* */
|
||||
static struct {
|
||||
@@ -1213,13 +1213,13 @@ static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
* driver can change the algorithm.
|
||||
*
|
||||
* INTDELAY - This loads the dead-man timer with its inital value.
|
||||
* When this timer expires the interrupt is asserted, and the
|
||||
* When this timer expires the interrupt is asserted, and the
|
||||
* timer is reset each time a new packet is received. (see
|
||||
* BUNDLEMAX below to set the limit on number of chained packets)
|
||||
* The current default is 0x600 or 1536. Experiments show that
|
||||
* the value should probably stay within the 0x200 - 0x1000.
|
||||
*
|
||||
* BUNDLEMAX -
|
||||
* BUNDLEMAX -
|
||||
* This sets the maximum number of frames that will be bundled. In
|
||||
* some situations, such as the TCP windowing algorithm, it may be
|
||||
* better to limit the growth of the bundle size than let it go as
|
||||
@@ -1229,7 +1229,7 @@ static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
* an interrupt for every frame received. If you do not want to put
|
||||
* a limit on the bundle size, set this value to xFFFF.
|
||||
*
|
||||
* BUNDLESMALL -
|
||||
* BUNDLESMALL -
|
||||
* This contains a bit-mask describing the minimum size frame that
|
||||
* will be bundled. The default masks the lower 7 bits, which means
|
||||
* that any frame less than 128 bytes in length will not be bundled,
|
||||
@@ -1244,7 +1244,7 @@ static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
*
|
||||
* The current default is 0xFF80, which masks out the lower 7 bits.
|
||||
* This means that any frame which is x7F (127) bytes or smaller
|
||||
* will cause an immediate interrupt. Because this value must be a
|
||||
* will cause an immediate interrupt. Because this value must be a
|
||||
* bit mask, there are only a few valid values that can be used. To
|
||||
* turn this feature off, the driver can write the value xFFFF to the
|
||||
* lower word of this instruction (in the same way that the other
|
||||
@@ -1253,7 +1253,7 @@ static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
* standard Ethernet frames are <= 2047 bytes in length.
|
||||
*************************************************************************/
|
||||
|
||||
/* if you wish to disable the ucode functionality, while maintaining the
|
||||
/* if you wish to disable the ucode functionality, while maintaining the
|
||||
* workarounds it provides, set the following defines to:
|
||||
* BUNDLESMALL 0
|
||||
* BUNDLEMAX 1
|
||||
@@ -1284,12 +1284,46 @@ static void e100_load_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
|
||||
for (i = 0; i < UCODE_SIZE; i++)
|
||||
cb->u.ucode[i] = cpu_to_le32(ucode[i]);
|
||||
cb->command = cpu_to_le16(cb_ucode);
|
||||
cb->command = cpu_to_le16(cb_ucode | cb_el);
|
||||
return;
|
||||
}
|
||||
|
||||
noloaducode:
|
||||
cb->command = cpu_to_le16(cb_nop);
|
||||
cb->command = cpu_to_le16(cb_nop | cb_el);
|
||||
}
|
||||
|
||||
static inline int e100_exec_cb_wait(struct nic *nic, struct sk_buff *skb,
|
||||
void (*cb_prepare)(struct nic *, struct cb *, struct sk_buff *))
|
||||
{
|
||||
int err = 0, counter = 50;
|
||||
struct cb *cb = nic->cb_to_clean;
|
||||
|
||||
if ((err = e100_exec_cb(nic, NULL, e100_setup_ucode)))
|
||||
DPRINTK(PROBE,ERR, "ucode cmd failed with error %d\n", err);
|
||||
|
||||
/* must restart cuc */
|
||||
nic->cuc_cmd = cuc_start;
|
||||
|
||||
/* wait for completion */
|
||||
e100_write_flush(nic);
|
||||
udelay(10);
|
||||
|
||||
/* wait for possibly (ouch) 500ms */
|
||||
while (!(cb->status & cpu_to_le16(cb_complete))) {
|
||||
msleep(10);
|
||||
if (!--counter) break;
|
||||
}
|
||||
|
||||
/* ack any interupts, something could have been set */
|
||||
writeb(~0, &nic->csr->scb.stat_ack);
|
||||
|
||||
/* if the command failed, or is not OK, notify and return */
|
||||
if (!counter || !(cb->status & cpu_to_le16(cb_ok))) {
|
||||
DPRINTK(PROBE,ERR, "ucode load failed\n");
|
||||
err = -EPERM;
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static void e100_setup_iaaddr(struct nic *nic, struct cb *cb,
|
||||
@@ -1357,13 +1391,13 @@ static int e100_phy_init(struct nic *nic)
|
||||
mdio_write(netdev, nic->mii.phy_id, MII_NSC_CONG, cong);
|
||||
}
|
||||
|
||||
if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
|
||||
if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
|
||||
(mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000))) {
|
||||
/* enable/disable MDI/MDI-X auto-switching.
|
||||
MDI/MDI-X auto-switching is disabled for 82551ER/QM chips */
|
||||
if((nic->mac == mac_82551_E) || (nic->mac == mac_82551_F) ||
|
||||
(nic->mac == mac_82551_10) || (nic->mii.force_media) ||
|
||||
!(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))
|
||||
(nic->mac == mac_82551_10) || (nic->mii.force_media) ||
|
||||
!(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))
|
||||
mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 0);
|
||||
else
|
||||
mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, NCONFIG_AUTO_SWITCH);
|
||||
@@ -1388,7 +1422,7 @@ static int e100_hw_init(struct nic *nic)
|
||||
return err;
|
||||
if((err = e100_exec_cmd(nic, ruc_load_base, 0)))
|
||||
return err;
|
||||
if((err = e100_exec_cb(nic, NULL, e100_load_ucode)))
|
||||
if ((err = e100_exec_cb_wait(nic, NULL, e100_setup_ucode)))
|
||||
return err;
|
||||
if((err = e100_exec_cb(nic, NULL, e100_configure)))
|
||||
return err;
|
||||
@@ -1493,7 +1527,7 @@ static void e100_update_stats(struct nic *nic)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(e100_exec_cmd(nic, cuc_dump_reset, 0))
|
||||
DPRINTK(TX_ERR, DEBUG, "exec cuc_dump_reset failed\n");
|
||||
}
|
||||
@@ -1542,10 +1576,10 @@ static void e100_watchdog(unsigned long data)
|
||||
mii_check_link(&nic->mii);
|
||||
|
||||
/* Software generated interrupt to recover from (rare) Rx
|
||||
* allocation failure.
|
||||
* Unfortunately have to use a spinlock to not re-enable interrupts
|
||||
* accidentally, due to hardware that shares a register between the
|
||||
* interrupt mask bit and the SW Interrupt generation bit */
|
||||
* allocation failure.
|
||||
* Unfortunately have to use a spinlock to not re-enable interrupts
|
||||
* accidentally, due to hardware that shares a register between the
|
||||
* interrupt mask bit and the SW Interrupt generation bit */
|
||||
spin_lock_irq(&nic->cmd_lock);
|
||||
writeb(readb(&nic->csr->scb.cmd_hi) | irq_sw_gen,&nic->csr->scb.cmd_hi);
|
||||
spin_unlock_irq(&nic->cmd_lock);
|
||||
@@ -1830,7 +1864,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
|
||||
struct rx *rx_to_start = NULL;
|
||||
|
||||
/* are we already rnr? then pay attention!!! this ensures that
|
||||
* the state machine progression never allows a start with a
|
||||
* the state machine progression never allows a start with a
|
||||
* partially cleaned list, avoiding a race between hardware
|
||||
* and rx_to_clean when in NAPI mode */
|
||||
if(RU_SUSPENDED == nic->ru_running)
|
||||
@@ -2066,7 +2100,7 @@ static void e100_tx_timeout(struct net_device *netdev)
|
||||
{
|
||||
struct nic *nic = netdev_priv(netdev);
|
||||
|
||||
/* Reset outside of interrupt context, to avoid request_irq
|
||||
/* Reset outside of interrupt context, to avoid request_irq
|
||||
* in interrupt context */
|
||||
schedule_work(&nic->tx_timeout_task);
|
||||
}
|
||||
@@ -2313,7 +2347,7 @@ static int e100_set_ringparam(struct net_device *netdev,
|
||||
struct param_range *rfds = &nic->params.rfds;
|
||||
struct param_range *cbs = &nic->params.cbs;
|
||||
|
||||
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
|
||||
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
|
||||
return -EINVAL;
|
||||
|
||||
if(netif_running(netdev))
|
||||
@@ -2631,7 +2665,9 @@ static int __devinit e100_probe(struct pci_dev *pdev,
|
||||
nic->flags |= wol_magic;
|
||||
|
||||
/* ack any pending wake events, disable PME */
|
||||
pci_enable_wake(pdev, 0, 0);
|
||||
err = pci_enable_wake(pdev, 0, 0);
|
||||
if (err)
|
||||
DPRINTK(PROBE, ERR, "Error clearing wake event\n");
|
||||
|
||||
strcpy(netdev->name, "eth%d");
|
||||
if((err = register_netdev(netdev))) {
|
||||
@@ -2682,6 +2718,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||
{
|
||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||
struct nic *nic = netdev_priv(netdev);
|
||||
int retval;
|
||||
|
||||
if(netif_running(netdev))
|
||||
e100_down(nic);
|
||||
@@ -2689,9 +2726,14 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
|
||||
netif_device_detach(netdev);
|
||||
|
||||
pci_save_state(pdev);
|
||||
pci_enable_wake(pdev, pci_choose_state(pdev, state), nic->flags & (wol_magic | e100_asf(nic)));
|
||||
retval = pci_enable_wake(pdev, pci_choose_state(pdev, state),
|
||||
nic->flags & (wol_magic | e100_asf(nic)));
|
||||
if (retval)
|
||||
DPRINTK(PROBE,ERR, "Error enabling wake\n");
|
||||
pci_disable_device(pdev);
|
||||
pci_set_power_state(pdev, pci_choose_state(pdev, state));
|
||||
retval = pci_set_power_state(pdev, pci_choose_state(pdev, state));
|
||||
if (retval)
|
||||
DPRINTK(PROBE,ERR, "Error %d setting power state\n", retval);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2700,11 +2742,16 @@ static int e100_resume(struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||
struct nic *nic = netdev_priv(netdev);
|
||||
int retval;
|
||||
|
||||
pci_set_power_state(pdev, PCI_D0);
|
||||
retval = pci_set_power_state(pdev, PCI_D0);
|
||||
if (retval)
|
||||
DPRINTK(PROBE,ERR, "Error waking adapter\n");
|
||||
pci_restore_state(pdev);
|
||||
/* ack any pending wake events, disable PME */
|
||||
pci_enable_wake(pdev, 0, 0);
|
||||
retval = pci_enable_wake(pdev, 0, 0);
|
||||
if (retval)
|
||||
DPRINTK(PROBE,ERR, "Error clearing wake events\n");
|
||||
if(e100_hw_init(nic))
|
||||
DPRINTK(HW, ERR, "e100_hw_init failed\n");
|
||||
|
||||
@@ -2721,12 +2768,15 @@ static void e100_shutdown(struct pci_dev *pdev)
|
||||
{
|
||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||
struct nic *nic = netdev_priv(netdev);
|
||||
int retval;
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic)));
|
||||
retval = pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic)));
|
||||
#else
|
||||
pci_enable_wake(pdev, 0, nic->flags & (wol_magic));
|
||||
retval = pci_enable_wake(pdev, 0, nic->flags & (wol_magic));
|
||||
#endif
|
||||
if (retval)
|
||||
DPRINTK(PROBE,ERR, "Error enabling wake\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -2739,7 +2789,7 @@ static struct pci_driver e100_driver = {
|
||||
.suspend = e100_suspend,
|
||||
.resume = e100_resume,
|
||||
#endif
|
||||
.shutdown = e100_shutdown,
|
||||
.shutdown = e100_shutdown,
|
||||
};
|
||||
|
||||
static int __init e100_init_module(void)
|
||||
|
||||
+39
-12
@@ -72,10 +72,6 @@
|
||||
#include <linux/mii.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/smp.h>
|
||||
#endif
|
||||
|
||||
#define BAR_0 0
|
||||
#define BAR_1 1
|
||||
@@ -87,6 +83,10 @@
|
||||
struct e1000_adapter;
|
||||
|
||||
#include "e1000_hw.h"
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/smp.h>
|
||||
#endif
|
||||
|
||||
#ifdef DBG
|
||||
#define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
|
||||
@@ -169,6 +169,13 @@ struct e1000_buffer {
|
||||
uint16_t next_to_watch;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
struct e1000_queue_stats {
|
||||
uint64_t packets;
|
||||
uint64_t bytes;
|
||||
};
|
||||
#endif
|
||||
|
||||
struct e1000_ps_page { struct page *ps_page[PS_PAGE_BUFFERS]; };
|
||||
struct e1000_ps_page_dma { uint64_t ps_page_dma[PS_PAGE_BUFFERS]; };
|
||||
|
||||
@@ -191,10 +198,12 @@ struct e1000_tx_ring {
|
||||
spinlock_t tx_lock;
|
||||
uint16_t tdh;
|
||||
uint16_t tdt;
|
||||
uint64_t pkt;
|
||||
|
||||
boolean_t last_tx_tso;
|
||||
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
struct e1000_queue_stats tx_stats;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct e1000_rx_ring {
|
||||
@@ -216,9 +225,17 @@ struct e1000_rx_ring {
|
||||
struct e1000_ps_page *ps_page;
|
||||
struct e1000_ps_page_dma *ps_page_dma;
|
||||
|
||||
struct sk_buff *rx_skb_top;
|
||||
struct sk_buff *rx_skb_prev;
|
||||
|
||||
/* cpu for rx queue */
|
||||
int cpu;
|
||||
|
||||
uint16_t rdh;
|
||||
uint16_t rdt;
|
||||
uint64_t pkt;
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
struct e1000_queue_stats rx_stats;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define E1000_DESC_UNUSED(R) \
|
||||
@@ -251,6 +268,9 @@ struct e1000_adapter {
|
||||
uint16_t link_speed;
|
||||
uint16_t link_duplex;
|
||||
spinlock_t stats_lock;
|
||||
#ifdef CONFIG_E1000_NAPI
|
||||
spinlock_t tx_queue_lock;
|
||||
#endif
|
||||
atomic_t irq_sem;
|
||||
struct work_struct tx_timeout_task;
|
||||
struct work_struct watchdog_task;
|
||||
@@ -264,6 +284,7 @@ struct e1000_adapter {
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
struct e1000_tx_ring **cpu_tx_ring; /* per-cpu */
|
||||
#endif
|
||||
unsigned long tx_queue_len;
|
||||
uint32_t txd_cmd;
|
||||
uint32_t tx_int_delay;
|
||||
uint32_t tx_abs_int_delay;
|
||||
@@ -271,9 +292,11 @@ struct e1000_adapter {
|
||||
uint64_t gotcl_old;
|
||||
uint64_t tpt_old;
|
||||
uint64_t colc_old;
|
||||
uint32_t tx_timeout_count;
|
||||
uint32_t tx_fifo_head;
|
||||
uint32_t tx_head_addr;
|
||||
uint32_t tx_fifo_size;
|
||||
uint8_t tx_timeout_factor;
|
||||
atomic_t tx_fifo_stall;
|
||||
boolean_t pcix_82544;
|
||||
boolean_t detect_tx_hung;
|
||||
@@ -281,14 +304,15 @@ struct e1000_adapter {
|
||||
/* RX */
|
||||
#ifdef CONFIG_E1000_NAPI
|
||||
boolean_t (*clean_rx) (struct e1000_adapter *adapter,
|
||||
struct e1000_rx_ring *rx_ring,
|
||||
int *work_done, int work_to_do);
|
||||
struct e1000_rx_ring *rx_ring,
|
||||
int *work_done, int work_to_do);
|
||||
#else
|
||||
boolean_t (*clean_rx) (struct e1000_adapter *adapter,
|
||||
struct e1000_rx_ring *rx_ring);
|
||||
struct e1000_rx_ring *rx_ring);
|
||||
#endif
|
||||
void (*alloc_rx_buf) (struct e1000_adapter *adapter,
|
||||
struct e1000_rx_ring *rx_ring);
|
||||
struct e1000_rx_ring *rx_ring,
|
||||
int cleaned_count);
|
||||
struct e1000_rx_ring *rx_ring; /* One per active queue */
|
||||
#ifdef CONFIG_E1000_NAPI
|
||||
struct net_device *polling_netdev; /* One per active queue */
|
||||
@@ -296,13 +320,15 @@ struct e1000_adapter {
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
struct net_device **cpu_netdev; /* per-cpu */
|
||||
struct call_async_data_struct rx_sched_call_data;
|
||||
int cpu_for_queue[4];
|
||||
cpumask_t cpumask;
|
||||
#endif
|
||||
int num_queues;
|
||||
int num_tx_queues;
|
||||
int num_rx_queues;
|
||||
|
||||
uint64_t hw_csum_err;
|
||||
uint64_t hw_csum_good;
|
||||
uint64_t rx_hdr_split;
|
||||
uint32_t alloc_rx_buff_failed;
|
||||
uint32_t rx_int_delay;
|
||||
uint32_t rx_abs_int_delay;
|
||||
boolean_t rx_csum;
|
||||
@@ -330,6 +356,7 @@ struct e1000_adapter {
|
||||
struct e1000_rx_ring test_rx_ring;
|
||||
|
||||
|
||||
u32 *config_space;
|
||||
int msg_enable;
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
boolean_t have_msi;
|
||||
|
||||
@@ -80,6 +80,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
|
||||
{ "tx_deferred_ok", E1000_STAT(stats.dc) },
|
||||
{ "tx_single_coll_ok", E1000_STAT(stats.scc) },
|
||||
{ "tx_multi_coll_ok", E1000_STAT(stats.mcc) },
|
||||
{ "tx_timeout_count", E1000_STAT(tx_timeout_count) },
|
||||
{ "rx_long_length_errors", E1000_STAT(stats.roc) },
|
||||
{ "rx_short_length_errors", E1000_STAT(stats.ruc) },
|
||||
{ "rx_align_errors", E1000_STAT(stats.algnerrc) },
|
||||
@@ -93,9 +94,20 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
|
||||
{ "rx_csum_offload_good", E1000_STAT(hw_csum_good) },
|
||||
{ "rx_csum_offload_errors", E1000_STAT(hw_csum_err) },
|
||||
{ "rx_header_split", E1000_STAT(rx_hdr_split) },
|
||||
{ "alloc_rx_buff_failed", E1000_STAT(alloc_rx_buff_failed) },
|
||||
};
|
||||
#define E1000_STATS_LEN \
|
||||
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
#define E1000_QUEUE_STATS_LEN \
|
||||
(((struct e1000_adapter *)netdev->priv)->num_tx_queues + \
|
||||
((struct e1000_adapter *)netdev->priv)->num_rx_queues) \
|
||||
* (sizeof(struct e1000_queue_stats) / sizeof(uint64_t))
|
||||
#else
|
||||
#define E1000_QUEUE_STATS_LEN 0
|
||||
#endif
|
||||
#define E1000_GLOBAL_STATS_LEN \
|
||||
sizeof(e1000_gstrings_stats) / sizeof(struct e1000_stats)
|
||||
#define E1000_STATS_LEN (E1000_GLOBAL_STATS_LEN + E1000_QUEUE_STATS_LEN)
|
||||
static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = {
|
||||
"Register test (offline)", "Eeprom test (offline)",
|
||||
"Interrupt test (offline)", "Loopback test (offline)",
|
||||
@@ -183,7 +195,15 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
|
||||
if(ecmd->autoneg == AUTONEG_ENABLE) {
|
||||
/* When SoL/IDER sessions are active, autoneg/speed/duplex
|
||||
* cannot be changed */
|
||||
if (e1000_check_phy_reset_block(hw)) {
|
||||
DPRINTK(DRV, ERR, "Cannot change link characteristics "
|
||||
"when SoL/IDER is active.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ecmd->autoneg == AUTONEG_ENABLE) {
|
||||
hw->autoneg = 1;
|
||||
if(hw->media_type == e1000_media_type_fiber)
|
||||
hw->autoneg_advertised = ADVERTISED_1000baseT_Full |
|
||||
@@ -567,21 +587,21 @@ e1000_get_drvinfo(struct net_device *netdev,
|
||||
|
||||
strncpy(drvinfo->driver, e1000_driver_name, 32);
|
||||
strncpy(drvinfo->version, e1000_driver_version, 32);
|
||||
|
||||
/* EEPROM image version # is reported as firware version # for
|
||||
|
||||
/* EEPROM image version # is reported as firmware version # for
|
||||
* 8257{1|2|3} controllers */
|
||||
e1000_read_eeprom(&adapter->hw, 5, 1, &eeprom_data);
|
||||
switch (adapter->hw.mac_type) {
|
||||
case e1000_82571:
|
||||
case e1000_82572:
|
||||
case e1000_82573:
|
||||
sprintf(firmware_version, "%d.%d-%d",
|
||||
sprintf(firmware_version, "%d.%d-%d",
|
||||
(eeprom_data & 0xF000) >> 12,
|
||||
(eeprom_data & 0x0FF0) >> 4,
|
||||
eeprom_data & 0x000F);
|
||||
break;
|
||||
default:
|
||||
sprintf(firmware_version, "n/a");
|
||||
sprintf(firmware_version, "N/A");
|
||||
}
|
||||
|
||||
strncpy(drvinfo->fw_version, firmware_version, 32);
|
||||
@@ -623,8 +643,8 @@ e1000_set_ringparam(struct net_device *netdev,
|
||||
struct e1000_rx_ring *rxdr, *rx_old, *rx_new;
|
||||
int i, err, tx_ring_size, rx_ring_size;
|
||||
|
||||
tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_queues;
|
||||
rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_queues;
|
||||
tx_ring_size = sizeof(struct e1000_tx_ring) * adapter->num_tx_queues;
|
||||
rx_ring_size = sizeof(struct e1000_rx_ring) * adapter->num_rx_queues;
|
||||
|
||||
if (netif_running(adapter->netdev))
|
||||
e1000_down(adapter);
|
||||
@@ -663,10 +683,10 @@ e1000_set_ringparam(struct net_device *netdev,
|
||||
E1000_MAX_TXD : E1000_MAX_82544_TXD));
|
||||
E1000_ROUNDUP(txdr->count, REQ_TX_DESCRIPTOR_MULTIPLE);
|
||||
|
||||
for (i = 0; i < adapter->num_queues; i++) {
|
||||
for (i = 0; i < adapter->num_tx_queues; i++)
|
||||
txdr[i].count = txdr->count;
|
||||
for (i = 0; i < adapter->num_rx_queues; i++)
|
||||
rxdr[i].count = rxdr->count;
|
||||
}
|
||||
|
||||
if(netif_running(adapter->netdev)) {
|
||||
/* Try to get new resources before deleting old */
|
||||
@@ -979,18 +999,17 @@ e1000_free_desc_rings(struct e1000_adapter *adapter)
|
||||
}
|
||||
}
|
||||
|
||||
if(txdr->desc) {
|
||||
if (txdr->desc) {
|
||||
pci_free_consistent(pdev, txdr->size, txdr->desc, txdr->dma);
|
||||
txdr->desc = NULL;
|
||||
}
|
||||
if(rxdr->desc) {
|
||||
if (rxdr->desc) {
|
||||
pci_free_consistent(pdev, rxdr->size, rxdr->desc, rxdr->dma);
|
||||
rxdr->desc = NULL;
|
||||
}
|
||||
|
||||
kfree(txdr->buffer_info);
|
||||
txdr->buffer_info = NULL;
|
||||
|
||||
kfree(rxdr->buffer_info);
|
||||
rxdr->buffer_info = NULL;
|
||||
|
||||
@@ -1327,11 +1346,11 @@ e1000_set_phy_loopback(struct e1000_adapter *adapter)
|
||||
static int
|
||||
e1000_setup_loopback_test(struct e1000_adapter *adapter)
|
||||
{
|
||||
uint32_t rctl;
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
uint32_t rctl;
|
||||
|
||||
if (hw->media_type == e1000_media_type_fiber ||
|
||||
hw->media_type == e1000_media_type_internal_serdes) {
|
||||
hw->media_type == e1000_media_type_internal_serdes) {
|
||||
switch (hw->mac_type) {
|
||||
case e1000_82545:
|
||||
case e1000_82546:
|
||||
@@ -1362,25 +1381,25 @@ e1000_setup_loopback_test(struct e1000_adapter *adapter)
|
||||
static void
|
||||
e1000_loopback_cleanup(struct e1000_adapter *adapter)
|
||||
{
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
uint32_t rctl;
|
||||
uint16_t phy_reg;
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
|
||||
rctl = E1000_READ_REG(&adapter->hw, RCTL);
|
||||
rctl = E1000_READ_REG(hw, RCTL);
|
||||
rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
|
||||
E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
|
||||
E1000_WRITE_REG(hw, RCTL, rctl);
|
||||
|
||||
switch (hw->mac_type) {
|
||||
case e1000_82571:
|
||||
case e1000_82572:
|
||||
if (hw->media_type == e1000_media_type_fiber ||
|
||||
hw->media_type == e1000_media_type_internal_serdes){
|
||||
hw->media_type == e1000_media_type_internal_serdes) {
|
||||
#define E1000_SERDES_LB_OFF 0x400
|
||||
E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_OFF);
|
||||
msec_delay(10);
|
||||
break;
|
||||
}
|
||||
/* fall thru for Cu adapters */
|
||||
/* Fall Through */
|
||||
case e1000_82545:
|
||||
case e1000_82546:
|
||||
case e1000_82545_rev_3:
|
||||
@@ -1401,7 +1420,7 @@ static void
|
||||
e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
|
||||
{
|
||||
memset(skb->data, 0xFF, frame_size);
|
||||
frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size;
|
||||
frame_size &= ~1;
|
||||
memset(&skb->data[frame_size / 2], 0xAA, frame_size / 2 - 1);
|
||||
memset(&skb->data[frame_size / 2 + 10], 0xBE, 1);
|
||||
memset(&skb->data[frame_size / 2 + 12], 0xAF, 1);
|
||||
@@ -1410,7 +1429,7 @@ e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
|
||||
static int
|
||||
e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size)
|
||||
{
|
||||
frame_size = (frame_size % 2) ? (frame_size - 1) : frame_size;
|
||||
frame_size &= ~1;
|
||||
if(*(skb->data + 3) == 0xFF) {
|
||||
if((*(skb->data + frame_size / 2 + 10) == 0xBE) &&
|
||||
(*(skb->data + frame_size / 2 + 12) == 0xAF)) {
|
||||
@@ -1488,14 +1507,25 @@ e1000_run_loopback_test(struct e1000_adapter *adapter)
|
||||
static int
|
||||
e1000_loopback_test(struct e1000_adapter *adapter, uint64_t *data)
|
||||
{
|
||||
if((*data = e1000_setup_desc_rings(adapter))) goto err_loopback;
|
||||
if((*data = e1000_setup_loopback_test(adapter)))
|
||||
goto err_loopback_setup;
|
||||
/* PHY loopback cannot be performed if SoL/IDER
|
||||
* sessions are active */
|
||||
if (e1000_check_phy_reset_block(&adapter->hw)) {
|
||||
DPRINTK(DRV, ERR, "Cannot do PHY loopback test "
|
||||
"when SoL/IDER is active.\n");
|
||||
*data = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if ((*data = e1000_setup_desc_rings(adapter)))
|
||||
goto out;
|
||||
if ((*data = e1000_setup_loopback_test(adapter)))
|
||||
goto err_loopback;
|
||||
*data = e1000_run_loopback_test(adapter);
|
||||
e1000_loopback_cleanup(adapter);
|
||||
err_loopback_setup:
|
||||
e1000_free_desc_rings(adapter);
|
||||
|
||||
err_loopback:
|
||||
e1000_free_desc_rings(adapter);
|
||||
out:
|
||||
return *data;
|
||||
}
|
||||
|
||||
@@ -1617,6 +1647,7 @@ e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||
|
||||
case E1000_DEV_ID_82546EB_FIBER:
|
||||
case E1000_DEV_ID_82546GB_FIBER:
|
||||
case E1000_DEV_ID_82571EB_FIBER:
|
||||
/* Wake events only supported on port A for dual fiber */
|
||||
if(E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) {
|
||||
wol->supported = 0;
|
||||
@@ -1660,6 +1691,7 @@ e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||
|
||||
case E1000_DEV_ID_82546EB_FIBER:
|
||||
case E1000_DEV_ID_82546GB_FIBER:
|
||||
case E1000_DEV_ID_82571EB_FIBER:
|
||||
/* Wake events only supported on port A for dual fiber */
|
||||
if(E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
|
||||
return wol->wolopts ? -EOPNOTSUPP : 0;
|
||||
@@ -1721,21 +1753,21 @@ e1000_phys_id(struct net_device *netdev, uint32_t data)
|
||||
mod_timer(&adapter->blink_timer, jiffies);
|
||||
msleep_interruptible(data * 1000);
|
||||
del_timer_sync(&adapter->blink_timer);
|
||||
}
|
||||
else if(adapter->hw.mac_type < e1000_82573) {
|
||||
E1000_WRITE_REG(&adapter->hw, LEDCTL, (E1000_LEDCTL_LED2_BLINK_RATE |
|
||||
E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK |
|
||||
(E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
|
||||
(E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED0_MODE_SHIFT) |
|
||||
(E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED1_MODE_SHIFT)));
|
||||
} else if (adapter->hw.mac_type < e1000_82573) {
|
||||
E1000_WRITE_REG(&adapter->hw, LEDCTL,
|
||||
(E1000_LEDCTL_LED2_BLINK_RATE |
|
||||
E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK |
|
||||
(E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
|
||||
(E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED0_MODE_SHIFT) |
|
||||
(E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED1_MODE_SHIFT)));
|
||||
msleep_interruptible(data * 1000);
|
||||
}
|
||||
else {
|
||||
E1000_WRITE_REG(&adapter->hw, LEDCTL, (E1000_LEDCTL_LED2_BLINK_RATE |
|
||||
E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK |
|
||||
(E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
|
||||
(E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED1_MODE_SHIFT) |
|
||||
(E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT)));
|
||||
} else {
|
||||
E1000_WRITE_REG(&adapter->hw, LEDCTL,
|
||||
(E1000_LEDCTL_LED2_BLINK_RATE |
|
||||
E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK |
|
||||
(E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
|
||||
(E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED1_MODE_SHIFT) |
|
||||
(E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT)));
|
||||
msleep_interruptible(data * 1000);
|
||||
}
|
||||
|
||||
@@ -1768,19 +1800,43 @@ e1000_get_ethtool_stats(struct net_device *netdev,
|
||||
struct ethtool_stats *stats, uint64_t *data)
|
||||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
uint64_t *queue_stat;
|
||||
int stat_count = sizeof(struct e1000_queue_stats) / sizeof(uint64_t);
|
||||
int j, k;
|
||||
#endif
|
||||
int i;
|
||||
|
||||
e1000_update_stats(adapter);
|
||||
for(i = 0; i < E1000_STATS_LEN; i++) {
|
||||
char *p = (char *)adapter+e1000_gstrings_stats[i].stat_offset;
|
||||
data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
|
||||
for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
|
||||
char *p = (char *)adapter+e1000_gstrings_stats[i].stat_offset;
|
||||
data[i] = (e1000_gstrings_stats[i].sizeof_stat ==
|
||||
sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p;
|
||||
}
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
for (j = 0; j < adapter->num_tx_queues; j++) {
|
||||
queue_stat = (uint64_t *)&adapter->tx_ring[j].tx_stats;
|
||||
for (k = 0; k < stat_count; k++)
|
||||
data[i + k] = queue_stat[k];
|
||||
i += k;
|
||||
}
|
||||
for (j = 0; j < adapter->num_rx_queues; j++) {
|
||||
queue_stat = (uint64_t *)&adapter->rx_ring[j].rx_stats;
|
||||
for (k = 0; k < stat_count; k++)
|
||||
data[i + k] = queue_stat[k];
|
||||
i += k;
|
||||
}
|
||||
#endif
|
||||
/* BUG_ON(i != E1000_STATS_LEN); */
|
||||
}
|
||||
|
||||
static void
|
||||
e1000_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
|
||||
{
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
#endif
|
||||
uint8_t *p = data;
|
||||
int i;
|
||||
|
||||
switch(stringset) {
|
||||
@@ -1789,11 +1845,26 @@ e1000_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
|
||||
E1000_TEST_LEN*ETH_GSTRING_LEN);
|
||||
break;
|
||||
case ETH_SS_STATS:
|
||||
for (i=0; i < E1000_STATS_LEN; i++) {
|
||||
memcpy(data + i * ETH_GSTRING_LEN,
|
||||
e1000_gstrings_stats[i].stat_string,
|
||||
ETH_GSTRING_LEN);
|
||||
for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
|
||||
memcpy(p, e1000_gstrings_stats[i].stat_string,
|
||||
ETH_GSTRING_LEN);
|
||||
p += ETH_GSTRING_LEN;
|
||||
}
|
||||
#ifdef CONFIG_E1000_MQ
|
||||
for (i = 0; i < adapter->num_tx_queues; i++) {
|
||||
sprintf(p, "tx_queue_%u_packets", i);
|
||||
p += ETH_GSTRING_LEN;
|
||||
sprintf(p, "tx_queue_%u_bytes", i);
|
||||
p += ETH_GSTRING_LEN;
|
||||
}
|
||||
for (i = 0; i < adapter->num_rx_queues; i++) {
|
||||
sprintf(p, "rx_queue_%u_packets", i);
|
||||
p += ETH_GSTRING_LEN;
|
||||
sprintf(p, "rx_queue_%u_bytes", i);
|
||||
p += ETH_GSTRING_LEN;
|
||||
}
|
||||
#endif
|
||||
/* BUG_ON(p - data != E1000_STATS_LEN * ETH_GSTRING_LEN); */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,6 +318,8 @@ e1000_set_mac_type(struct e1000_hw *hw)
|
||||
case E1000_DEV_ID_82546GB_FIBER:
|
||||
case E1000_DEV_ID_82546GB_SERDES:
|
||||
case E1000_DEV_ID_82546GB_PCIE:
|
||||
case E1000_DEV_ID_82546GB_QUAD_COPPER:
|
||||
case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
|
||||
hw->mac_type = e1000_82546_rev_3;
|
||||
break;
|
||||
case E1000_DEV_ID_82541EI:
|
||||
@@ -639,6 +641,7 @@ e1000_init_hw(struct e1000_hw *hw)
|
||||
uint16_t cmd_mmrbc;
|
||||
uint16_t stat_mmrbc;
|
||||
uint32_t mta_size;
|
||||
uint32_t ctrl_ext;
|
||||
|
||||
DEBUGFUNC("e1000_init_hw");
|
||||
|
||||
@@ -735,7 +738,6 @@ e1000_init_hw(struct e1000_hw *hw)
|
||||
break;
|
||||
case e1000_82571:
|
||||
case e1000_82572:
|
||||
ctrl |= (1 << 22);
|
||||
case e1000_82573:
|
||||
ctrl |= E1000_TXDCTL_COUNT_DESC;
|
||||
break;
|
||||
@@ -775,6 +777,15 @@ e1000_init_hw(struct e1000_hw *hw)
|
||||
*/
|
||||
e1000_clear_hw_cntrs(hw);
|
||||
|
||||
if (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER ||
|
||||
hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3) {
|
||||
ctrl_ext = E1000_READ_REG(hw, CTRL_EXT);
|
||||
/* Relaxed ordering must be disabled to avoid a parity
|
||||
* error crash in a PCI slot. */
|
||||
ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
|
||||
E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext);
|
||||
}
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@@ -838,6 +849,11 @@ e1000_setup_link(struct e1000_hw *hw)
|
||||
|
||||
DEBUGFUNC("e1000_setup_link");
|
||||
|
||||
/* In the case of the phy reset being blocked, we already have a link.
|
||||
* We do not have to set it up again. */
|
||||
if (e1000_check_phy_reset_block(hw))
|
||||
return E1000_SUCCESS;
|
||||
|
||||
/* Read and store word 0x0F of the EEPROM. This word contains bits
|
||||
* that determine the hardware's default PAUSE (flow control) mode,
|
||||
* a bit that determines whether the HW defaults to enabling or
|
||||
@@ -1929,14 +1945,19 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw)
|
||||
void
|
||||
e1000_config_collision_dist(struct e1000_hw *hw)
|
||||
{
|
||||
uint32_t tctl;
|
||||
uint32_t tctl, coll_dist;
|
||||
|
||||
DEBUGFUNC("e1000_config_collision_dist");
|
||||
|
||||
if (hw->mac_type < e1000_82543)
|
||||
coll_dist = E1000_COLLISION_DISTANCE_82542;
|
||||
else
|
||||
coll_dist = E1000_COLLISION_DISTANCE;
|
||||
|
||||
tctl = E1000_READ_REG(hw, TCTL);
|
||||
|
||||
tctl &= ~E1000_TCTL_COLD;
|
||||
tctl |= E1000_COLLISION_DISTANCE << E1000_COLD_SHIFT;
|
||||
tctl |= coll_dist << E1000_COLD_SHIFT;
|
||||
|
||||
E1000_WRITE_REG(hw, TCTL, tctl);
|
||||
E1000_WRITE_FLUSH(hw);
|
||||
@@ -2982,6 +3003,8 @@ e1000_phy_hw_reset(struct e1000_hw *hw)
|
||||
|
||||
if (hw->mac_type < e1000_82571)
|
||||
msec_delay(10);
|
||||
else
|
||||
udelay(100);
|
||||
|
||||
E1000_WRITE_REG(hw, CTRL, ctrl);
|
||||
E1000_WRITE_FLUSH(hw);
|
||||
@@ -3881,14 +3904,16 @@ e1000_read_eeprom(struct e1000_hw *hw,
|
||||
return -E1000_ERR_EEPROM;
|
||||
}
|
||||
|
||||
/* FLASH reads without acquiring the semaphore are safe in 82573-based
|
||||
* controllers.
|
||||
*/
|
||||
if ((e1000_is_onboard_nvm_eeprom(hw) == TRUE) ||
|
||||
(hw->mac_type != e1000_82573)) {
|
||||
/* Prepare the EEPROM for reading */
|
||||
if(e1000_acquire_eeprom(hw) != E1000_SUCCESS)
|
||||
return -E1000_ERR_EEPROM;
|
||||
/* FLASH reads without acquiring the semaphore are safe */
|
||||
if (e1000_is_onboard_nvm_eeprom(hw) == TRUE &&
|
||||
hw->eeprom.use_eerd == FALSE) {
|
||||
switch (hw->mac_type) {
|
||||
default:
|
||||
/* Prepare the EEPROM for reading */
|
||||
if (e1000_acquire_eeprom(hw) != E1000_SUCCESS)
|
||||
return -E1000_ERR_EEPROM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(eeprom->use_eerd == TRUE) {
|
||||
@@ -6720,6 +6745,12 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw)
|
||||
break;
|
||||
}
|
||||
|
||||
/* PHY configuration from NVM just starts after EECD_AUTO_RD sets to high.
|
||||
* Need to wait for PHY configuration completion before accessing NVM
|
||||
* and PHY. */
|
||||
if (hw->mac_type == e1000_82573)
|
||||
msec_delay(25);
|
||||
|
||||
return E1000_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
@@ -439,6 +439,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
|
||||
#define E1000_DEV_ID_82546GB_FIBER 0x107A
|
||||
#define E1000_DEV_ID_82546GB_SERDES 0x107B
|
||||
#define E1000_DEV_ID_82546GB_PCIE 0x108A
|
||||
#define E1000_DEV_ID_82546GB_QUAD_COPPER 0x1099
|
||||
#define E1000_DEV_ID_82547EI 0x1019
|
||||
#define E1000_DEV_ID_82571EB_COPPER 0x105E
|
||||
#define E1000_DEV_ID_82571EB_FIBER 0x105F
|
||||
@@ -449,6 +450,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
|
||||
#define E1000_DEV_ID_82573E 0x108B
|
||||
#define E1000_DEV_ID_82573E_IAMT 0x108C
|
||||
#define E1000_DEV_ID_82573L 0x109A
|
||||
#define E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 0x10B5
|
||||
|
||||
|
||||
#define NODE_ADDRESS_SIZE 6
|
||||
@@ -1497,6 +1499,7 @@ struct e1000_hw {
|
||||
#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */
|
||||
#define E1000_CTRL_EXT_IPS 0x00004000 /* Invert Power State */
|
||||
#define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */
|
||||
#define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */
|
||||
#define E1000_CTRL_EXT_LINK_MODE_MASK 0x00C00000
|
||||
#define E1000_CTRL_EXT_LINK_MODE_GMII 0x00000000
|
||||
#define E1000_CTRL_EXT_LINK_MODE_TBI 0x00C00000
|
||||
@@ -1954,6 +1957,23 @@ struct e1000_host_command_info {
|
||||
|
||||
#define E1000_MDALIGN 4096
|
||||
|
||||
/* PCI-Ex registers */
|
||||
|
||||
/* PCI-Ex Control Register */
|
||||
#define E1000_GCR_RXD_NO_SNOOP 0x00000001
|
||||
#define E1000_GCR_RXDSCW_NO_SNOOP 0x00000002
|
||||
#define E1000_GCR_RXDSCR_NO_SNOOP 0x00000004
|
||||
#define E1000_GCR_TXD_NO_SNOOP 0x00000008
|
||||
#define E1000_GCR_TXDSCW_NO_SNOOP 0x00000010
|
||||
#define E1000_GCR_TXDSCR_NO_SNOOP 0x00000020
|
||||
|
||||
#define PCI_EX_NO_SNOOP_ALL (E1000_GCR_RXD_NO_SNOOP | \
|
||||
E1000_GCR_RXDSCW_NO_SNOOP | \
|
||||
E1000_GCR_RXDSCR_NO_SNOOP | \
|
||||
E1000_GCR TXD_NO_SNOOP | \
|
||||
E1000_GCR_TXDSCW_NO_SNOOP | \
|
||||
E1000_GCR_TXDSCR_NO_SNOOP)
|
||||
|
||||
#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
|
||||
/* Function Active and Power State to MNG */
|
||||
#define E1000_FACTPS_FUNC0_POWER_STATE_MASK 0x00000003
|
||||
@@ -2077,7 +2097,10 @@ struct e1000_host_command_info {
|
||||
/* Collision related configuration parameters */
|
||||
#define E1000_COLLISION_THRESHOLD 15
|
||||
#define E1000_CT_SHIFT 4
|
||||
#define E1000_COLLISION_DISTANCE 64
|
||||
/* Collision distance is a 0-based value that applies to
|
||||
* half-duplex-capable hardware only. */
|
||||
#define E1000_COLLISION_DISTANCE 63
|
||||
#define E1000_COLLISION_DISTANCE_82542 64
|
||||
#define E1000_FDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE
|
||||
#define E1000_HDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE
|
||||
#define E1000_COLD_SHIFT 12
|
||||
|
||||
+534
-280
File diff suppressed because it is too large
Load Diff
@@ -177,7 +177,7 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
|
||||
*
|
||||
* Valid Range: 100-100000 (0=off, 1=dynamic)
|
||||
*
|
||||
* Default Value: 1
|
||||
* Default Value: 8000
|
||||
*/
|
||||
|
||||
E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
|
||||
@@ -320,7 +320,7 @@ e1000_check_options(struct e1000_adapter *adapter)
|
||||
} else {
|
||||
tx_ring->count = opt.def;
|
||||
}
|
||||
for (i = 0; i < adapter->num_queues; i++)
|
||||
for (i = 0; i < adapter->num_tx_queues; i++)
|
||||
tx_ring[i].count = tx_ring->count;
|
||||
}
|
||||
{ /* Receive Descriptor Count */
|
||||
@@ -346,7 +346,7 @@ e1000_check_options(struct e1000_adapter *adapter)
|
||||
} else {
|
||||
rx_ring->count = opt.def;
|
||||
}
|
||||
for (i = 0; i < adapter->num_queues; i++)
|
||||
for (i = 0; i < adapter->num_rx_queues; i++)
|
||||
rx_ring[i].count = rx_ring->count;
|
||||
}
|
||||
{ /* Checksum Offload Enable/Disable */
|
||||
@@ -388,7 +388,7 @@ e1000_check_options(struct e1000_adapter *adapter)
|
||||
e1000_validate_option(&fc, &opt, adapter);
|
||||
adapter->hw.fc = adapter->hw.original_fc = fc;
|
||||
} else {
|
||||
adapter->hw.fc = opt.def;
|
||||
adapter->hw.fc = adapter->hw.original_fc = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Transmit Interrupt Delay */
|
||||
@@ -584,6 +584,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
|
||||
.p = dplx_list }}
|
||||
};
|
||||
|
||||
if (e1000_check_phy_reset_block(&adapter->hw)) {
|
||||
DPRINTK(PROBE, INFO,
|
||||
"Link active due to SoL/IDER Session. "
|
||||
"Speed/Duplex/AutoNeg parameter ignored.\n");
|
||||
return;
|
||||
}
|
||||
if (num_Duplex > bd) {
|
||||
dplx = Duplex[bd];
|
||||
e1000_validate_option(&dplx, &opt, adapter);
|
||||
|
||||
+426
-258
File diff suppressed because it is too large
Load Diff
+15
-5
@@ -3243,12 +3243,22 @@ static int __devinit skge_probe(struct pci_dev *pdev,
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
||||
if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)))
|
||||
if (sizeof(dma_addr_t) > sizeof(u32) &&
|
||||
!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
|
||||
using_dac = 1;
|
||||
else if (!(err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
|
||||
printk(KERN_ERR PFX "%s no usable DMA configuration\n",
|
||||
pci_name(pdev));
|
||||
goto err_out_free_regions;
|
||||
err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
|
||||
if (err < 0) {
|
||||
printk(KERN_ERR PFX "%s unable to obtain 64 bit DMA "
|
||||
"for consistent allocations\n", pci_name(pdev));
|
||||
goto err_out_free_regions;
|
||||
}
|
||||
} else {
|
||||
err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
|
||||
if (err) {
|
||||
printk(KERN_ERR PFX "%s no usable DMA configuration\n",
|
||||
pci_name(pdev));
|
||||
goto err_out_free_regions;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __BIG_ENDIAN
|
||||
|
||||
+136
-83
File diff suppressed because it is too large
Load Diff
+272
-254
File diff suppressed because it is too large
Load Diff
+42
-33
@@ -33,25 +33,32 @@ extern struct ethtool_ops spider_net_ethtool_ops;
|
||||
|
||||
extern char spider_net_driver_name[];
|
||||
|
||||
#define SPIDER_NET_MAX_MTU 2308
|
||||
#define SPIDER_NET_MAX_FRAME 2312
|
||||
#define SPIDER_NET_MAX_MTU 2294
|
||||
#define SPIDER_NET_MIN_MTU 64
|
||||
|
||||
#define SPIDER_NET_RXBUF_ALIGN 128
|
||||
|
||||
#define SPIDER_NET_RX_DESCRIPTORS_DEFAULT 64
|
||||
#define SPIDER_NET_RX_DESCRIPTORS_DEFAULT 256
|
||||
#define SPIDER_NET_RX_DESCRIPTORS_MIN 16
|
||||
#define SPIDER_NET_RX_DESCRIPTORS_MAX 256
|
||||
#define SPIDER_NET_RX_DESCRIPTORS_MAX 512
|
||||
|
||||
#define SPIDER_NET_TX_DESCRIPTORS_DEFAULT 64
|
||||
#define SPIDER_NET_TX_DESCRIPTORS_DEFAULT 256
|
||||
#define SPIDER_NET_TX_DESCRIPTORS_MIN 16
|
||||
#define SPIDER_NET_TX_DESCRIPTORS_MAX 256
|
||||
#define SPIDER_NET_TX_DESCRIPTORS_MAX 512
|
||||
|
||||
#define SPIDER_NET_TX_TIMER 20
|
||||
|
||||
#define SPIDER_NET_RX_CSUM_DEFAULT 1
|
||||
|
||||
#define SPIDER_NET_WATCHDOG_TIMEOUT 5*HZ
|
||||
#define SPIDER_NET_NAPI_WEIGHT 64
|
||||
#define SPIDER_NET_WATCHDOG_TIMEOUT 50*HZ
|
||||
#define SPIDER_NET_NAPI_WEIGHT 64
|
||||
|
||||
#define SPIDER_NET_FIRMWARE_LEN 1024
|
||||
#define SPIDER_NET_FIRMWARE_SEQS 6
|
||||
#define SPIDER_NET_FIRMWARE_SEQWORDS 1024
|
||||
#define SPIDER_NET_FIRMWARE_LEN (SPIDER_NET_FIRMWARE_SEQS * \
|
||||
SPIDER_NET_FIRMWARE_SEQWORDS * \
|
||||
sizeof(u32))
|
||||
#define SPIDER_NET_FIRMWARE_NAME "spider_fw.bin"
|
||||
|
||||
/** spider_net SMMIO registers */
|
||||
@@ -142,14 +149,12 @@ extern char spider_net_driver_name[];
|
||||
/** SCONFIG registers */
|
||||
#define SPIDER_NET_SCONFIG_IOACTE 0x00002810
|
||||
|
||||
/** hardcoded register values */
|
||||
#define SPIDER_NET_INT0_MASK_VALUE 0x3f7fe3ff
|
||||
#define SPIDER_NET_INT1_MASK_VALUE 0xffffffff
|
||||
/** interrupt mask registers */
|
||||
#define SPIDER_NET_INT0_MASK_VALUE 0x3f7fe2c7
|
||||
#define SPIDER_NET_INT1_MASK_VALUE 0xffff7ff7
|
||||
/* no MAC aborts -> auto retransmission */
|
||||
#define SPIDER_NET_INT2_MASK_VALUE 0xfffffff1
|
||||
#define SPIDER_NET_INT2_MASK_VALUE 0xffef7ff1
|
||||
|
||||
/* clear counter when interrupt sources are cleared
|
||||
#define SPIDER_NET_FRAMENUM_VALUE 0x0001f001 */
|
||||
/* we rely on flagged descriptor interrupts */
|
||||
#define SPIDER_NET_FRAMENUM_VALUE 0x00000000
|
||||
/* set this first, then the FRAMENUM_VALUE */
|
||||
@@ -168,7 +173,7 @@ extern char spider_net_driver_name[];
|
||||
#if 0
|
||||
#define SPIDER_NET_WOL_VALUE 0x00000000
|
||||
#endif
|
||||
#define SPIDER_NET_IPSECINIT_VALUE 0x00f000f8
|
||||
#define SPIDER_NET_IPSECINIT_VALUE 0x6f716f71
|
||||
|
||||
/* pause frames: automatic, no upper retransmission count */
|
||||
/* outside loopback mode: ETOMOD signal dont matter, not connected */
|
||||
@@ -318,6 +323,10 @@ enum spider_net_int2_status {
|
||||
#define SPIDER_NET_RXINT ( (1 << SPIDER_NET_GDAFDCINT) | \
|
||||
(1 << SPIDER_NET_GRMFLLINT) )
|
||||
|
||||
#define SPIDER_NET_ERRINT ( 0xffffffff & \
|
||||
(~SPIDER_NET_TXINT) & \
|
||||
(~SPIDER_NET_RXINT) )
|
||||
|
||||
#define SPIDER_NET_GPREXEC 0x80000000
|
||||
#define SPIDER_NET_GPRDAT_MASK 0x0000ffff
|
||||
|
||||
@@ -358,9 +367,6 @@ enum spider_net_int2_status {
|
||||
/* descr ready, descr is in middle of chain, get interrupt on completion */
|
||||
#define SPIDER_NET_DMAC_RX_CARDOWNED 0xa0800000
|
||||
|
||||
/* multicast is no problem */
|
||||
#define SPIDER_NET_DATA_ERROR_MASK 0xffffbfff
|
||||
|
||||
enum spider_net_descr_status {
|
||||
SPIDER_NET_DESCR_COMPLETE = 0x00, /* used in rx and tx */
|
||||
SPIDER_NET_DESCR_RESPONSE_ERROR = 0x01, /* used in rx and tx */
|
||||
@@ -373,9 +379,9 @@ enum spider_net_descr_status {
|
||||
|
||||
struct spider_net_descr {
|
||||
/* as defined by the hardware */
|
||||
dma_addr_t buf_addr;
|
||||
u32 buf_addr;
|
||||
u32 buf_size;
|
||||
dma_addr_t next_descr_addr;
|
||||
u32 next_descr_addr;
|
||||
u32 dmac_cmd_status;
|
||||
u32 result_size;
|
||||
u32 valid_size; /* all zeroes for tx */
|
||||
@@ -384,7 +390,7 @@ struct spider_net_descr {
|
||||
|
||||
/* used in the driver */
|
||||
struct sk_buff *skb;
|
||||
dma_addr_t bus_addr;
|
||||
u32 bus_addr;
|
||||
struct spider_net_descr *next;
|
||||
struct spider_net_descr *prev;
|
||||
} __attribute__((aligned(32)));
|
||||
@@ -396,21 +402,21 @@ struct spider_net_descr_chain {
|
||||
};
|
||||
|
||||
/* descriptor data_status bits */
|
||||
#define SPIDER_NET_RXIPCHK 29
|
||||
#define SPIDER_NET_TCPUDPIPCHK 28
|
||||
#define SPIDER_NET_DATA_STATUS_CHK_MASK (1 << SPIDER_NET_RXIPCHK | \
|
||||
1 << SPIDER_NET_TCPUDPIPCHK)
|
||||
|
||||
#define SPIDER_NET_RX_IPCHK 29
|
||||
#define SPIDER_NET_RX_TCPCHK 28
|
||||
#define SPIDER_NET_VLAN_PACKET 21
|
||||
#define SPIDER_NET_DATA_STATUS_CKSUM_MASK ( (1 << SPIDER_NET_RX_IPCHK) | \
|
||||
(1 << SPIDER_NET_RX_TCPCHK) )
|
||||
|
||||
/* descriptor data_error bits */
|
||||
#define SPIDER_NET_RXIPCHKERR 27
|
||||
#define SPIDER_NET_RXTCPCHKERR 26
|
||||
#define SPIDER_NET_DATA_ERROR_CHK_MASK (1 << SPIDER_NET_RXIPCHKERR | \
|
||||
1 << SPIDER_NET_RXTCPCHKERR)
|
||||
#define SPIDER_NET_RX_IPCHKERR 27
|
||||
#define SPIDER_NET_RX_RXTCPCHKERR 28
|
||||
|
||||
/* the cases we don't pass the packet to the stack */
|
||||
#define SPIDER_NET_DESTROY_RX_FLAGS 0x70138000
|
||||
#define SPIDER_NET_DATA_ERR_CKSUM_MASK (1 << SPIDER_NET_RX_IPCHKERR)
|
||||
|
||||
/* the cases we don't pass the packet to the stack.
|
||||
* 701b8000 would be correct, but every packets gets that flag */
|
||||
#define SPIDER_NET_DESTROY_RX_FLAGS 0x700b8000
|
||||
|
||||
#define SPIDER_NET_DESCR_SIZE 32
|
||||
|
||||
@@ -445,13 +451,16 @@ struct spider_net_card {
|
||||
|
||||
struct spider_net_descr_chain tx_chain;
|
||||
struct spider_net_descr_chain rx_chain;
|
||||
spinlock_t chain_lock;
|
||||
atomic_t rx_chain_refill;
|
||||
atomic_t tx_chain_release;
|
||||
|
||||
struct net_device_stats netdev_stats;
|
||||
|
||||
struct spider_net_options options;
|
||||
|
||||
spinlock_t intmask_lock;
|
||||
struct tasklet_struct rxram_full_tl;
|
||||
struct timer_list tx_timer;
|
||||
|
||||
struct work_struct tx_timeout_task;
|
||||
atomic_t tx_timeout_task_counter;
|
||||
|
||||
@@ -113,6 +113,23 @@ spider_net_ethtool_set_rx_csum(struct net_device *netdev, u32 n)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
spider_net_ethtool_get_tx_csum(struct net_device *netdev)
|
||||
{
|
||||
return (netdev->features & NETIF_F_HW_CSUM) != 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spider_net_ethtool_set_tx_csum(struct net_device *netdev, uint32_t data)
|
||||
{
|
||||
if (data)
|
||||
netdev->features |= NETIF_F_HW_CSUM;
|
||||
else
|
||||
netdev->features &= ~NETIF_F_HW_CSUM;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct ethtool_ops spider_net_ethtool_ops = {
|
||||
.get_settings = spider_net_ethtool_get_settings,
|
||||
.get_drvinfo = spider_net_ethtool_get_drvinfo,
|
||||
@@ -122,5 +139,7 @@ struct ethtool_ops spider_net_ethtool_ops = {
|
||||
.nway_reset = spider_net_ethtool_nway_reset,
|
||||
.get_rx_csum = spider_net_ethtool_get_rx_csum,
|
||||
.set_rx_csum = spider_net_ethtool_set_rx_csum,
|
||||
.get_tx_csum = spider_net_ethtool_get_tx_csum,
|
||||
.set_tx_csum = spider_net_ethtool_set_tx_csum,
|
||||
};
|
||||
|
||||
|
||||
+10
-11
@@ -5668,13 +5668,13 @@ static int airo_set_freq(struct net_device *dev,
|
||||
int channel = fwrq->m;
|
||||
/* We should do a better check than that,
|
||||
* based on the card capability !!! */
|
||||
if((channel < 1) || (channel > 16)) {
|
||||
if((channel < 1) || (channel > 14)) {
|
||||
printk(KERN_DEBUG "%s: New channel value of %d is invalid!\n", dev->name, fwrq->m);
|
||||
rc = -EINVAL;
|
||||
} else {
|
||||
readConfigRid(local, 1);
|
||||
/* Yes ! We can set it !!! */
|
||||
local->config.channelSet = (u16)(channel - 1);
|
||||
local->config.channelSet = (u16) channel;
|
||||
set_bit (FLAG_COMMIT, &local->flags);
|
||||
}
|
||||
}
|
||||
@@ -5692,6 +5692,7 @@ static int airo_get_freq(struct net_device *dev,
|
||||
{
|
||||
struct airo_info *local = dev->priv;
|
||||
StatusRid status_rid; /* Card status info */
|
||||
int ch;
|
||||
|
||||
readConfigRid(local, 1);
|
||||
if ((local->config.opmode & 0xFF) == MODE_STA_ESS)
|
||||
@@ -5699,16 +5700,14 @@ static int airo_get_freq(struct net_device *dev,
|
||||
else
|
||||
readStatusRid(local, &status_rid, 1);
|
||||
|
||||
#ifdef WEXT_USECHANNELS
|
||||
fwrq->m = ((int)status_rid.channel) + 1;
|
||||
fwrq->e = 0;
|
||||
#else
|
||||
{
|
||||
int f = (int)status_rid.channel;
|
||||
fwrq->m = frequency_list[f] * 100000;
|
||||
ch = (int)status_rid.channel;
|
||||
if((ch > 0) && (ch < 15)) {
|
||||
fwrq->m = frequency_list[ch - 1] * 100000;
|
||||
fwrq->e = 1;
|
||||
} else {
|
||||
fwrq->m = ch;
|
||||
fwrq->e = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -5783,7 +5782,7 @@ static int airo_get_essid(struct net_device *dev,
|
||||
/* If none, we may want to get the one that was set */
|
||||
|
||||
/* Push it out ! */
|
||||
dwrq->length = status_rid.SSIDlen + 1;
|
||||
dwrq->length = status_rid.SSIDlen;
|
||||
dwrq->flags = 1; /* active */
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1718,11 +1718,11 @@ static int atmel_get_essid(struct net_device *dev,
|
||||
if (priv->new_SSID_size != 0) {
|
||||
memcpy(extra, priv->new_SSID, priv->new_SSID_size);
|
||||
extra[priv->new_SSID_size] = '\0';
|
||||
dwrq->length = priv->new_SSID_size + 1;
|
||||
dwrq->length = priv->new_SSID_size;
|
||||
} else {
|
||||
memcpy(extra, priv->SSID, priv->SSID_size);
|
||||
extra[priv->SSID_size] = '\0';
|
||||
dwrq->length = priv->SSID_size + 1;
|
||||
dwrq->length = priv->SSID_size;
|
||||
}
|
||||
|
||||
dwrq->flags = !priv->connect_to_any_BSS; /* active */
|
||||
|
||||
@@ -26,11 +26,25 @@ config HOSTAP_FIRMWARE
|
||||
depends on HOSTAP
|
||||
---help---
|
||||
Configure Host AP driver to include support for firmware image
|
||||
download. Current version supports only downloading to volatile, i.e.,
|
||||
RAM memory. Flash upgrade is not yet supported.
|
||||
download. This option by itself only enables downloading to the
|
||||
volatile memory, i.e. the card RAM. This option is required to
|
||||
support cards that don't have firmware in flash, such as D-Link
|
||||
DWL-520 rev E and D-Link DWL-650 rev P.
|
||||
|
||||
Firmware image downloading needs user space tool, prism2_srec. It is
|
||||
available from http://hostap.epitest.fi/.
|
||||
Firmware image downloading needs a user space tool, prism2_srec.
|
||||
It is available from http://hostap.epitest.fi/.
|
||||
|
||||
config HOSTAP_FIRMWARE_NVRAM
|
||||
bool "Support for non-volatile firmware download"
|
||||
depends on HOSTAP_FIRMWARE
|
||||
---help---
|
||||
Allow Host AP driver to write firmware images to the non-volatile
|
||||
card memory, i.e. flash memory that survives power cycling.
|
||||
Enable this option if you want to be able to change card firmware
|
||||
permanently.
|
||||
|
||||
Firmware image downloading needs a user space tool, prism2_srec.
|
||||
It is available from http://hostap.epitest.fi/.
|
||||
|
||||
config HOSTAP_PLX
|
||||
tristate "Host AP driver for Prism2/2.5/3 in PLX9052 PCI adaptors"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
hostap-y := hostap_main.o
|
||||
hostap-y := hostap_80211_rx.o hostap_80211_tx.o hostap_ap.o hostap_info.o \
|
||||
hostap_ioctl.o hostap_main.o hostap_proc.o
|
||||
obj-$(CONFIG_HOSTAP) += hostap.o
|
||||
|
||||
obj-$(CONFIG_HOSTAP_CS) += hostap_cs.o
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
#ifndef HOSTAP_H
|
||||
#define HOSTAP_H
|
||||
|
||||
#include <linux/ethtool.h>
|
||||
|
||||
#include "hostap_wlan.h"
|
||||
#include "hostap_ap.h"
|
||||
|
||||
static const long freq_list[] = { 2412, 2417, 2422, 2427, 2432, 2437, 2442,
|
||||
2447, 2452, 2457, 2462, 2467, 2472, 2484 };
|
||||
#define FREQ_COUNT (sizeof(freq_list) / sizeof(freq_list[0]))
|
||||
|
||||
/* hostap.c */
|
||||
|
||||
extern struct proc_dir_entry *hostap_proc;
|
||||
@@ -40,6 +49,26 @@ int prism2_update_comms_qual(struct net_device *dev);
|
||||
int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
|
||||
u8 *body, size_t bodylen);
|
||||
int prism2_sta_deauth(local_info_t *local, u16 reason);
|
||||
int prism2_wds_add(local_info_t *local, u8 *remote_addr,
|
||||
int rtnl_locked);
|
||||
int prism2_wds_del(local_info_t *local, u8 *remote_addr,
|
||||
int rtnl_locked, int do_not_remove);
|
||||
|
||||
|
||||
/* hostap_ap.c */
|
||||
|
||||
int ap_control_add_mac(struct mac_restrictions *mac_restrictions, u8 *mac);
|
||||
int ap_control_del_mac(struct mac_restrictions *mac_restrictions, u8 *mac);
|
||||
void ap_control_flush_macs(struct mac_restrictions *mac_restrictions);
|
||||
int ap_control_kick_mac(struct ap_data *ap, struct net_device *dev, u8 *mac);
|
||||
void ap_control_kickall(struct ap_data *ap);
|
||||
void * ap_crypt_get_ptrs(struct ap_data *ap, u8 *addr, int permanent,
|
||||
struct ieee80211_crypt_data ***crypt);
|
||||
int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
|
||||
struct iw_quality qual[], int buf_size,
|
||||
int aplist);
|
||||
int prism2_ap_translate_scan(struct net_device *dev, char *buffer);
|
||||
int prism2_hostapd(struct ap_data *ap, struct prism2_hostapd_param *param);
|
||||
|
||||
|
||||
/* hostap_proc.c */
|
||||
@@ -54,4 +83,12 @@ void hostap_info_init(local_info_t *local);
|
||||
void hostap_info_process(local_info_t *local, struct sk_buff *skb);
|
||||
|
||||
|
||||
/* hostap_ioctl.c */
|
||||
|
||||
extern const struct iw_handler_def hostap_iw_handler_def;
|
||||
extern struct ethtool_ops prism2_ethtool_ops;
|
||||
|
||||
int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
|
||||
|
||||
|
||||
#endif /* HOSTAP_H */
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef HOSTAP_80211_H
|
||||
#define HOSTAP_80211_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <net/ieee80211_crypt.h>
|
||||
|
||||
struct hostap_ieee80211_mgmt {
|
||||
u16 frame_control;
|
||||
u16 duration;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user