Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256613
b: refs/heads/master
c: 6d9e513
h: refs/heads/master
i:
  256611: 25270a0
v: v3
  • Loading branch information
Nicolas Schichan authored and Jeff Kirsher committed Jul 22, 2011
1 parent b245f45 commit 8e89ee5
Show file tree
Hide file tree
Showing 18 changed files with 72 additions and 167 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: e933d0198d399842f075c2c8af0f38630e7e4bee
refs/heads/master: 6d9e5130b96daa1656966f7271e8a0928b3906c4
15 changes: 0 additions & 15 deletions trunk/drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,21 +1523,6 @@ __u32 secure_ip_id(__be32 daddr)
return half_md4_transform(hash, keyptr->secret);
}

__u32 secure_ipv6_id(const __be32 daddr[4])
{
const struct keydata *keyptr;
__u32 hash[4];

keyptr = get_keyptr();

hash[0] = (__force __u32)daddr[0];
hash[1] = (__force __u32)daddr[1];
hash[2] = (__force __u32)daddr[2];
hash[3] = (__force __u32)daddr[3];

return half_md4_transform(hash, keyptr->secret);
}

#ifdef CONFIG_INET

__u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2390,7 +2390,7 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter)
}

/* Uses mbox */
int be_cmd_req_native_mode(struct be_adapter *adapter)
int be_cmd_check_native_mode(struct be_adapter *adapter)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_set_func_cap *req;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain);
extern void be_detect_dump_ue(struct be_adapter *adapter);
extern int be_cmd_get_die_temperature(struct be_adapter *adapter);
extern int be_cmd_get_cntl_attributes(struct be_adapter *adapter);
extern int be_cmd_req_native_mode(struct be_adapter *adapter);
extern int be_cmd_check_native_mode(struct be_adapter *adapter);
extern int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size);
extern void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf);

6 changes: 2 additions & 4 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2511,8 +2511,6 @@ static int be_setup(struct be_adapter *adapter)
int status;
u8 mac[ETH_ALEN];

be_cmd_req_native_mode(adapter);

cap_flags = en_flags = BE_IF_FLAGS_UNTAGGED |
BE_IF_FLAGS_BROADCAST |
BE_IF_FLAGS_MULTICAST;
Expand Down Expand Up @@ -2620,8 +2618,6 @@ static int be_clear(struct be_adapter *adapter)

be_cmd_if_destroy(adapter, adapter->if_handle, 0);

adapter->be3_native = 0;

/* tell fw we're done with firing cmds */
be_cmd_fw_clean(adapter);
return 0;
Expand Down Expand Up @@ -3219,6 +3215,8 @@ static int be_get_config(struct be_adapter *adapter)
if (status)
return status;

be_cmd_check_native_mode(adapter);

