Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340474
b: refs/heads/master
c: 5a85d71
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Oct 23, 2012
1 parent 1322c52 commit e43bcd8
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 30 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: 1b3d2d77af39cb928d6ca738cb612a0b40e02857
refs/heads/master: 5a85d716ab69035138cc49b5a71686343abc950b
7 changes: 4 additions & 3 deletions trunk/drivers/net/ethernet/emulex/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,7 @@ int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
int offset)
{
struct be_mcc_wrb *wrb;
struct be_cmd_write_flashrom *req;
struct be_cmd_read_flash_crc *req;
int status;

spin_lock_bh(&adapter->mcc_lock);
Expand All @@ -2173,7 +2173,8 @@ int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
req = embedded_payload(wrb);

be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_READ_FLASHROM, sizeof(*req)+4, wrb, NULL);
OPCODE_COMMON_READ_FLASHROM, sizeof(*req),
wrb, NULL);

req->params.op_type = cpu_to_le32(OPTYPE_REDBOOT);
req->params.op_code = cpu_to_le32(FLASHROM_OPER_REPORT);
Expand All @@ -2182,7 +2183,7 @@ int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,

status = be_mcc_notify_wait(adapter);
if (!status)
memcpy(flashed_crc, req->params.data_buf, 4);
memcpy(flashed_crc, req->crc, 4);

err:
spin_unlock_bh(&adapter->mcc_lock);
Expand Down
12 changes: 10 additions & 2 deletions trunk/drivers/net/ethernet/emulex/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -1156,14 +1156,22 @@ struct flashrom_params {
u32 op_type;
u32 data_buf_size;
u32 offset;
u8 data_buf[4];
};

struct be_cmd_write_flashrom {
struct be_cmd_req_hdr hdr;
struct flashrom_params params;
};
u8 data_buf[32768];
u8 rsvd[4];
} __packed;

/* cmd to read flash crc */
struct be_cmd_read_flash_crc {
struct be_cmd_req_hdr hdr;
struct flashrom_params params;
u8 crc[4];
u8 rsvd[4];
};
/**************** Lancer Firmware Flash ************/
struct amap_lancer_write_obj_context {
u8 write_length[24];
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3114,7 +3114,7 @@ static int be_flash(struct be_adapter *adapter, const u8 *img,
flash_op = FLASHROM_OPER_SAVE;
}

memcpy(req->params.data_buf, img, num_bytes);
memcpy(req->data_buf, img, num_bytes);
img += num_bytes;
status = be_cmd_write_flashrom(adapter, flash_cmd, optype,
flash_op, num_bytes);
Expand Down Expand Up @@ -3471,7 +3471,7 @@ static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
const u8 *p;
int status = 0, i = 0, num_imgs = 0, ufi_type = 0;

flash_cmd.size = sizeof(struct be_cmd_write_flashrom) + 32*1024;
flash_cmd.size = sizeof(struct be_cmd_write_flashrom);
flash_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, flash_cmd.size,
&flash_cmd.dma, GFP_KERNEL);
if (!flash_cmd.va) {
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static rtnl_doit_func rtnl_get_doit(int protocol, int msgindex)
if (tab == NULL || tab[msgindex].doit == NULL)
tab = rtnl_msg_handlers[PF_UNSPEC];

return tab ? tab[msgindex].doit : NULL;
return tab[msgindex].doit;
}

static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
Expand All @@ -143,7 +143,7 @@ static rtnl_dumpit_func rtnl_get_dumpit(int protocol, int msgindex)
if (tab == NULL || tab[msgindex].dumpit == NULL)
tab = rtnl_msg_handlers[PF_UNSPEC];

return tab ? tab[msgindex].dumpit : NULL;
return tab[msgindex].dumpit;
}

static rtnl_calcit_func rtnl_get_calcit(int protocol, int msgindex)
Expand All @@ -158,7 +158,7 @@ static rtnl_calcit_func rtnl_get_calcit(int protocol, int msgindex)
if (tab == NULL || tab[msgindex].calcit == NULL)
tab = rtnl_msg_handlers[PF_UNSPEC];

