Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 122790
b: refs/heads/master
c: 420e7fa
h: refs/heads/master
v: v3
  • Loading branch information
Henning Rogge authored and John W. Linville committed Dec 19, 2008
1 parent 6a4859c commit 179f381
Show file tree
Hide file tree
Showing 18 changed files with 244 additions and 209 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c94cb314503a69492bf4455dce4f6d300cff0851
refs/heads/master: 420e7fabd9c6d907280ed6b3e40eef425c5d8d8d
1 change: 0 additions & 1 deletion trunk/drivers/net/cxgb3/adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ struct port_info {
struct link_config link_config;
struct net_device_stats netstats;
int activity;
__be32 iscsi_ipv4addr;
};

enum { /* adapter flags */
Expand Down
7 changes: 0 additions & 7 deletions trunk/drivers/net/cxgb3/cxgb3_ctl_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ enum {
RDMA_GET_MIB = 19,

GET_RX_PAGE_INFO = 50,
GET_ISCSI_IPV4ADDR = 51,
};

/*
Expand Down Expand Up @@ -87,12 +86,6 @@ struct iff_mac {
u16 vlan_tag;
};

/* Structure used to request a port's iSCSI IPv4 address */
struct iscsi_ipv4addr {
struct net_device *dev; /* the net_device */
__be32 ipv4addr; /* the return iSCSI IPv4 address */
};

struct pci_dev;

/*
Expand Down
67 changes: 18 additions & 49 deletions trunk/drivers/net/cxgb3/cxgb3_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,7 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter,
static int cxgb_ulp_iscsi_ctl(struct adapter *adapter, unsigned int req,
void *data)
{
int i;
int ret = 0;
unsigned int val = 0;
struct ulp_iscsi_info *uiip = data;

switch (req) {
Expand All @@ -193,55 +191,32 @@ static int cxgb_ulp_iscsi_ctl(struct adapter *adapter, unsigned int req,
uiip->llimit = t3_read_reg(adapter, A_ULPRX_ISCSI_LLIMIT);
uiip->ulimit = t3_read_reg(adapter, A_ULPRX_ISCSI_ULIMIT);
uiip->tagmask = t3_read_reg(adapter, A_ULPRX_ISCSI_TAGMASK);

val = t3_read_reg(adapter, A_ULPRX_ISCSI_PSZ);
for (i = 0; i < 4; i++, val >>= 8)
uiip->pgsz_factor[i] = val & 0xFF;

val = t3_read_reg(adapter, A_TP_PARA_REG7);
uiip->max_txsz =
uiip->max_rxsz = min((val >> S_PMMAXXFERLEN0)&M_PMMAXXFERLEN0,
(val >> S_PMMAXXFERLEN1)&M_PMMAXXFERLEN1);
/*
* On tx, the iscsi pdu has to be <= tx page size and has to
* fit into the Tx PM FIFO.
*/
val = min(adapter->params.tp.tx_pg_size,
t3_read_reg(adapter, A_PM1_TX_CFG) >> 17);
uiip->max_txsz = min(val, uiip->max_txsz);

/* set MaxRxData to 16224 */
val = t3_read_reg(adapter, A_TP_PARA_REG2);
if ((val >> S_MAXRXDATA) != 0x3f60) {
val &= (M_RXCOALESCESIZE << S_RXCOALESCESIZE);
val |= V_MAXRXDATA(0x3f60);
printk(KERN_INFO
"%s, iscsi set MaxRxData to 16224 (0x%x).\n",
adapter->name, val);
t3_write_reg(adapter, A_TP_PARA_REG2, val);
}

/*
* on rx, the iscsi pdu has to be < rx page size and the
* the max rx data length programmed in TP
*/
val = min(adapter->params.tp.rx_pg_size,
((t3_read_reg(adapter, A_TP_PARA_REG2)) >>
S_MAXRXDATA) & M_MAXRXDATA);
uiip->max_rxsz = min(val, uiip->max_rxsz);
uiip->max_txsz = min(adapter->params.tp.tx_pg_size,
t3_read_reg(adapter, A_PM1_TX_CFG) >> 17);
/* on rx, the iscsi pdu has to be < rx page size and the
whole pdu + cpl headers has to fit into one sge buffer */
uiip->max_rxsz = min_t(unsigned int,
adapter->params.tp.rx_pg_size,
(adapter->sge.qs[0].fl[1].buf_size -
sizeof(struct cpl_rx_data) * 2 -
sizeof(struct cpl_rx_data_ddp)));
break;
case ULP_ISCSI_SET_PARAMS:
t3_write_reg(adapter, A_ULPRX_ISCSI_TAGMASK, uiip->tagmask);
/* set MaxRxData and MaxCoalesceSize to 16224 */
t3_write_reg(adapter, A_TP_PARA_REG2, 0x3f603f60);
/* program the ddp page sizes */
for (i = 0; i < 4; i++)
val |= (uiip->pgsz_factor[i] & 0xF) << (8 * i);
if (val && (val != t3_read_reg(adapter, A_ULPRX_ISCSI_PSZ))) {
printk(KERN_INFO
"%s, setting iscsi pgsz 0x%x, %u,%u,%u,%u.\n",
adapter->name, val, uiip->pgsz_factor[0],
uiip->pgsz_factor[1], uiip->pgsz_factor[2],
uiip->pgsz_factor[3]);
t3_write_reg(adapter, A_ULPRX_ISCSI_PSZ, val);
{
int i;
unsigned int val = 0;
for (i = 0; i < 4; i++)
val |= (uiip->pgsz_factor[i] & 0xF) << (8 * i);
if (val)
t3_write_reg(adapter, A_ULPRX_ISCSI_PSZ, val);
}
break;
default:
Expand Down Expand Up @@ -432,12 +407,6 @@ static int cxgb_offload_ctl(struct t3cdev *tdev, unsigned int req, void *data)
rx_page_info->page_size = tp->rx_pg_size;
rx_page_info->num = tp->rx_num_pgs;
break;
case GET_ISCSI_IPV4ADDR: {
struct iscsi_ipv4addr *p = data;
struct port_info *pi = netdev_priv(p->dev);
p->ipv4addr = pi->iscsi_ipv4addr;
break;
}
default:
return -EOPNOTSUPP;
}
Expand Down
67 changes: 3 additions & 64 deletions trunk/drivers/net/cxgb3/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/dma-mapping.h>
#include <net/arp.h>
#include "common.h"
#include "regs.h"
#include "sge_defs.h"
Expand Down Expand Up @@ -1863,54 +1862,6 @@ static void restart_tx(struct sge_qset *qs)
}
}