if ((num_vfs && adapter->sriov_enabled) ||
(adapter->function_mode & 0x400) ||
lancer_chip(adapter) || !be_physfn(adapter)) {
Expand Down
11 changes: 7 additions & 4 deletions trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2402,13 +2402,16 @@ bool e1000_has_link(struct e1000_adapter *adapter)
struct e1000_hw *hw = &adapter->hw;
bool link_active = false;

/* get_link_status is set on LSC (link status) interrupt or
* rx sequence error interrupt. get_link_status will stay
* false until the e1000_check_for_link establishes link
* for copper adapters ONLY
/* get_link_status is set on LSC (link status) interrupt or rx
* sequence error interrupt (except on intel ce4100).
* get_link_status will stay false until the
* e1000_check_for_link establishes link for copper adapters
* ONLY
*/
switch (hw->media_type) {
case e1000_media_type_copper:
if (hw->mac_type == e1000_ce4100)
hw->get_link_status = 1;
if (hw->get_link_status) {
e1000_check_for_link(hw);
link_active = !hw->get_link_status;
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@

#define _NETXEN_NIC_LINUX_MAJOR 4
#define _NETXEN_NIC_LINUX_MINOR 0
#define _NETXEN_NIC_LINUX_SUBVERSION 76
#define NETXEN_NIC_LINUX_VERSIONID "4.0.76"
#define _NETXEN_NIC_LINUX_SUBVERSION 75
#define NETXEN_NIC_LINUX_VERSIONID "4.0.75"

#define NETXEN_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c))
#define _major(v) (((v) >> 24) & 0xff)
Expand Down Expand Up @@ -1302,7 +1302,6 @@ int netxen_nic_wol_supported(struct netxen_adapter *adapter);
int netxen_init_dummy_dma(struct netxen_adapter *adapter);
void netxen_free_dummy_dma(struct netxen_adapter *adapter);

int netxen_check_flash_fw_compatibility(struct netxen_adapter *adapter);
int netxen_phantom_init(struct netxen_adapter *adapter, int pegtune_val);
int netxen_load_firmware(struct netxen_adapter *adapter);
int netxen_need_fw_reset(struct netxen_adapter *adapter);
Expand Down
72 changes: 11 additions & 61 deletions trunk/drivers/net/netxen/netxen_nic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,35 +964,6 @@ netxen_need_fw_reset(struct netxen_adapter *adapter)
return 0;
}

#define NETXEN_MIN_P3_FW_SUPP NETXEN_VERSION_CODE(4, 0, 505)

int
netxen_check_flash_fw_compatibility(struct netxen_adapter *adapter)
{
u32 flash_fw_ver, min_fw_ver;

if (NX_IS_REVISION_P2(adapter->ahw.revision_id))
return 0;

if (netxen_rom_fast_read(adapter,
NX_FW_VERSION_OFFSET, (int *)&flash_fw_ver)) {
dev_err(&adapter->pdev->dev, "Unable to read flash fw"
"version\n");
return -EIO;
}

flash_fw_ver = NETXEN_DECODE_VERSION(flash_fw_ver);
min_fw_ver = NETXEN_MIN_P3_FW_SUPP;
if (flash_fw_ver >= min_fw_ver)
return 0;

dev_info(&adapter->pdev->dev, "Flash fw[%d.%d.%d] is < min fw supported"
"[4.0.505]. Please update firmware on flash\n",
_major(flash_fw_ver), _minor(flash_fw_ver),
_build(flash_fw_ver));
return -EINVAL;
}

static char *fw_name[] = {
NX_P2_MN_ROMIMAGE_NAME,
NX_P3_CT_ROMIMAGE_NAME,
Expand Down Expand Up @@ -1100,12 +1071,10 @@ static int
netxen_validate_firmware(struct netxen_adapter *adapter)
{
__le32 val;
__le32 flash_fw_ver;
u32 file_fw_ver, min_ver, bios;
u32 ver, min_ver, bios;
struct pci_dev *pdev = adapter->pdev;
const struct firmware *fw = adapter->fw;
u8 fw_type = adapter->fw_type;
u32 crbinit_fix_fw;

if (fw_type == NX_UNIFIED_ROMIMAGE) {
if (netxen_nic_validate_unified_romimage(adapter))
Expand All @@ -1122,18 +1091,16 @@ netxen_validate_firmware(struct netxen_adapter *adapter)
val = nx_get_fw_version(adapter);

if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
min_ver = NETXEN_MIN_P3_FW_SUPP;
min_ver = NETXEN_VERSION_CODE(4, 0, 216);
else
min_ver = NETXEN_VERSION_CODE(3, 4, 216);

file_fw_ver = NETXEN_DECODE_VERSION(val);
ver = NETXEN_DECODE_VERSION(val);

if ((_major(file_fw_ver) > _NETXEN_NIC_LINUX_MAJOR) ||
(file_fw_ver < min_ver)) {
if ((_major(ver) > _NETXEN_NIC_LINUX_MAJOR) || (ver < min_ver)) {
dev_err(&pdev->dev,
"%s: firmware version %d.%d.%d unsupported\n",
fw_name[fw_type], _major(file_fw_ver), _minor(file_fw_ver),
_build(file_fw_ver));
fw_name[fw_type], _major(ver), _minor(ver), _build(ver));
return -EINVAL;
}

Expand All @@ -1145,32 +1112,15 @@ netxen_validate_firmware(struct netxen_adapter *adapter)
return -EINVAL;
}

/* check if flashed firmware is newer */
if (netxen_rom_fast_read(adapter,
NX_FW_VERSION_OFFSET, (int *)&flash_fw_ver)) {
dev_err(&pdev->dev, "Unable to read flash fw version\n");
NX_FW_VERSION_OFFSET, (int *)&val))
return -EIO;
}
flash_fw_ver = NETXEN_DECODE_VERSION(flash_fw_ver);

/* New fw from file is not allowed, if fw on flash is < 4.0.554 */
crbinit_fix_fw = NETXEN_VERSION_CODE(4, 0, 554);
if (file_fw_ver >= crbinit_fix_fw && flash_fw_ver < crbinit_fix_fw &&
NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
dev_err(&pdev->dev, "Incompatibility detected between driver "
"and firmware version on flash. This configuration "
"is not recommended. Please update the firmware on "
"flash immediately\n");
return -EINVAL;
}

/* check if flashed firmware is newer only for no-mn and P2 case*/
if (!netxen_p3_has_mn(adapter) ||
NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
if (flash_fw_ver > file_fw_ver) {
dev_info(&pdev->dev, "%s: firmware is older than flash\n",
val = NETXEN_DECODE_VERSION(val);
if (val > ver) {
dev_info(&pdev->dev, "%s: firmware is older than flash\n",
fw_name[fw_type]);
return -EINVAL;
}
return -EINVAL;
}

NXWR32(adapter, NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC);
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,10 +1388,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
break;
}

err = netxen_check_flash_fw_compatibility(adapter);
if (err)
goto err_out_iounmap;

if (adapter->portnum == 0) {
val = NXRD32(adapter, NX_CRB_DEV_REF_COUNT);
if (val != 0xffffffff && val != 0) {
Expand Down
10 changes: 9 additions & 1 deletion trunk/drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,14 @@ static void virtnet_netpoll(struct net_device *dev)
}
#endif

static void virtnet_free(struct net_device *dev)
{
struct virtnet_info *vi = netdev_priv(dev);

free_percpu(vi->stats);
free_netdev(dev);
}

static int virtnet_open(struct net_device *dev)
{
struct virtnet_info *vi = netdev_priv(dev);
Expand Down Expand Up @@ -951,6 +959,7 @@ static int virtnet_probe(struct virtio_device *vdev)
/* Set up network device as normal. */
dev->netdev_ops = &virtnet_netdev;
dev->features = NETIF_F_HIGHDMA;
dev->destructor = virtnet_free;

SET_ETHTOOL_OPS(dev, &virtnet_ethtool_ops);
SET_NETDEV_DEV(dev, &vdev->dev);
Expand Down Expand Up @@ -1113,7 +1122,6 @@ static void __devexit virtnet_remove(struct virtio_device *vdev)
while (vi->pages)
__free_pages(get_a_page(vi, GFP_KERNEL), 0);

free_percpu(vi->stats);
free_netdev(vi->dev);
}

Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/random.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ extern void get_random_bytes(void *buf, int nbytes);
void generate_random_uuid(unsigned char uuid_out[16]);

extern __u32 secure_ip_id(__be32 daddr);
extern __u32 secure_ipv6_id(const __be32 daddr[4]);
extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
__be16 dport);
Expand Down
13 changes: 3 additions & 10 deletions trunk/include/net/inetpeer.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static inline bool inet_metrics_new(const struct inet_peer *p)
}

/* can be called with or without local BH being disabled */
struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create);
struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create);