return tab ? tab[msgindex].calcit : NULL;
return tab[msgindex].calcit;
}

/**
Expand Down
7 changes: 3 additions & 4 deletions trunk/net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1918,24 +1918,23 @@ EXPORT_SYMBOL(tcp_v4_do_rcv);

void tcp_v4_early_demux(struct sk_buff *skb)
{
struct net *net = dev_net(skb->dev);
const struct iphdr *iph;
const struct tcphdr *th;
struct sock *sk;

if (skb->pkt_type != PACKET_HOST)
return;

if (!pskb_may_pull(skb, ip_hdrlen(skb) + sizeof(struct tcphdr)))
if (!pskb_may_pull(skb, skb_transport_offset(skb) + sizeof(struct tcphdr)))
return;

iph = ip_hdr(skb);
th = (struct tcphdr *) ((char *)iph + ip_hdrlen(skb));
th = tcp_hdr(skb);

if (th->doff < sizeof(struct tcphdr) / 4)
return;

sk = __inet_lookup_established(net, &tcp_hashinfo,
sk = __inet_lookup_established(dev_net(skb->dev), &tcp_hashinfo,
iph->saddr, th->source,
iph->daddr, ntohs(th->dest),
skb->skb_iif);
Expand Down
26 changes: 13 additions & 13 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,32 +397,32 @@ static int rt6_info_hash_nhsfn(unsigned int candidate_count,
{
unsigned int val = fl6->flowi6_proto;

val ^= fl6->daddr.s6_addr32[0];
val ^= fl6->daddr.s6_addr32[1];
val ^= fl6->daddr.s6_addr32[2];
val ^= fl6->daddr.s6_addr32[3];
val ^= (__force u32)fl6->daddr.s6_addr32[0];
val ^= (__force u32)fl6->daddr.s6_addr32[1];
val ^= (__force u32)fl6->daddr.s6_addr32[2];
val ^= (__force u32)fl6->daddr.s6_addr32[3];

val ^= fl6->saddr.s6_addr32[0];
val ^= fl6->saddr.s6_addr32[1];
val ^= fl6->saddr.s6_addr32[2];
val ^= fl6->saddr.s6_addr32[3];
val ^= (__force u32)fl6->saddr.s6_addr32[0];
val ^= (__force u32)fl6->saddr.s6_addr32[1];
val ^= (__force u32)fl6->saddr.s6_addr32[2];
val ^= (__force u32)fl6->saddr.s6_addr32[3];

/* Work only if this not encapsulated */
switch (fl6->flowi6_proto) {
case IPPROTO_UDP:
case IPPROTO_TCP:
case IPPROTO_SCTP:
val ^= fl6->fl6_sport;
val ^= fl6->fl6_dport;
val ^= (__force u16)fl6->fl6_sport;
val ^= (__force u16)fl6->fl6_dport;
break;

case IPPROTO_ICMPV6:
val ^= fl6->fl6_icmp_type;
val ^= fl6->fl6_icmp_code;
val ^= (__force u16)fl6->fl6_icmp_type;
val ^= (__force u16)fl6->fl6_icmp_code;
break;
}
/* RFC6438 recommands to use flowlabel */
val ^= fl6->flowlabel;
val ^= (__force u32)fl6->flowlabel;

/* Perhaps, we need to tune, this function? */
val = val ^ (val >> 7) ^ (val >> 12);
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -1741,11 +1741,11 @@ static void tcp_v6_early_demux(struct sk_buff *skb)
skb->destructor = sock_edemux;
if (sk->sk_state != TCP_TIME_WAIT) {
struct dst_entry *dst = sk->sk_rx_dst;
struct inet_sock *icsk = inet_sk(sk);

if (dst)
dst = dst_check(dst, inet6_sk(sk)->rx_dst_cookie);
if (dst &&
icsk->rx_dst_ifindex == skb->skb_iif)
inet_sk(sk)->rx_dst_ifindex == skb->skb_iif)
skb_dst_set_noref(skb, dst);
}
}
Expand Down

0 comments on commit e43bcd8

Please sign in to comment.