diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index fbc2553275dc..a8f63c47b3cd 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h @@ -65,8 +65,8 @@ #define _NETXEN_NIC_LINUX_MAJOR 3 #define _NETXEN_NIC_LINUX_MINOR 4 -#define _NETXEN_NIC_LINUX_SUBVERSION 2 -#define NETXEN_NIC_LINUX_VERSIONID "3.4.2" +#define _NETXEN_NIC_LINUX_SUBVERSION 18 +#define NETXEN_NIC_LINUX_VERSIONID "3.4.18" #define NETXEN_NUM_FLASH_SECTORS (64) #define NETXEN_FLASH_SECTOR_SIZE (64 * 1024) @@ -309,23 +309,26 @@ struct netxen_ring_ctx { ((cmd_desc)->port_ctxid |= ((var) & 0xF0)) #define netxen_set_cmd_desc_flags(cmd_desc, val) \ - ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \ - (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f)) + (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ + ~cpu_to_le16(0x7f)) | cpu_to_le16((val) & 0x7f) #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ - ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \ - (cmd_desc)->flags_opcode |= cpu_to_le16(((val & 0x3f)<<7))) + (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ + ~cpu_to_le16((u16)0x3f << 7)) | cpu_to_le16(((val) & 0x3f) << 7) #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ - ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \ - (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff)) + (cmd_desc)->num_of_buffers_total_length = \ + ((cmd_desc)->num_of_buffers_total_length & \ + ~cpu_to_le32(0xff)) | cpu_to_le32((val) & 0xff) #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ - ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xffffff00), \ - (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 8)) + (cmd_desc)->num_of_buffers_total_length = \ + ((cmd_desc)->num_of_buffers_total_length & \ + ~cpu_to_le32((u32)0xffffff << 8)) | \ + cpu_to_le32(((val) & 0xffffff) << 8) #define netxen_get_cmd_desc_opcode(cmd_desc) \ - ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F) + ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003f) #define netxen_get_cmd_desc_totallength(cmd_desc) \ - (le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) + ((le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) & 0xffffff) struct cmd_desc_type0 { u8 tcp_hdr_offset; /* For LSO only */ @@ -412,29 +415,29 @@ struct rcv_desc { #define netxen_get_sts_desc_lro_last_frag(status_desc) \ (((status_desc)->lro & 0x80) >> 7) -#define netxen_get_sts_port(status_desc) \ - (le64_to_cpu((status_desc)->status_desc_data) & 0x0F) -#define netxen_get_sts_status(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 4) & 0x0F) -#define netxen_get_sts_type(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 8) & 0x0F) -#define netxen_get_sts_totallength(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 12) & 0xFFFF) -#define netxen_get_sts_refhandle(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 28) & 0xFFFF) -#define netxen_get_sts_prot(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 44) & 0x0F) +#define netxen_get_sts_port(sts_data) \ + ((sts_data) & 0x0F) +#define netxen_get_sts_status(sts_data) \ + (((sts_data) >> 4) & 0x0F) +#define netxen_get_sts_type(sts_data) \ + (((sts_data) >> 8) & 0x0F) +#define netxen_get_sts_totallength(sts_data) \ + (((sts_data) >> 12) & 0xFFFF) +#define netxen_get_sts_refhandle(sts_data) \ + (((sts_data) >> 28) & 0xFFFF) +#define netxen_get_sts_prot(sts_data) \ + (((sts_data) >> 44) & 0x0F) +#define netxen_get_sts_opcode(sts_data) \ + (((sts_data) >> 58) & 0x03F) + #define netxen_get_sts_owner(status_desc) \ ((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03) -#define netxen_get_sts_opcode(status_desc) \ - ((le64_to_cpu((status_desc)->status_desc_data) >> 58) & 0x03F) - -#define netxen_clear_sts_owner(status_desc) \ - ((status_desc)->status_desc_data &= \ - ~cpu_to_le64(((unsigned long long)3) << 56 )) -#define netxen_set_sts_owner(status_desc, val) \ - ((status_desc)->status_desc_data |= \ - cpu_to_le64(((unsigned long long)((val) & 0x3)) << 56 )) +#define netxen_set_sts_owner(status_desc, val) { \ + (status_desc)->status_desc_data = \ + ((status_desc)->status_desc_data & \ + ~cpu_to_le64(0x3ULL << 56)) | \ + cpu_to_le64((u64)((val) & 0x3) << 56); \ +} struct status_desc { /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length |