static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create)
{
Expand Down Expand Up @@ -106,18 +106,11 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)


/* can be called with or without local BH being disabled */
static inline int inet_getid(struct inet_peer *p, int more)
static inline __u16 inet_getid(struct inet_peer *p, int more)
{
int old, new;
more++;
inet_peer_refcheck(p);
do {
old = atomic_read(&p->ip_id_count);
new = old + more;
if (!new)
new = 1;
} while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
return new;
return atomic_add_return(more, &p->ip_id_count) - more;
}

#endif /* _NET_INETPEER_H */
12 changes: 11 additions & 1 deletion trunk/include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,17 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
}

extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
static __inline__ void ipv6_select_ident(struct frag_hdr *fhdr)
{
static u32 ipv6_fragmentation_id = 1;
static DEFINE_SPINLOCK(ip6_id_lock);

spin_lock_bh(&ip6_id_lock);
fhdr->identification = htonl(ipv6_fragmentation_id);
if (++ipv6_fragmentation_id == 0)
ipv6_fragmentation_id = 1;
spin_unlock_bh(&ip6_id_lock);
}

/*
* Prototypes exported by ipv6
Expand Down
7 changes: 2 additions & 5 deletions trunk/net/ipv4/inetpeer.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ static int inet_peer_gc(struct inet_peer_base *base,
return cnt;
}

struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create)
struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create)
{
struct inet_peer __rcu **stack[PEER_MAXDEPTH], ***stackptr;
struct inet_peer_base *base = family_to_base(daddr->family);
Expand Down Expand Up @@ -436,10 +436,7 @@ struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create)
p->daddr = *daddr;
atomic_set(&p->refcnt, 1);
atomic_set(&p->rid, 0);
atomic_set(&p->ip_id_count,
(daddr->family == AF_INET) ?
secure_ip_id(daddr->addr.a4) :
secure_ipv6_id(daddr->addr.a6));
atomic_set(&p->ip_id_count, secure_ip_id(daddr->addr.a4));
p->tcp_ts_stamp = 0;
p->metrics[RTAX_LOCK-1] = INETPEER_METRICS_NEW;
p->rate_tokens = 0;
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
int getfrag(void *from, char *to, int offset, int len,
int odd, struct sk_buff *skb),
void *from, int length, int hh_len, int fragheaderlen,
int transhdrlen, int maxfraglen, unsigned int flags)
int transhdrlen, int mtu, unsigned int flags)
{
struct sk_buff *skb;
int err;
Expand Down Expand Up @@ -767,7 +767,7 @@ static inline int ip_ufo_append_data(struct sock *sk,
skb->csum = 0;

/* specify the length of each IP datagram fragment */
skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen;
skb_shinfo(skb)->gso_size = mtu - fragheaderlen;
skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
__skb_queue_tail(queue, skb);
}
Expand Down Expand Up @@ -831,7 +831,7 @@ static int __ip_append_data(struct sock *sk,
(rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len) {
err = ip_ufo_append_data(sk, queue, getfrag, from, length,
hh_len, fragheaderlen, transhdrlen,
maxfraglen, flags);
mtu, flags);
if (err)
goto error;
return 0;
Expand Down
Loading

0 comments on commit 8e89ee5

Please sign in to comment.