Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (30 commits)
  X25: remove duplicated #include
  tcp: use correct net ns in cookie_v4_check()
  rps: tcp: fix rps_sock_flow_table table updates
  ppp_generic: fix multilink fragment sizes
  syncookies: remove Kconfig text line about disabled-by-default
  ixgbe: only check pfc bits in hang logic if pfc is enabled
  net: check for refcount if pop a stacked dst_entry
  ixgbe: return IXGBE_ERR_RAR_INDEX when out of range
  act_pedit: access skb->data safely
  sfc: Store port number in net_device::dev_id
  epic100: Test __BIG_ENDIAN instead of (non-existent) CONFIG_BIG_ENDIAN
  tehuti: return -EFAULT on copy_to_user errors
  isdn/kcapi: return -EFAULT on copy_from_user errors
  e1000e: change logical negate to bitwise
  sfc: Get port number from CS_PORT_NUM, not PCI function number
  cls_u32: use skb_header_pointer() to dereference data safely
  TCP: tcp_hybla: Fix integer overflow in slow start increment
  act_nat: fix the wrong checksum when addr isn't in old_addr/mask
  net/fec: fix pm to survive to suspend/resume
  korina: count RX DMA OVR as rx_fifo_error
  ...
  • Loading branch information
torvalds committed Jun 5, 2010
2 parents 7926e0b + ca73359 commit ed7dc1d
Show file tree
Hide file tree
Showing 31 changed files with 256 additions and 205 deletions.
6 changes: 3 additions & 3 deletions drivers/isdn/capi/kcapi.c
Expand Up @@ -1020,12 +1020,12 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data)
if (cmd == AVMB1_ADDCARD) {
if ((retval = copy_from_user(&cdef, data,
sizeof(avmb1_carddef))))
return retval;
return -EFAULT;
cdef.cardtype = AVM_CARDTYPE_B1;
} else {
if ((retval = copy_from_user(&cdef, data,
sizeof(avmb1_extcarddef))))
return retval;
return -EFAULT;
}
cparams.port = cdef.port;
cparams.irq = cdef.irq;
Expand Down Expand Up @@ -1218,7 +1218,7 @@ int capi20_manufacturer(unsigned int cmd, void __user *data)
kcapi_carddef cdef;

if ((retval = copy_from_user(&cdef, data, sizeof(cdef))))
return retval;
return -EFAULT;

cparams.port = cdef.port;
cparams.irq = cdef.irq;
Expand Down
14 changes: 13 additions & 1 deletion drivers/net/bnx2.c
Expand Up @@ -247,6 +247,7 @@ static const struct flash_spec flash_5709 = {
MODULE_DEVICE_TABLE(pci, bnx2_pci_tbl);

static void bnx2_init_napi(struct bnx2 *bp);
static void bnx2_del_napi(struct bnx2 *bp);

static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr)
{
Expand Down Expand Up @@ -6270,6 +6271,7 @@ bnx2_open(struct net_device *dev)
bnx2_free_skbs(bp);
bnx2_free_irq(bp);
bnx2_free_mem(bp);
bnx2_del_napi(bp);
return rc;
}

Expand Down Expand Up @@ -6537,6 +6539,7 @@ bnx2_close(struct net_device *dev)
bnx2_free_irq(bp);
bnx2_free_skbs(bp);
bnx2_free_mem(bp);
bnx2_del_napi(bp);
bp->link_up = 0;
netif_carrier_off(bp->dev);
bnx2_set_power_state(bp, PCI_D3hot);
Expand Down Expand Up @@ -8227,7 +8230,16 @@ bnx2_bus_string(struct bnx2 *bp, char *str)
return str;
}

static void __devinit
static void
bnx2_del_napi(struct bnx2 *bp)
{
int i;

for (i = 0; i < bp->irq_nvecs; i++)
netif_napi_del(&bp->bnx2_napi[i].napi);
}

