mirror of
https://github.com/suyu-emu/horinux.git
synced 2026-09-21 14:15:21 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (66 commits) can-bcm: fix minor heap overflow gianfar: Do not call device_set_wakeup_enable() under a spinlock ipv6: Warn users if maximum number of routes is reached. docs: Add neigh/gc_thresh3 and route/max_size documentation. axnet_cs: fix resume problem for some Ax88790 chip ipv6: addrconf: don't remove address state on ifdown if the address is being kept tcp: Don't change unlocked socket state in tcp_v4_err(). x25: Prevent crashing when parsing bad X.25 facilities cxgb4vf: add call to Firmware to reset VF State. cxgb4vf: Fail open if link_start() fails. cxgb4vf: flesh out PCI Device ID Table ... cxgb4vf: fix some errors in Gather List to skb conversion cxgb4vf: fix bug in Generic Receive Offload cxgb4vf: don't implement trivial (and incorrect) ndo_select_queue() ixgbe: Look inside vlan when determining offload protocol. bnx2x: Look inside vlan when determining checksum proto. vlan: Add function to retrieve EtherType from vlan packets. virtio-net: init link state correctly ucc_geth: Fix deadlock ucc_geth: Do not bring the whole IF down when TX failure. ...
This commit is contained in:
@@ -20,6 +20,15 @@ ip_no_pmtu_disc - BOOLEAN
|
||||
min_pmtu - INTEGER
|
||||
default 562 - minimum discovered Path MTU
|
||||
|
||||
route/max_size - INTEGER
|
||||
Maximum number of routes allowed in the kernel. Increase
|
||||
this when using large numbers of interfaces and/or routes.
|
||||
|
||||
neigh/default/gc_thresh3 - INTEGER
|
||||
Maximum number of neighbor entries allowed. Increase this
|
||||
when using large numbers of interfaces and when communicating
|
||||
with large numbers of directly-connected peers.
|
||||
|
||||
mtu_expires - INTEGER
|
||||
Time, in seconds, that cached PMTU information is kept.
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
SOLOS_ATTR_RO(DriverVersion)
|
||||
SOLOS_ATTR_RO(APIVersion)
|
||||
SOLOS_ATTR_RO(FirmwareVersion)
|
||||
SOLOS_ATTR_RO(Version)
|
||||
// SOLOS_ATTR_RO(DspVersion)
|
||||
// SOLOS_ATTR_RO(CommonHandshake)
|
||||
SOLOS_ATTR_RO(Connected)
|
||||
|
||||
@@ -1161,6 +1161,14 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
dev_info(&dev->dev, "Solos FPGA Version %d.%02d svn-%d\n",
|
||||
major_ver, minor_ver, fpga_ver);
|
||||
|
||||
if (fpga_ver < 37 && (fpga_upgrade || firmware_upgrade ||
|
||||
db_fpga_upgrade || db_firmware_upgrade)) {
|
||||
dev_warn(&dev->dev,
|
||||
"FPGA too old; cannot upgrade flash. Use JTAG.\n");
|
||||
fpga_upgrade = firmware_upgrade = 0;
|
||||
db_fpga_upgrade = db_firmware_upgrade = 0;
|
||||
}
|
||||
|
||||
if (card->fpga_version >= DMA_SUPPORTED){
|
||||
card->using_dma = 1;
|
||||
} else {
|
||||
|
||||
@@ -68,6 +68,9 @@ static struct usb_device_id btusb_table[] = {
|
||||
/* Apple MacBookPro6,2 */
|
||||
{ USB_DEVICE(0x05ac, 0x8218) },
|
||||
|
||||
/* Apple MacBookAir3,1, MacBookAir3,2 */
|
||||
{ USB_DEVICE(0x05ac, 0x821b) },
|
||||
|
||||
/* AVM BlueFRITZ! USB v2.0 */
|
||||
{ USB_DEVICE(0x057c, 0x3800) },
|
||||
|
||||
@@ -1029,6 +1032,8 @@ static int btusb_probe(struct usb_interface *intf,
|
||||
|
||||
usb_set_intfdata(intf, data);
|
||||
|
||||
usb_enable_autosuspend(interface_to_usbdev(intf));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1680,7 +1680,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
|
||||
rc = XMIT_PLAIN;
|
||||
|
||||
else {
|
||||
if (skb->protocol == htons(ETH_P_IPV6)) {
|
||||
if (vlan_get_protocol(skb) == htons(ETH_P_IPV6)) {
|
||||
rc = XMIT_CSUM_V6;
|
||||
if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
|
||||
rc |= XMIT_CSUM_TCP;
|
||||
|
||||
@@ -753,7 +753,9 @@ static int cxgb4vf_open(struct net_device *dev)
|
||||
if (err)
|
||||
return err;
|
||||
set_bit(pi->port_id, &adapter->open_device_map);
|
||||
link_start(dev);
|
||||
err = link_start(dev);
|
||||
if (err)
|
||||
return err;
|
||||
netif_tx_start_all_queues(dev);
|
||||
return 0;
|
||||
}
|
||||
@@ -1103,18 +1105,6 @@ static int cxgb4vf_set_mac_addr(struct net_device *dev, void *_addr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return a TX Queue on which to send the specified skb.
|
||||
*/
|
||||
static u16 cxgb4vf_select_queue(struct net_device *dev, struct sk_buff *skb)
|
||||
{
|
||||
/*
|
||||
* XXX For now just use the default hash but we probably want to
|
||||
* XXX look at other possibilities ...
|
||||
*/
|
||||
return skb_tx_hash(dev, skb);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
/*
|
||||
* Poll all of our receive queues. This is called outside of normal interrupt
|
||||
@@ -2074,6 +2064,22 @@ static int adap_init0(struct adapter *adapter)
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some environments do not properly handle PCIE FLRs -- e.g. in Linux
|
||||
* 2.6.31 and later we can't call pci_reset_function() in order to
|
||||
* issue an FLR because of a self- deadlock on the device semaphore.
|
||||
* Meanwhile, the OS infrastructure doesn't issue FLRs in all the
|
||||
* cases where they're needed -- for instance, some versions of KVM
|
||||
* fail to reset "Assigned Devices" when the VM reboots. Therefore we
|
||||
* use the firmware based reset in order to reset any per function
|
||||
* state.
|
||||
*/
|
||||
err = t4vf_fw_reset(adapter);
|
||||
if (err < 0) {
|
||||
dev_err(adapter->pdev_dev, "FW reset failed: err=%d\n", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Grab basic operational parameters. These will predominantly have
|
||||
* been set up by the Physical Function Driver or will be hard coded
|
||||
@@ -2417,7 +2423,6 @@ static const struct net_device_ops cxgb4vf_netdev_ops = {
|
||||
.ndo_get_stats = cxgb4vf_get_stats,
|
||||
.ndo_set_rx_mode = cxgb4vf_set_rxmode,
|
||||
.ndo_set_mac_address = cxgb4vf_set_mac_addr,
|
||||
.ndo_select_queue = cxgb4vf_select_queue,
|
||||
.ndo_validate_addr = eth_validate_addr,
|
||||
.ndo_do_ioctl = cxgb4vf_do_ioctl,
|
||||
.ndo_change_mtu = cxgb4vf_change_mtu,
|
||||
@@ -2624,7 +2629,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
|
||||
netdev->do_ioctl = cxgb4vf_do_ioctl;
|
||||
netdev->change_mtu = cxgb4vf_change_mtu;
|
||||
netdev->set_mac_address = cxgb4vf_set_mac_addr;
|
||||
netdev->select_queue = cxgb4vf_select_queue;
|
||||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
netdev->poll_controller = cxgb4vf_poll_controller;
|
||||
#endif
|
||||
@@ -2843,6 +2847,14 @@ static struct pci_device_id cxgb4vf_pci_tbl[] = {
|
||||
CH_DEVICE(0x4800, 0), /* T440-dbg */
|
||||
CH_DEVICE(0x4801, 0), /* T420-cr */
|
||||
CH_DEVICE(0x4802, 0), /* T422-cr */
|
||||
CH_DEVICE(0x4803, 0), /* T440-cr */
|
||||
CH_DEVICE(0x4804, 0), /* T420-bch */
|
||||
CH_DEVICE(0x4805, 0), /* T440-bch */
|
||||
CH_DEVICE(0x4806, 0), /* T460-ch */
|
||||
CH_DEVICE(0x4807, 0), /* T420-so */
|
||||
CH_DEVICE(0x4808, 0), /* T420-cx */
|
||||
CH_DEVICE(0x4809, 0), /* T420-bt */
|
||||
CH_DEVICE(0x480a, 0), /* T404-bt */
|
||||
{ 0, }
|
||||
};
|
||||
|
||||
|
||||
+75
-47
@@ -154,13 +154,14 @@ enum {
|
||||
*/
|
||||
RX_COPY_THRES = 256,
|
||||
RX_PULL_LEN = 128,
|
||||
};
|
||||
|
||||
/*
|
||||
* Can't define this in the above enum because PKTSHIFT isn't a constant in
|
||||
* the VF Driver ...
|
||||
*/
|
||||
#define RX_PKT_PULL_LEN (RX_PULL_LEN + PKTSHIFT)
|
||||
/*
|
||||
* Main body length for sk_buffs used for RX Ethernet packets with
|
||||
* fragments. Should be >= RX_PULL_LEN but possibly bigger to give
|
||||
* pskb_may_pull() some room.
|
||||
*/
|
||||
RX_SKB_LEN = 512,
|
||||
};
|
||||
|
||||
/*
|
||||
* Software state per TX descriptor.
|
||||
@@ -1354,6 +1355,67 @@ out_free:
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* t4vf_pktgl_to_skb - build an sk_buff from a packet gather list
|
||||
* @gl: the gather list
|
||||
* @skb_len: size of sk_buff main body if it carries fragments
|
||||
* @pull_len: amount of data to move to the sk_buff's main body
|
||||
*
|
||||
* Builds an sk_buff from the given packet gather list. Returns the
|
||||
* sk_buff or %NULL if sk_buff allocation failed.
|
||||
*/
|
||||
struct sk_buff *t4vf_pktgl_to_skb(const struct pkt_gl *gl,
|
||||
unsigned int skb_len, unsigned int pull_len)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct skb_shared_info *ssi;
|
||||
|
||||
/*
|
||||
* If the ingress packet is small enough, allocate an skb large enough
|
||||
* for all of the data and copy it inline. Otherwise, allocate an skb
|
||||
* with enough room to pull in the header and reference the rest of
|
||||
* the data via the skb fragment list.
|
||||
*
|
||||
* Below we rely on RX_COPY_THRES being less than the smallest Rx
|
||||
* buff! size, which is expected since buffers are at least
|
||||
* PAGE_SIZEd. In this case packets up to RX_COPY_THRES have only one
|
||||
* fragment.
|
||||
*/
|
||||
if (gl->tot_len <= RX_COPY_THRES) {
|
||||
/* small packets have only one fragment */
|
||||
skb = alloc_skb(gl->tot_len, GFP_ATOMIC);
|
||||
if (unlikely(!skb))
|
||||
goto out;
|
||||
__skb_put(skb, gl->tot_len);
|
||||
skb_copy_to_linear_data(skb, gl->va, gl->tot_len);
|
||||
} else {
|
||||
skb = alloc_skb(skb_len, GFP_ATOMIC);
|
||||
if (unlikely(!skb))
|
||||
goto out;
|
||||
__skb_put(skb, pull_len);
|
||||
skb_copy_to_linear_data(skb, gl->va, pull_len);
|
||||
|
||||
ssi = skb_shinfo(skb);
|
||||
ssi->frags[0].page = gl->frags[0].page;
|
||||
ssi->frags[0].page_offset = gl->frags[0].page_offset + pull_len;
|
||||
ssi->frags[0].size = gl->frags[0].size - pull_len;
|
||||
if (gl->nfrags > 1)
|
||||
memcpy(&ssi->frags[1], &gl->frags[1],
|
||||
(gl->nfrags-1) * sizeof(skb_frag_t));
|
||||
ssi->nr_frags = gl->nfrags;
|
||||
|
||||
skb->len = gl->tot_len;
|
||||
skb->data_len = skb->len - pull_len;
|
||||
skb->truesize += skb->data_len;
|
||||
|
||||
/* Get a reference for the last page, we don't own it */
|
||||
get_page(gl->frags[gl->nfrags - 1].page);
|
||||
}
|
||||
|
||||
out:
|
||||
return skb;
|
||||
}
|
||||
|
||||
/**
|
||||
* t4vf_pktgl_free - free a packet gather list
|
||||
* @gl: the gather list
|
||||
@@ -1463,10 +1525,8 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct port_info *pi;
|
||||
struct skb_shared_info *ssi;
|
||||
const struct cpl_rx_pkt *pkt = (void *)&rsp[1];
|
||||
bool csum_ok = pkt->csum_calc && !pkt->err_vec;
|
||||
unsigned int len = be16_to_cpu(pkt->len);
|
||||
struct sge_eth_rxq *rxq = container_of(rspq, struct sge_eth_rxq, rspq);
|
||||
|
||||
/*
|
||||
@@ -1481,42 +1541,14 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
|
||||
}
|
||||
|
||||
/*
|
||||
* If the ingress packet is small enough, allocate an skb large enough
|
||||
* for all of the data and copy it inline. Otherwise, allocate an skb
|
||||
* with enough room to pull in the header and reference the rest of
|
||||
* the data via the skb fragment list.
|
||||
* Convert the Packet Gather List into an skb.
|
||||
*/
|
||||
if (len <= RX_COPY_THRES) {
|
||||
/* small packets have only one fragment */
|
||||
skb = alloc_skb(gl->frags[0].size, GFP_ATOMIC);
|
||||
if (!skb)
|
||||
goto nomem;
|
||||
__skb_put(skb, gl->frags[0].size);
|
||||
skb_copy_to_linear_data(skb, gl->va, gl->frags[0].size);
|
||||
} else {
|
||||
skb = alloc_skb(RX_PKT_PULL_LEN, GFP_ATOMIC);
|
||||
if (!skb)
|
||||
goto nomem;
|
||||
__skb_put(skb, RX_PKT_PULL_LEN);
|
||||
skb_copy_to_linear_data(skb, gl->va, RX_PKT_PULL_LEN);
|
||||
|
||||
ssi = skb_shinfo(skb);
|
||||
ssi->frags[0].page = gl->frags[0].page;
|
||||
ssi->frags[0].page_offset = (gl->frags[0].page_offset +
|
||||
RX_PKT_PULL_LEN);
|
||||
ssi->frags[0].size = gl->frags[0].size - RX_PKT_PULL_LEN;
|
||||
if (gl->nfrags > 1)
|
||||
memcpy(&ssi->frags[1], &gl->frags[1],
|
||||
(gl->nfrags-1) * sizeof(skb_frag_t));
|
||||
ssi->nr_frags = gl->nfrags;
|
||||
skb->len = len + PKTSHIFT;
|
||||
skb->data_len = skb->len - RX_PKT_PULL_LEN;
|
||||
skb->truesize += skb->data_len;
|
||||
|
||||
/* Get a reference for the last page, we don't own it */
|
||||
get_page(gl->frags[gl->nfrags - 1].page);
|
||||
skb = t4vf_pktgl_to_skb(gl, RX_SKB_LEN, RX_PULL_LEN);
|
||||
if (unlikely(!skb)) {
|
||||
t4vf_pktgl_free(gl);
|
||||
rxq->stats.rx_drops++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
__skb_pull(skb, PKTSHIFT);
|
||||
skb->protocol = eth_type_trans(skb, rspq->netdev);
|
||||
skb_record_rx_queue(skb, rspq->idx);
|
||||
@@ -1549,11 +1581,6 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp,
|
||||
netif_receive_skb(skb);
|
||||
|
||||
return 0;
|
||||
|
||||
nomem:
|
||||
t4vf_pktgl_free(gl);
|
||||
rxq->stats.rx_drops++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1679,6 +1706,7 @@ int process_responses(struct sge_rspq *rspq, int budget)
|
||||
}
|
||||
len = RSPD_LEN(len);
|
||||
}
|
||||
gl.tot_len = len;
|
||||
|
||||
/*
|
||||
* Gather packet fragments.
|
||||
|
||||
@@ -235,6 +235,7 @@ static inline int t4vf_wr_mbox_ns(struct adapter *adapter, const void *cmd,
|
||||
int __devinit t4vf_wait_dev_ready(struct adapter *);
|
||||
int __devinit t4vf_port_init(struct adapter *, int);
|
||||
|
||||
int t4vf_fw_reset(struct adapter *);
|
||||
int t4vf_query_params(struct adapter *, unsigned int, const u32 *, u32 *);
|
||||
int t4vf_set_params(struct adapter *, unsigned int, const u32 *, const u32 *);
|
||||
|
||||
|
||||
@@ -325,6 +325,25 @@ int __devinit t4vf_port_init(struct adapter *adapter, int pidx)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* t4vf_fw_reset - issue a reset to FW
|
||||
* @adapter: the adapter
|
||||
*
|
||||
* Issues a reset command to FW. For a Physical Function this would
|
||||
* result in the Firmware reseting all of its state. For a Virtual
|
||||
* Function this just resets the state associated with the VF.
|
||||
*/
|
||||
int t4vf_fw_reset(struct adapter *adapter)
|
||||
{
|
||||
struct fw_reset_cmd cmd;
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.op_to_write = cpu_to_be32(FW_CMD_OP(FW_RESET_CMD) |
|
||||
FW_CMD_WRITE);
|
||||
cmd.retval_len16 = cpu_to_be32(FW_LEN16(cmd));
|
||||
return t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* t4vf_query_params - query FW or device parameters
|
||||
* @adapter: the adapter
|
||||
|
||||
@@ -635,9 +635,10 @@ static int gfar_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
||||
if (wol->wolopts & ~WAKE_MAGIC)
|
||||
return -EINVAL;
|
||||
|
||||
device_set_wakeup_enable(&dev->dev, wol->wolopts & WAKE_MAGIC);
|
||||
|
||||
spin_lock_irqsave(&priv->bflock, flags);
|
||||
priv->wol_en = wol->wolopts & WAKE_MAGIC ? 1 : 0;
|
||||
device_set_wakeup_enable(&dev->dev, priv->wol_en);
|
||||
priv->wol_en = !!device_may_wakeup(&dev->dev);
|
||||
spin_unlock_irqrestore(&priv->bflock, flags);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -764,8 +764,9 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
|
||||
#ifdef IXGBE_FCOE
|
||||
/* adjust for FCoE Sequence Offload */
|
||||
if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
|
||||
&& (skb->protocol == htons(ETH_P_FCOE)) &&
|
||||
skb_is_gso(skb)) {
|
||||
&& skb_is_gso(skb)
|
||||
&& vlan_get_protocol(skb) ==
|
||||
htons(ETH_P_FCOE)) {
|
||||
hlen = skb_transport_offset(skb) +
|
||||
sizeof(struct fc_frame_header) +
|
||||
sizeof(struct fcoe_crc_eof);
|
||||
@@ -5823,7 +5824,7 @@ static void ixgbe_watchdog_task(struct work_struct *work)
|
||||
|
||||
static int ixgbe_tso(struct ixgbe_adapter *adapter,
|
||||
struct ixgbe_ring *tx_ring, struct sk_buff *skb,
|
||||
u32 tx_flags, u8 *hdr_len)
|
||||
u32 tx_flags, u8 *hdr_len, __be16 protocol)
|
||||
{
|
||||
struct ixgbe_adv_tx_context_desc *context_desc;
|
||||
unsigned int i;
|
||||
@@ -5841,7 +5842,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter,
|
||||
l4len = tcp_hdrlen(skb);
|
||||
*hdr_len += l4len;
|
||||
|
||||
if (skb->protocol == htons(ETH_P_IP)) {
|
||||
if (protocol == htons(ETH_P_IP)) {
|
||||
struct iphdr *iph = ip_hdr(skb);
|
||||
iph->tot_len = 0;
|
||||
iph->check = 0;
|
||||
@@ -5880,7 +5881,7 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter,
|
||||
type_tucmd_mlhl = (IXGBE_TXD_CMD_DEXT |
|
||||
IXGBE_ADVTXD_DTYP_CTXT);
|
||||
|
||||
if (skb->protocol == htons(ETH_P_IP))
|
||||
if (protocol == htons(ETH_P_IP))
|
||||
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4;
|
||||
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP;
|
||||
context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl);
|
||||
@@ -5906,16 +5907,10 @@ static int ixgbe_tso(struct ixgbe_adapter *adapter,
|
||||
return false;
|
||||
}
|
||||
|
||||
static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb)
|
||||
static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb,
|
||||
__be16 protocol)
|
||||
{
|
||||
u32 rtn = 0;
|
||||
__be16 protocol;
|
||||
|
||||
if (skb->protocol == cpu_to_be16(ETH_P_8021Q))
|
||||
protocol = ((const struct vlan_ethhdr *)skb->data)->
|
||||
h_vlan_encapsulated_proto;
|
||||
else
|
||||
protocol = skb->protocol;
|
||||
|
||||
switch (protocol) {
|
||||
case cpu_to_be16(ETH_P_IP):
|
||||
@@ -5943,7 +5938,7 @@ static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb)
|
||||
default:
|
||||
if (unlikely(net_ratelimit()))
|
||||
e_warn(probe, "partial checksum but proto=%x!\n",
|
||||
skb->protocol);
|
||||
protocol);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5952,7 +5947,8 @@ static u32 ixgbe_psum(struct ixgbe_adapter *adapter, struct sk_buff *skb)
|
||||
|
||||
static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter,
|
||||
struct ixgbe_ring *tx_ring,
|
||||
struct sk_buff *skb, u32 tx_flags)
|
||||
struct sk_buff *skb, u32 tx_flags,
|
||||
__be16 protocol)
|
||||
{
|
||||
struct ixgbe_adv_tx_context_desc *context_desc;
|
||||
unsigned int i;
|
||||
@@ -5981,7 +5977,7 @@ static bool ixgbe_tx_csum(struct ixgbe_adapter *adapter,
|
||||
IXGBE_ADVTXD_DTYP_CTXT);
|
||||
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL)
|
||||
type_tucmd_mlhl |= ixgbe_psum(adapter, skb);
|
||||
type_tucmd_mlhl |= ixgbe_psum(adapter, skb, protocol);
|
||||
|
||||
context_desc->type_tucmd_mlhl = cpu_to_le32(type_tucmd_mlhl);
|
||||
/* use index zero for tx checksum offload */
|
||||
@@ -6179,7 +6175,7 @@ static void ixgbe_tx_queue(struct ixgbe_adapter *adapter,
|
||||
}
|
||||
|
||||
static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb,
|
||||
int queue, u32 tx_flags)
|
||||
int queue, u32 tx_flags, __be16 protocol)
|
||||
{
|
||||
struct ixgbe_atr_input atr_input;
|
||||
struct tcphdr *th;
|
||||
@@ -6190,7 +6186,7 @@ static void ixgbe_atr(struct ixgbe_adapter *adapter, struct sk_buff *skb,
|
||||
u8 l4type = 0;
|
||||
|
||||
/* Right now, we support IPv4 only */
|
||||
if (skb->protocol != htons(ETH_P_IP))
|
||||
if (protocol != htons(ETH_P_IP))
|
||||
return;
|
||||
/* check if we're UDP or TCP */
|
||||
if (iph->protocol == IPPROTO_TCP) {
|
||||
@@ -6257,10 +6253,13 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb)
|
||||
{
|
||||
struct ixgbe_adapter *adapter = netdev_priv(dev);
|
||||
int txq = smp_processor_id();
|
||||
|
||||
#ifdef IXGBE_FCOE
|
||||
if ((skb->protocol == htons(ETH_P_FCOE)) ||
|
||||
(skb->protocol == htons(ETH_P_FIP))) {
|
||||
__be16 protocol;
|
||||
|
||||
protocol = vlan_get_protocol(skb);
|
||||
|
||||
if ((protocol == htons(ETH_P_FCOE)) ||
|
||||
(protocol == htons(ETH_P_FIP))) {
|
||||
if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
|
||||
txq &= (adapter->ring_feature[RING_F_FCOE].indices - 1);
|
||||
txq += adapter->ring_feature[RING_F_FCOE].mask;
|
||||
@@ -6303,6 +6302,9 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev
|
||||
int tso;
|
||||
int count = 0;
|
||||
unsigned int f;
|
||||
__be16 protocol;
|
||||
|
||||
protocol = vlan_get_protocol(skb);
|
||||
|
||||
if (vlan_tx_tag_present(skb)) {
|
||||
tx_flags |= vlan_tx_tag_get(skb);
|
||||
@@ -6323,8 +6325,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev
|
||||
/* for FCoE with DCB, we force the priority to what
|
||||
* was specified by the switch */
|
||||
if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED &&
|
||||
(skb->protocol == htons(ETH_P_FCOE) ||
|
||||
skb->protocol == htons(ETH_P_FIP))) {
|
||||
(protocol == htons(ETH_P_FCOE) ||
|
||||
protocol == htons(ETH_P_FIP))) {
|
||||
#ifdef CONFIG_IXGBE_DCB
|
||||
if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
|
||||
tx_flags &= ~(IXGBE_TX_FLAGS_VLAN_PRIO_MASK
|
||||
@@ -6334,7 +6336,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev
|
||||
}
|
||||
#endif
|
||||
/* flag for FCoE offloads */
|
||||
if (skb->protocol == htons(ETH_P_FCOE))
|
||||
if (protocol == htons(ETH_P_FCOE))
|
||||
tx_flags |= IXGBE_TX_FLAGS_FCOE;
|
||||
}
|
||||
#endif
|
||||
@@ -6368,9 +6370,10 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev
|
||||
tx_flags |= IXGBE_TX_FLAGS_FSO;
|
||||
#endif /* IXGBE_FCOE */
|
||||
} else {
|
||||
if (skb->protocol == htons(ETH_P_IP))
|
||||
if (protocol == htons(ETH_P_IP))
|
||||
tx_flags |= IXGBE_TX_FLAGS_IPV4;
|
||||
tso = ixgbe_tso(adapter, tx_ring, skb, tx_flags, &hdr_len);
|
||||
tso = ixgbe_tso(adapter, tx_ring, skb, tx_flags, &hdr_len,
|
||||
protocol);
|
||||
if (tso < 0) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
@@ -6378,7 +6381,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev
|
||||
|
||||
if (tso)
|
||||
tx_flags |= IXGBE_TX_FLAGS_TSO;
|
||||
else if (ixgbe_tx_csum(adapter, tx_ring, skb, tx_flags) &&
|
||||
else if (ixgbe_tx_csum(adapter, tx_ring, skb, tx_flags,
|
||||
protocol) &&
|
||||
(skb->ip_summed == CHECKSUM_PARTIAL))
|
||||
tx_flags |= IXGBE_TX_FLAGS_CSUM;
|
||||
}
|
||||
@@ -6392,7 +6396,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, struct net_device *netdev
|
||||
test_bit(__IXGBE_FDIR_INIT_DONE,
|
||||
&tx_ring->reinit_state)) {
|
||||
ixgbe_atr(adapter, skb, tx_ring->queue_index,
|
||||
tx_flags);
|
||||
tx_flags, protocol);
|
||||
tx_ring->atr_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,13 +111,14 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id);
|
||||
|
||||
typedef struct axnet_dev_t {
|
||||
struct pcmcia_device *p_dev;
|
||||
caddr_t base;
|
||||
struct timer_list watchdog;
|
||||
int stale, fast_poll;
|
||||
u_short link_status;
|
||||
u_char duplex_flag;
|
||||
int phy_id;
|
||||
int flags;
|
||||
caddr_t base;
|
||||
struct timer_list watchdog;
|
||||
int stale, fast_poll;
|
||||
u_short link_status;
|
||||
u_char duplex_flag;
|
||||
int phy_id;
|
||||
int flags;
|
||||
int active_low;
|
||||
} axnet_dev_t;
|
||||
|
||||
static inline axnet_dev_t *PRIV(struct net_device *dev)
|
||||
@@ -322,6 +323,8 @@ static int axnet_config(struct pcmcia_device *link)
|
||||
if (info->flags & IS_AX88790)
|
||||
outb(0x10, dev->base_addr + AXNET_GPIO); /* select Internal PHY */
|
||||
|
||||
info->active_low = 0;
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1);
|
||||
j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2);
|
||||
@@ -329,15 +332,18 @@ static int axnet_config(struct pcmcia_device *link)
|
||||
if ((j != 0) && (j != 0xffff)) break;
|
||||
}
|
||||
|
||||
/* Maybe PHY is in power down mode. (PPD_SET = 1)
|
||||
Bit 2 of CCSR is active low. */
|
||||
if (i == 32) {
|
||||
/* Maybe PHY is in power down mode. (PPD_SET = 1)
|
||||
Bit 2 of CCSR is active low. */
|
||||
pcmcia_write_config_byte(link, CISREG_CCSR, 0x04);
|
||||
for (i = 0; i < 32; i++) {
|
||||
j = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 1);
|
||||
j2 = mdio_read(dev->base_addr + AXNET_MII_EEP, i, 2);
|
||||
if (j == j2) continue;
|
||||
if ((j != 0) && (j != 0xffff)) break;
|
||||
if ((j != 0) && (j != 0xffff)) {
|
||||
info->active_low = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,8 +389,12 @@ static int axnet_suspend(struct pcmcia_device *link)
|
||||
static int axnet_resume(struct pcmcia_device *link)
|
||||
{
|
||||
struct net_device *dev = link->priv;
|
||||
axnet_dev_t *info = PRIV(dev);
|
||||
|
||||
if (link->open) {
|
||||
if (info->active_low == 1)
|
||||
pcmcia_write_config_byte(link, CISREG_CCSR, 0x04);
|
||||
|
||||
axnet_reset_8390(dev);
|
||||
AX88190_init(dev, 1);
|
||||
netif_device_attach(dev);
|
||||
|
||||
+5
-4
@@ -846,10 +846,10 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
||||
else
|
||||
tp->features &= ~RTL_FEATURE_WOL;
|
||||
__rtl8169_set_wol(tp, wol->wolopts);
|
||||
device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
|
||||
|
||||
spin_unlock_irq(&tp->lock);
|
||||
|
||||
device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2931,7 +2931,7 @@ static const struct rtl_cfg_info {
|
||||
.hw_start = rtl_hw_start_8168,
|
||||
.region = 2,
|
||||
.align = 8,
|
||||
.intr_event = SYSErr | RxFIFOOver | LinkChg | RxOverflow |
|
||||
.intr_event = SYSErr | LinkChg | RxOverflow |
|
||||
TxErr | TxOK | RxOK | RxErr,
|
||||
.napi_event = TxErr | TxOK | RxOK | RxOverflow,
|
||||
.features = RTL_FEATURE_GMII | RTL_FEATURE_MSI,
|
||||
@@ -4588,7 +4588,8 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
|
||||
}
|
||||
|
||||
/* Work around for rx fifo overflow */
|
||||
if (unlikely(status & RxFIFOOver)) {
|
||||
if (unlikely(status & RxFIFOOver) &&
|
||||
(tp->mac_version == RTL_GIGA_MAC_VER_11)) {
|
||||
netif_stop_queue(dev);
|
||||
rtl8169_tx_timeout(dev);
|
||||
break;
|
||||
|
||||
@@ -3858,7 +3858,6 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
|
||||
|
||||
/* device is off until link detection */
|
||||
netif_carrier_off(dev);
|
||||
netif_stop_queue(dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
+16
-9
@@ -2050,12 +2050,16 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth)
|
||||
|
||||
ugeth_vdbg("%s: IN", __func__);
|
||||
|
||||
/*
|
||||
* Tell the kernel the link is down.
|
||||
* Must be done before disabling the controller
|
||||
* or deadlock may happen.
|
||||
*/
|
||||
phy_stop(phydev);
|
||||
|
||||
/* Disable the controller */
|
||||
ugeth_disable(ugeth, COMM_DIR_RX_AND_TX);
|
||||
|
||||
/* Tell the kernel the link is down */
|
||||
phy_stop(phydev);
|
||||
|
||||
/* Mask all interrupts */
|
||||
out_be32(ugeth->uccf->p_uccm, 0x00000000);
|
||||
|
||||
@@ -2065,9 +2069,6 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth)
|
||||
/* Disable Rx and Tx */
|
||||
clrbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX);
|
||||
|
||||
phy_disconnect(ugeth->phydev);
|
||||
ugeth->phydev = NULL;
|
||||
|
||||
ucc_geth_memclean(ugeth);
|
||||
}
|
||||
|
||||
@@ -3550,7 +3551,10 @@ static int ucc_geth_close(struct net_device *dev)
|
||||
|
||||
napi_disable(&ugeth->napi);
|
||||
|
||||
cancel_work_sync(&ugeth->timeout_work);
|
||||
ucc_geth_stop(ugeth);
|
||||
phy_disconnect(ugeth->phydev);
|
||||
ugeth->phydev = NULL;
|
||||
|
||||
free_irq(ugeth->ug_info->uf_info.irq, ugeth->ndev);
|
||||
|
||||
@@ -3579,8 +3583,12 @@ static void ucc_geth_timeout_work(struct work_struct *work)
|
||||
* Must reset MAC *and* PHY. This is done by reopening
|
||||
* the device.
|
||||
*/
|
||||
ucc_geth_close(dev);
|
||||
ucc_geth_open(dev);
|
||||
netif_tx_stop_all_queues(dev);
|
||||
ucc_geth_stop(ugeth);
|
||||
ucc_geth_init_mac(ugeth);
|
||||
/* Must start PHY here */
|
||||
phy_start(ugeth->phydev);
|
||||
netif_tx_start_all_queues(dev);
|
||||
}
|
||||
|
||||
netif_tx_schedule_all(dev);
|
||||
@@ -3594,7 +3602,6 @@ static void ucc_geth_timeout(struct net_device *dev)
|
||||
{
|
||||
struct ucc_geth_private *ugeth = netdev_priv(dev);
|
||||
|
||||
netif_carrier_off(dev);
|
||||
schedule_work(&ugeth->timeout_work);
|
||||
}
|
||||
|
||||
|
||||
@@ -986,9 +986,15 @@ static int virtnet_probe(struct virtio_device *vdev)
|
||||
goto unregister;
|
||||
}
|
||||
|
||||
vi->status = VIRTIO_NET_S_LINK_UP;
|
||||
virtnet_update_status(vi);
|
||||
netif_carrier_on(dev);
|
||||
/* Assume link up if device can't report link status,
|
||||
otherwise get link status from config. */
|
||||
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
|
||||
netif_carrier_off(dev);
|
||||
virtnet_update_status(vi);
|
||||
} else {
|
||||
vi->status = VIRTIO_NET_S_LINK_UP;
|
||||
netif_carrier_on(dev);
|
||||
}
|
||||
|
||||
pr_debug("virtnet: registered device %s\n", dev->name);
|
||||
return 0;
|
||||
|
||||
@@ -410,6 +410,9 @@ static void ar9002_hw_configpcipowersave(struct ath_hw *ah,
|
||||
val &= ~(AR_WA_BIT6 | AR_WA_BIT7);
|
||||
}
|
||||
|
||||
if (AR_SREV_9280(ah))
|
||||
val |= AR_WA_BIT22;
|
||||
|
||||
if (AR_SREV_9285E_20(ah))
|
||||
val |= AR_WA_BIT23;
|
||||
|
||||
|
||||
@@ -675,6 +675,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz)
|
||||
}
|
||||
|
||||
extern struct ieee80211_ops ath9k_ops;
|
||||
extern struct pm_qos_request_list ath9k_pm_qos_req;
|
||||
extern int modparam_nohwcrypt;
|
||||
extern int led_blink;
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ static struct usb_device_id ath9k_hif_usb_ids[] = {
|
||||
{ USB_DEVICE(0x07D1, 0x3A10) }, /* Dlink Wireless 150 */
|
||||
{ USB_DEVICE(0x13D3, 0x3327) }, /* Azurewave */
|
||||
{ USB_DEVICE(0x13D3, 0x3328) }, /* Azurewave */
|
||||
{ USB_DEVICE(0x13D3, 0x3346) }, /* IMC Networks */
|
||||
{ USB_DEVICE(0x04CA, 0x4605) }, /* Liteon */
|
||||
{ USB_DEVICE(0x083A, 0xA704) }, /* SMC Networks */
|
||||
{ },
|
||||
@@ -540,11 +541,11 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
|
||||
return;
|
||||
}
|
||||
|
||||
usb_fill_int_urb(urb, hif_dev->udev,
|
||||
usb_fill_bulk_urb(urb, hif_dev->udev,
|
||||
usb_rcvbulkpipe(hif_dev->udev,
|
||||
USB_REG_IN_PIPE),
|
||||
nskb->data, MAX_REG_IN_BUF_SIZE,
|
||||
ath9k_hif_usb_reg_in_cb, nskb, 1);
|
||||
ath9k_hif_usb_reg_in_cb, nskb);
|
||||
|
||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (ret) {
|
||||
@@ -720,11 +721,11 @@ static int ath9k_hif_usb_alloc_reg_in_urb(struct hif_device_usb *hif_dev)
|
||||
if (!skb)
|
||||
goto err;
|
||||
|
||||
usb_fill_int_urb(hif_dev->reg_in_urb, hif_dev->udev,
|
||||
usb_fill_bulk_urb(hif_dev->reg_in_urb, hif_dev->udev,
|
||||
usb_rcvbulkpipe(hif_dev->udev,
|
||||
USB_REG_IN_PIPE),
|
||||
skb->data, MAX_REG_IN_BUF_SIZE,
|
||||
ath9k_hif_usb_reg_in_cb, skb, 1);
|
||||
ath9k_hif_usb_reg_in_cb, skb);
|
||||
|
||||
if (usb_submit_urb(hif_dev->reg_in_urb, GFP_KERNEL) != 0)
|
||||
goto err;
|
||||
@@ -843,14 +844,6 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev)
|
||||
goto err_fw_req;
|
||||
}
|
||||
|
||||
/* Alloc URBs */
|
||||
ret = ath9k_hif_usb_alloc_urbs(hif_dev);
|
||||
if (ret) {
|
||||
dev_err(&hif_dev->udev->dev,
|
||||
"ath9k_htc: Unable to allocate URBs\n");
|
||||
goto err_urb;
|
||||
}
|
||||
|
||||
/* Download firmware */
|
||||
ret = ath9k_hif_usb_download_fw(hif_dev);
|
||||
if (ret) {
|
||||
@@ -866,16 +859,22 @@ static int ath9k_hif_usb_dev_init(struct hif_device_usb *hif_dev)
|
||||
*/
|
||||
for (idx = 0; idx < alt->desc.bNumEndpoints; idx++) {
|
||||
endp = &alt->endpoint[idx].desc;
|
||||
if (((endp->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK)
|
||||
== 0x04) &&
|
||||
((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
|
||||
== USB_ENDPOINT_XFER_INT)) {
|
||||
if ((endp->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK)
|
||||
== USB_ENDPOINT_XFER_INT) {
|
||||
endp->bmAttributes &= ~USB_ENDPOINT_XFERTYPE_MASK;
|
||||
endp->bmAttributes |= USB_ENDPOINT_XFER_BULK;
|
||||
endp->bInterval = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Alloc URBs */
|
||||
ret = ath9k_hif_usb_alloc_urbs(hif_dev);
|
||||
if (ret) {
|
||||
dev_err(&hif_dev->udev->dev,
|
||||
"ath9k_htc: Unable to allocate URBs\n");
|
||||
goto err_urb;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_fw_download:
|
||||
|
||||
@@ -484,6 +484,7 @@ static int ath9k_hw_post_init(struct ath_hw *ah)
|
||||
ath_print(ath9k_hw_common(ah), ATH_DBG_FATAL,
|
||||
"Failed allocating banks for "
|
||||
"external radio\n");
|
||||
ath9k_hw_rf_free_ext_banks(ah);
|
||||
return ecode;
|
||||
}
|
||||
|
||||
@@ -952,9 +953,12 @@ static void ath9k_hw_set_operating_mode(struct ath_hw *ah, int opmode)
|
||||
REG_SET_BIT(ah, AR_CFG, AR_CFG_AP_ADHOC_INDICATION);
|
||||
break;
|
||||
case NL80211_IFTYPE_STATION:
|
||||
case NL80211_IFTYPE_MONITOR:
|
||||
REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE);
|
||||
break;
|
||||
default:
|
||||
if (ah->is_monitoring)
|
||||
REG_WRITE(ah, AR_STA_ID1, val | AR_STA_ID1_KSRCH_MODE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1634,7 +1638,6 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
|
||||
|
||||
switch (ah->opmode) {
|
||||
case NL80211_IFTYPE_STATION:
|
||||
case NL80211_IFTYPE_MONITOR:
|
||||
REG_WRITE(ah, AR_NEXT_TBTT_TIMER, TU_TO_USEC(next_beacon));
|
||||
REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff);
|
||||
REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff);
|
||||
@@ -1663,6 +1666,14 @@ void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
|
||||
AR_TBTT_TIMER_EN | AR_DBA_TIMER_EN | AR_SWBA_TIMER_EN;
|
||||
break;
|
||||
default:
|
||||
if (ah->is_monitoring) {
|
||||
REG_WRITE(ah, AR_NEXT_TBTT_TIMER,
|
||||
TU_TO_USEC(next_beacon));
|
||||
REG_WRITE(ah, AR_NEXT_DMA_BEACON_ALERT, 0xffff);
|
||||
REG_WRITE(ah, AR_NEXT_SWBA, 0x7ffff);
|
||||
flags |= AR_TBTT_TIMER_EN;
|
||||
break;
|
||||
}
|
||||
ath_print(ath9k_hw_common(ah), ATH_DBG_BEACON,
|
||||
"%s: unsupported opmode: %d\n",
|
||||
__func__, ah->opmode);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user