/**
* cxgb3_arp_process - process an ARP request probing a private IP address
* @adapter: the adapter
* @skb: the skbuff containing the ARP request
*
* Check if the ARP request is probing the private IP address
* dedicated to iSCSI, generate an ARP reply if so.
*/
static void cxgb3_arp_process(struct adapter *adapter, struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
struct port_info *pi;
struct arphdr *arp;
unsigned char *arp_ptr;
unsigned char *sha;
__be32 sip, tip;

if (!dev)
return;

skb_reset_network_header(skb);
arp = arp_hdr(skb);

if (arp->ar_op != htons(ARPOP_REQUEST))
return;

arp_ptr = (unsigned char *)(arp + 1);
sha = arp_ptr;
arp_ptr += dev->addr_len;
memcpy(&sip, arp_ptr, sizeof(sip));
arp_ptr += sizeof(sip);
arp_ptr += dev->addr_len;
memcpy(&tip, arp_ptr, sizeof(tip));

pi = netdev_priv(dev);
if (tip != pi->iscsi_ipv4addr)
return;

arp_send(ARPOP_REPLY, ETH_P_ARP, sip, dev, tip, sha,
dev->dev_addr, sha);

}

static inline int is_arp(struct sk_buff *skb)
{
return skb->protocol == htons(ETH_P_ARP);
}

/**
* rx_eth - process an ingress ethernet packet
* @adap: the adapter
Expand All @@ -1934,7 +1885,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
pi = netdev_priv(skb->dev);
if (pi->rx_csum_offload && p->csum_valid && p->csum == htons(0xffff) &&
!p->fragment) {
qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
rspq_to_qset(rq)->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++;
skb->ip_summed = CHECKSUM_UNNECESSARY;
} else
skb->ip_summed = CHECKSUM_NONE;
Expand All @@ -1949,28 +1900,16 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
grp,
ntohs(p->vlan),
p);
else {
if (unlikely(pi->iscsi_ipv4addr &&
is_arp(skb))) {
unsigned short vtag = ntohs(p->vlan) &
VLAN_VID_MASK;
skb->dev = vlan_group_get_device(grp,
vtag);
cxgb3_arp_process(adap, skb);
}
else
__vlan_hwaccel_rx(skb, grp, ntohs(p->vlan),
rq->polling);
}
else
dev_kfree_skb_any(skb);
} else if (rq->polling) {
if (lro)
lro_receive_skb(&qs->lro_mgr, skb, p);
else {
if (unlikely(pi->iscsi_ipv4addr && is_arp(skb)))
cxgb3_arp_process(adap, skb);
else
netif_receive_skb(skb);
}
} else
netif_rx(skb);
}
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/net/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ struct channel {
*/
static DEFINE_MUTEX(all_ppp_mutex);
static atomic_t ppp_unit_count = ATOMIC_INIT(0);
static DEFINE_IDR(ppp_units_idr);
static struct idr ppp_units_idr;