static void
bnx2_init_napi(struct bnx2 *bp)
{
int i;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/e1000e/netdev.c
Expand Up @@ -2554,7 +2554,7 @@ static void e1000_init_manageability_pt(struct e1000_adapter *adapter)
mdef = er32(MDEF(i));

/* Ignore filters with anything other than IPMI ports */
if (mdef & !(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
if (mdef & ~(E1000_MDEF_PORT_623 | E1000_MDEF_PORT_664))
continue;

/* Enable this decision filter in MANC2H */
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/enic/enic.h
Expand Up @@ -74,7 +74,14 @@ struct enic_msix_entry {
void *devid;
};

#define ENIC_SET_APPLIED (1 << 0)
#define ENIC_SET_REQUEST (1 << 1)
#define ENIC_SET_NAME (1 << 2)
#define ENIC_SET_INSTANCE (1 << 3)
#define ENIC_SET_HOST (1 << 4)

struct enic_port_profile {
u32 set;
u8 request;
char name[PORT_PROFILE_MAX];
u8 instance_uuid[PORT_UUID_MAX];
Expand Down
200 changes: 97 additions & 103 deletions drivers/net/enic/enic_main.c
Expand Up @@ -1029,8 +1029,7 @@ static int enic_dev_init_done(struct enic *enic, int *done, int *error)
return err;
}

static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
char *name, u8 *instance_uuid, u8 *host_uuid)
static int enic_set_port_profile(struct enic *enic, u8 *mac)
{
struct vic_provinfo *vp;
u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
Expand All @@ -1040,97 +1039,112 @@ static int enic_set_port_profile(struct enic *enic, u8 request, u8 *mac,
"%02X%02X-%02X%02X%02X%02X%0X%02X";
int err;

if (!name)
return -EINVAL;
err = enic_vnic_dev_deinit(enic);
if (err)
return err;

if (!is_valid_ether_addr(mac))
return -EADDRNOTAVAIL;
switch (enic->pp.request) {

vp = vic_provinfo_alloc(GFP_KERNEL, oui, VIC_PROVINFO_LINUX_TYPE);
if (!vp)
return -ENOMEM;
case PORT_REQUEST_ASSOCIATE:

vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
strlen(name) + 1, name);

vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
ETH_ALEN, mac);

if (instance_uuid) {
uuid = instance_uuid;
sprintf(uuid_str, uuid_fmt,
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
sizeof(uuid_str), uuid_str);
}
if (!(enic->pp.set & ENIC_SET_NAME) || !strlen(enic->pp.name))
return -EINVAL;

if (host_uuid) {
uuid = host_uuid;
sprintf(uuid_str, uuid_fmt,
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_HOST_UUID_STR,
sizeof(uuid_str), uuid_str);
}
if (!is_valid_ether_addr(mac))
return -EADDRNOTAVAIL;

err = enic_vnic_dev_deinit(enic);
if (err)
goto err_out;
vp = vic_provinfo_alloc(GFP_KERNEL, oui,
VIC_PROVINFO_LINUX_TYPE);
if (!vp)
return -ENOMEM;

memset(&enic->pp, 0, sizeof(enic->pp));
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_PORT_PROFILE_NAME_STR,
strlen(enic->pp.name) + 1, enic->pp.name);

err = enic_dev_init_prov(enic, vp);
if (err)
goto err_out;
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_CLIENT_MAC_ADDR,
ETH_ALEN, mac);

if (enic->pp.set & ENIC_SET_INSTANCE) {
uuid = enic->pp.instance_uuid;
sprintf(uuid_str, uuid_fmt,
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_CLIENT_UUID_STR,
sizeof(uuid_str), uuid_str);
}

enic->pp.request = request;
memcpy(enic->pp.name, name, PORT_PROFILE_MAX);
if (instance_uuid)
memcpy(enic->pp.instance_uuid,
instance_uuid, PORT_UUID_MAX);
if (host_uuid)
memcpy(enic->pp.host_uuid,
host_uuid, PORT_UUID_MAX);
if (enic->pp.set & ENIC_SET_HOST) {
uuid = enic->pp.host_uuid;
sprintf(uuid_str, uuid_fmt,
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
vic_provinfo_add_tlv(vp,
VIC_LINUX_PROV_TLV_HOST_UUID_STR,
sizeof(uuid_str), uuid_str);
}

err_out:
vic_provinfo_free(vp);
err = enic_dev_init_prov(enic, vp);
vic_provinfo_free(vp);
if (err)
return err;
break;

return err;
}
case PORT_REQUEST_DISASSOCIATE:
break;

static int enic_unset_port_profile(struct enic *enic)
{
memset(&enic->pp, 0, sizeof(enic->pp));
return enic_vnic_dev_deinit(enic);
default:
return -EINVAL;
}

enic->pp.set |= ENIC_SET_APPLIED;
return 0;
}

