Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19273
b: refs/heads/master
c: ade2bfe
h: refs/heads/master
i:
  19271: 149f46c
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Jan 24, 2006
1 parent 079ac95 commit 49c1daf
Show file tree
Hide file tree
Showing 4 changed files with 440 additions and 419 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: dda1e390bf9e2889a3abc48590a015b307637753
refs/heads/master: ade2bfe7d1f0ea804d2e63209cc6318ad8bf17ae
12 changes: 5 additions & 7 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ bnx2_rx_int(struct bnx2 *bp, int budget)
rmb();
while (sw_cons != hw_cons) {
unsigned int len;
u16 status;
u32 status;
struct sw_bd *rx_buf;
struct sk_buff *skb;

Expand All @@ -1676,7 +1676,7 @@ bnx2_rx_int(struct bnx2 *bp, int budget)
rx_hdr = (struct l2_fhdr *) skb->data;
len = rx_hdr->l2_fhdr_pkt_len - 4;

if (rx_hdr->l2_fhdr_errors &
if ((status = rx_hdr->l2_fhdr_status) &
(L2_FHDR_ERRORS_BAD_CRC |
L2_FHDR_ERRORS_PHY_DECODE |
L2_FHDR_ERRORS_ALIGNMENT |
Expand Down Expand Up @@ -1735,15 +1735,13 @@ bnx2_rx_int(struct bnx2 *bp, int budget)

}

status = rx_hdr->l2_fhdr_status;
skb->ip_summed = CHECKSUM_NONE;
if (bp->rx_csum &&
(status & (L2_FHDR_STATUS_TCP_SEGMENT |
L2_FHDR_STATUS_UDP_DATAGRAM))) {

u16 cksum = rx_hdr->l2_fhdr_tcp_udp_xsum;

if (cksum == 0xffff)
if (likely((status & (L2_FHDR_ERRORS_TCP_XSUM |
L2_FHDR_ERRORS_UDP_XSUM)) == 0))
skb->ip_summed = CHECKSUM_UNNECESSARY;
}

Expand Down Expand Up @@ -3978,7 +3976,7 @@ bnx2_test_loopback(struct bnx2 *bp)
pci_unmap_addr(rx_buf, mapping),
bp->rx_buf_size, PCI_DMA_FROMDEVICE);

if (rx_hdr->l2_fhdr_errors &
if (rx_hdr->l2_fhdr_status &
(L2_FHDR_ERRORS_BAD_CRC |
L2_FHDR_ERRORS_PHY_DECODE |
L2_FHDR_ERRORS_ALIGNMENT |
Expand Down
22 changes: 9 additions & 13 deletions trunk/drivers/net/bnx2.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,19 +277,7 @@ struct statistics_block {
* l2_fhdr definition
*/
struct l2_fhdr {
#if defined(__BIG_ENDIAN)
u16 l2_fhdr_errors;
u16 l2_fhdr_status;
#elif defined(__LITTLE_ENDIAN)
u16 l2_fhdr_status;
u16 l2_fhdr_errors;
#endif
#define L2_FHDR_ERRORS_BAD_CRC (1<<1)
#define L2_FHDR_ERRORS_PHY_DECODE (1<<2)
#define L2_FHDR_ERRORS_ALIGNMENT (1<<3)
#define L2_FHDR_ERRORS_TOO_SHORT (1<<4)
#define L2_FHDR_ERRORS_GIANT_FRAME (1<<5)

u32 l2_fhdr_status;
#define L2_FHDR_STATUS_RULE_CLASS (0x7<<0)
#define L2_FHDR_STATUS_RULE_P2 (1<<3)
#define L2_FHDR_STATUS_RULE_P3 (1<<4)
Expand All @@ -301,6 +289,14 @@ struct l2_fhdr {
#define L2_FHDR_STATUS_TCP_SEGMENT (1<<14)
#define L2_FHDR_STATUS_UDP_DATAGRAM (1<<15)

#define L2_FHDR_ERRORS_BAD_CRC (1<<17)
#define L2_FHDR_ERRORS_PHY_DECODE (1<<18)
#define L2_FHDR_ERRORS_ALIGNMENT (1<<19)
#define L2_FHDR_ERRORS_TOO_SHORT (1<<20)
#define L2_FHDR_ERRORS_GIANT_FRAME (1<<21)
#define L2_FHDR_ERRORS_TCP_XSUM (1<<28)
#define L2_FHDR_ERRORS_UDP_XSUM (1<<31)

u32 l2_fhdr_hash;
#if defined(__BIG_ENDIAN)
u16 l2_fhdr_pkt_len;
Expand Down
Loading

0 comments on commit 49c1daf

Please sign in to comment.