/*
* all_channels_lock protects all_channels and last_channel_index,
Expand Down Expand Up @@ -852,6 +852,8 @@ static int __init ppp_init(void)
"ppp");
}

idr_init(&ppp_units_idr);

out:
if (err)
printk(KERN_ERR "failed to register PPP device (%d)\n", err);
Expand Down Expand Up @@ -2433,7 +2435,7 @@ ppp_create_interface(int unit, int *retp)
if (unit_find(&ppp_units_idr, unit))
goto out2; /* unit already exists */
else {
/* darn, someone is cheating us? */
/* darn, someone is cheatting us? */
*retp = -EINVAL;
goto out2;
}
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/usb/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,10 @@ static int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
static void asix_async_cmd_callback(struct urb *urb)
{
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
int status = urb->status;

if (status < 0)
if (urb->status < 0)
printk(KERN_DEBUG "asix_async_cmd_callback() failed with %d",
status);
urb->status);

kfree(req);
usb_free_urb(urb);
Expand Down
41 changes: 19 additions & 22 deletions trunk/drivers/net/usb/catc.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,14 @@ static void catc_rx_done(struct urb *urb)
u8 *pkt_start = urb->transfer_buffer;
struct sk_buff *skb;
int pkt_len, pkt_offset = 0;
int status = urb->status;

if (!catc->is_f5u011) {
clear_bit(RX_RUNNING, &catc->flags);
pkt_offset = 2;
}

if (status) {
dbg("rx_done, status %d, length %d", status, urb->actual_length);
if (urb->status) {
dbg("rx_done, status %d, length %d", urb->status, urb->actual_length);
return;
}

Expand Down Expand Up @@ -274,12 +273,12 @@ static void catc_rx_done(struct urb *urb)

if (catc->is_f5u011) {
if (atomic_read(&catc->recq_sz)) {
int state;
int status;
atomic_dec(&catc->recq_sz);
dbg("getting extra packet");
urb->dev = catc->usbdev;
if ((state = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
dbg("submit(rx_urb) status %d", state);
if ((status = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
dbg("submit(rx_urb) status %d", status);
}
} else {
clear_bit(RX_RUNNING, &catc->flags);
Expand All @@ -291,9 +290,8 @@ static void catc_irq_done(struct urb *urb)
{
struct catc *catc = urb->context;
u8 *data = urb->transfer_buffer;
int status = urb->status;
int status;
unsigned int hasdata = 0, linksts = LinkNoChange;
int res;

if (!catc->is_f5u011) {
hasdata = data[1] & 0x80;
Expand All @@ -309,7 +307,7 @@ static void catc_irq_done(struct urb *urb)
linksts = LinkBad;
}

switch (status) {
switch (urb->status) {
case 0: /* success */
break;
case -ECONNRESET: /* unlink */
Expand All @@ -318,7 +316,7 @@ static void catc_irq_done(struct urb *urb)
return;
/* -EPIPE: should clear the halt */
default: /* error */
dbg("irq_done, status %d, data %02x %02x.", status, data[0], data[1]);
dbg("irq_done, status %d, data %02x %02x.", urb->status, data[0], data[1]);
goto resubmit;
}

Expand All @@ -338,17 +336,17 @@ static void catc_irq_done(struct urb *urb)
atomic_inc(&catc->recq_sz);
} else {
catc->rx_urb->dev = catc->usbdev;
if ((res = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) {
err("submit(rx_urb) status %d", res);
if ((status = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) {
err("submit(rx_urb) status %d", status);
}
}
}
resubmit:
res = usb_submit_urb (urb, GFP_ATOMIC);
if (res)
status = usb_submit_urb (urb, GFP_ATOMIC);
if (status)
err ("can't resubmit intr, %s-%s, status %d",
catc->usbdev->bus->bus_name,
catc->usbdev->devpath, res);
catc->usbdev->devpath, status);
}

/*
Expand Down Expand Up @@ -380,9 +378,9 @@ static void catc_tx_done(struct urb *urb)
{
struct catc *catc = urb->context;
unsigned long flags;
int r, status = urb->status;
int r;

if (status == -ECONNRESET) {
if (urb->status == -ECONNRESET) {
dbg("Tx Reset.");
urb->status = 0;
catc->netdev->trans_start = jiffies;
Expand All @@ -392,8 +390,8 @@ static void catc_tx_done(struct urb *urb)
return;
}

if (status) {
dbg("tx_done, status %d, length %d", status, urb->actual_length);
if (urb->status) {
dbg("tx_done, status %d, length %d", urb->status, urb->actual_length);
return;
}

Expand Down Expand Up @@ -504,10 +502,9 @@ static void catc_ctrl_done(struct urb *urb)
struct catc *catc = urb->context;
struct ctrl_queue *q;
unsigned long flags;
int status = urb->status;

if (status)
dbg("ctrl_done, status %d, len %d.", status, urb->actual_length);
if (urb->status)
dbg("ctrl_done, status %d, len %d.", urb->status, urb->actual_length);

spin_lock_irqsave(&catc->ctrl_lock, flags);

Expand Down
Loading

0 comments on commit 179f381

Please sign in to comment.