static int enic_set_vf_port(struct net_device *netdev, int vf,
struct nlattr *port[])
{
struct enic *enic = netdev_priv(netdev);
char *name = NULL;
u8 *instance_uuid = NULL;
u8 *host_uuid = NULL;
u8 request = PORT_REQUEST_DISASSOCIATE;

memset(&enic->pp, 0, sizeof(enic->pp));

if (port[IFLA_PORT_REQUEST]) {
enic->pp.set |= ENIC_SET_REQUEST;
enic->pp.request = nla_get_u8(port[IFLA_PORT_REQUEST]);
}

if (port[IFLA_PORT_PROFILE]) {
enic->pp.set |= ENIC_SET_NAME;
memcpy(enic->pp.name, nla_data(port[IFLA_PORT_PROFILE]),
PORT_PROFILE_MAX);
}

if (port[IFLA_PORT_INSTANCE_UUID]) {
enic->pp.set |= ENIC_SET_INSTANCE;
memcpy(enic->pp.instance_uuid,
nla_data(port[IFLA_PORT_INSTANCE_UUID]), PORT_UUID_MAX);
}

if (port[IFLA_PORT_HOST_UUID]) {
enic->pp.set |= ENIC_SET_HOST;
memcpy(enic->pp.host_uuid,
nla_data(port[IFLA_PORT_HOST_UUID]), PORT_UUID_MAX);
}

/* don't support VFs, yet */
if (vf != PORT_SELF_VF)
return -EOPNOTSUPP;

if (port[IFLA_PORT_REQUEST])
request = nla_get_u8(port[IFLA_PORT_REQUEST]);
if (!(enic->pp.set & ENIC_SET_REQUEST))
return -EOPNOTSUPP;

switch (request) {
case PORT_REQUEST_ASSOCIATE:
if (enic->pp.request == PORT_REQUEST_ASSOCIATE) {

/* If the interface mac addr hasn't been assigned,
* assign a random mac addr before setting port-
Expand All @@ -1139,30 +1153,9 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,

if (is_zero_ether_addr(netdev->dev_addr))
random_ether_addr(netdev->dev_addr);

if (port[IFLA_PORT_PROFILE])
name = nla_data(port[IFLA_PORT_PROFILE]);

if (port[IFLA_PORT_INSTANCE_UUID])
instance_uuid =
nla_data(port[IFLA_PORT_INSTANCE_UUID]);

if (port[IFLA_PORT_HOST_UUID])
host_uuid = nla_data(port[IFLA_PORT_HOST_UUID]);

return enic_set_port_profile(enic, request,
netdev->dev_addr, name,
instance_uuid, host_uuid);

case PORT_REQUEST_DISASSOCIATE:

return enic_unset_port_profile(enic);

default:
break;
}

return -EOPNOTSUPP;
return enic_set_port_profile(enic, netdev->dev_addr);
}

static int enic_get_vf_port(struct net_device *netdev, int vf,
Expand All @@ -1172,14 +1165,12 @@ static int enic_get_vf_port(struct net_device *netdev, int vf,
int err, error, done;
u16 response = PORT_PROFILE_RESPONSE_SUCCESS;

/* don't support VFs, yet */
if (vf != PORT_SELF_VF)
return -EOPNOTSUPP;
if (!(enic->pp.set & ENIC_SET_APPLIED))
return -ENODATA;

err = enic_dev_init_done(enic, &done, &error);

if (err)
return err;
error = err;

switch (error) {
case ERR_SUCCESS:
Expand All @@ -1202,12 +1193,15 @@ static int enic_get_vf_port(struct net_device *netdev, int vf,

NLA_PUT_U16(skb, IFLA_PORT_REQUEST, enic->pp.request);
NLA_PUT_U16(skb, IFLA_PORT_RESPONSE, response);
NLA_PUT(skb, IFLA_PORT_PROFILE, PORT_PROFILE_MAX,
enic->pp.name);
NLA_PUT(skb, IFLA_PORT_INSTANCE_UUID, PORT_UUID_MAX,
enic->pp.instance_uuid);
NLA_PUT(skb, IFLA_PORT_HOST_UUID, PORT_UUID_MAX,
enic->pp.host_uuid);
if (enic->pp.set & ENIC_SET_NAME)
NLA_PUT(skb, IFLA_PORT_PROFILE, PORT_PROFILE_MAX,
enic->pp.name);
if (enic->pp.set & ENIC_SET_INSTANCE)
NLA_PUT(skb, IFLA_PORT_INSTANCE_UUID, PORT_UUID_MAX,
enic->pp.instance_uuid);
if (enic->pp.set & ENIC_SET_HOST)
NLA_PUT(skb, IFLA_PORT_HOST_UUID, PORT_UUID_MAX,
enic->pp.host_uuid);

return 0;

Expand Down
7 changes: 4 additions & 3 deletions drivers/net/epic100.c
Expand Up @@ -87,6 +87,7 @@ static int rx_copybreak;
#include <linux/bitops.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>

/* These identify the driver base version and may not be removed. */
static char version[] __devinitdata =
Expand Down Expand Up @@ -230,7 +231,7 @@ static const u16 media2miictl[16] = {
* The EPIC100 Rx and Tx buffer descriptors. Note that these
* really ARE host-endian; it's not a misannotation. We tell
* the card to byteswap them internally on big-endian hosts -
* look for #ifdef CONFIG_BIG_ENDIAN in epic_open().
* look for #ifdef __BIG_ENDIAN in epic_open().
*/

struct epic_tx_desc {
Expand Down Expand Up @@ -690,7 +691,7 @@ static int epic_open(struct net_device *dev)
outl((inl(ioaddr + NVCTL) & ~0x003C) | 0x4800, ioaddr + NVCTL);

/* Tell the chip to byteswap descriptors on big-endian hosts */
#ifdef CONFIG_BIG_ENDIAN
#ifdef __BIG_ENDIAN
outl(0x4432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
inl(ioaddr + GENCTL);
outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
Expand Down Expand Up @@ -806,7 +807,7 @@ static void epic_restart(struct net_device *dev)
for (i = 16; i > 0; i--)
outl(0x0008, ioaddr + TEST1);

#ifdef CONFIG_BIG_ENDIAN
#ifdef __BIG_ENDIAN
outl(0x0432 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
#else
outl(0x0412 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
Expand Down

0 comments on commit ed7dc1d

Please sign in to comment.