diff options
-rw-r--r-- | drivers/net/bnx2x.h | 22 | ||||
-rw-r--r-- | drivers/net/bnx2x_hsi.h | 178 | ||||
-rw-r--r-- | drivers/net/bnx2x_main.c | 63 |
3 files changed, 132 insertions, 131 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index e07d91582cf2..bec5aff649a7 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -270,10 +270,10 @@ struct bnx2x_fastpath { | |||
270 | u16 tx_pkt_cons; | 270 | u16 tx_pkt_cons; |
271 | u16 tx_bd_prod; | 271 | u16 tx_bd_prod; |
272 | u16 tx_bd_cons; | 272 | u16 tx_bd_cons; |
273 | u16 *tx_cons_sb; | 273 | __le16 *tx_cons_sb; |
274 | 274 | ||
275 | u16 fp_c_idx; | 275 | __le16 fp_c_idx; |
276 | u16 fp_u_idx; | 276 | __le16 fp_u_idx; |
277 | 277 | ||
278 | u16 rx_bd_prod; | 278 | u16 rx_bd_prod; |
279 | u16 rx_bd_cons; | 279 | u16 rx_bd_cons; |
@@ -282,8 +282,8 @@ struct bnx2x_fastpath { | |||
282 | u16 rx_sge_prod; | 282 | u16 rx_sge_prod; |
283 | /* The last maximal completed SGE */ | 283 | /* The last maximal completed SGE */ |
284 | u16 last_max_sge; | 284 | u16 last_max_sge; |
285 | u16 *rx_cons_sb; | 285 | __le16 *rx_cons_sb; |
286 | u16 *rx_bd_cons_sb; | 286 | __le16 *rx_bd_cons_sb; |
287 | 287 | ||
288 | unsigned long tx_pkt, | 288 | unsigned long tx_pkt, |
289 | rx_pkt, | 289 | rx_pkt, |
@@ -806,11 +806,11 @@ struct bnx2x { | |||
806 | 806 | ||
807 | struct host_def_status_block *def_status_blk; | 807 | struct host_def_status_block *def_status_blk; |
808 | #define DEF_SB_ID 16 | 808 | #define DEF_SB_ID 16 |
809 | u16 def_c_idx; | 809 | __le16 def_c_idx; |
810 | u16 def_u_idx; | 810 | __le16 def_u_idx; |
811 | u16 def_x_idx; | 811 | __le16 def_x_idx; |
812 | u16 def_t_idx; | 812 | __le16 def_t_idx; |
813 | u16 def_att_idx; | 813 | __le16 def_att_idx; |
814 | u32 attn_state; | 814 | u32 attn_state; |
815 | struct attn_route attn_group[MAX_DYNAMIC_ATTN_GRPS]; | 815 | struct attn_route attn_group[MAX_DYNAMIC_ATTN_GRPS]; |
816 | 816 | ||
@@ -820,7 +820,7 @@ struct bnx2x { | |||
820 | u16 spq_prod_idx; | 820 | u16 spq_prod_idx; |
821 | struct eth_spe *spq_prod_bd; | 821 | struct eth_spe *spq_prod_bd; |
822 | struct eth_spe *spq_last_bd; | 822 | struct eth_spe *spq_last_bd; |
823 | u16 *dsb_sp_prod; | 823 | __le16 *dsb_sp_prod; |
824 | u16 spq_left; /* serialize spq */ | 824 | u16 spq_left; /* serialize spq */ |
825 | /* used to synchronize spq accesses */ | 825 | /* used to synchronize spq accesses */ |
826 | spinlock_t spq_lock; | 826 | spinlock_t spq_lock; |
diff --git a/drivers/net/bnx2x_hsi.h b/drivers/net/bnx2x_hsi.h index 88b2aa3180ed..c779999444c1 100644 --- a/drivers/net/bnx2x_hsi.h +++ b/drivers/net/bnx2x_hsi.h | |||
@@ -1201,12 +1201,12 @@ struct host_func_stats { | |||
1201 | * attention bits | 1201 | * attention bits |
1202 | */ | 1202 | */ |
1203 | struct atten_def_status_block { | 1203 | struct atten_def_status_block { |
1204 | u32 attn_bits; | 1204 | __le32 attn_bits; |
1205 | u32 attn_bits_ack; | 1205 | __le32 attn_bits_ack; |
1206 | u8 status_block_id; | 1206 | u8 status_block_id; |
1207 | u8 reserved0; | 1207 | u8 reserved0; |
1208 | u16 attn_bits_index; | 1208 | __le16 attn_bits_index; |
1209 | u32 reserved1; | 1209 | __le32 reserved1; |
1210 | }; | 1210 | }; |
1211 | 1211 | ||
1212 | 1212 | ||
@@ -1279,7 +1279,7 @@ struct igu_ack_register { | |||
1279 | * Parser parsing flags field | 1279 | * Parser parsing flags field |
1280 | */ | 1280 | */ |
1281 | struct parsing_flags { | 1281 | struct parsing_flags { |
1282 | u16 flags; | 1282 | __le16 flags; |
1283 | #define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0) | 1283 | #define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0) |
1284 | #define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0 | 1284 | #define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0 |
1285 | #define PARSING_FLAGS_VLAN (0x1<<1) | 1285 | #define PARSING_FLAGS_VLAN (0x1<<1) |
@@ -1310,8 +1310,8 @@ struct parsing_flags { | |||
1310 | 1310 | ||
1311 | 1311 | ||
1312 | struct regpair { | 1312 | struct regpair { |
1313 | u32 lo; | 1313 | __le32 lo; |
1314 | u32 hi; | 1314 | __le32 hi; |
1315 | }; | 1315 | }; |
1316 | 1316 | ||
1317 | 1317 | ||
@@ -1470,16 +1470,16 @@ struct ustorm_eth_st_context_config { | |||
1470 | * The eth Rx Buffer Descriptor | 1470 | * The eth Rx Buffer Descriptor |
1471 | */ | 1471 | */ |
1472 | struct eth_rx_bd { | 1472 | struct eth_rx_bd { |
1473 | u32 addr_lo; | 1473 | __le32 addr_lo; |
1474 | u32 addr_hi; | 1474 | __le32 addr_hi; |
1475 | }; | 1475 | }; |
1476 | 1476 | ||
1477 | /* | 1477 | /* |
1478 | * The eth Rx SGE Descriptor | 1478 | * The eth Rx SGE Descriptor |
1479 | */ | 1479 | */ |
1480 | struct eth_rx_sge { | 1480 | struct eth_rx_sge { |
1481 | u32 addr_lo; | 1481 | __le32 addr_lo; |
1482 | u32 addr_hi; | 1482 | __le32 addr_hi; |
1483 | }; | 1483 | }; |
1484 | 1484 | ||
1485 | /* | 1485 | /* |
@@ -1882,11 +1882,11 @@ struct eth_tx_bd_flags { | |||
1882 | * The eth Tx Buffer Descriptor | 1882 | * The eth Tx Buffer Descriptor |
1883 | */ | 1883 | */ |
1884 | struct eth_tx_bd { | 1884 | struct eth_tx_bd { |
1885 | u32 addr_lo; | 1885 | __le32 addr_lo; |
1886 | u32 addr_hi; | 1886 | __le32 addr_hi; |
1887 | u16 nbd; | 1887 | __le16 nbd; |
1888 | u16 nbytes; | 1888 | __le16 nbytes; |
1889 | u16 vlan; | 1889 | __le16 vlan; |
1890 | struct eth_tx_bd_flags bd_flags; | 1890 | struct eth_tx_bd_flags bd_flags; |
1891 | u8 general_data; | 1891 | u8 general_data; |
1892 | #define ETH_TX_BD_HDR_NBDS (0x3F<<0) | 1892 | #define ETH_TX_BD_HDR_NBDS (0x3F<<0) |
@@ -1929,11 +1929,11 @@ struct eth_tx_parse_bd { | |||
1929 | #define ETH_TX_PARSE_BD_CWR_FLG_SHIFT 7 | 1929 | #define ETH_TX_PARSE_BD_CWR_FLG_SHIFT 7 |
1930 | u8 ip_hlen; | 1930 | u8 ip_hlen; |
1931 | s8 cs_offset; | 1931 | s8 cs_offset; |
1932 | u16 total_hlen; | 1932 | __le16 total_hlen; |
1933 | u16 lso_mss; | 1933 | __le16 lso_mss; |
1934 | u16 tcp_pseudo_csum; | 1934 | __le16 tcp_pseudo_csum; |
1935 | u16 ip_id; | 1935 | __le16 ip_id; |
1936 | u32 tcp_send_seq; | 1936 | __le32 tcp_send_seq; |
1937 | }; | 1937 | }; |
1938 | 1938 | ||
1939 | /* | 1939 | /* |
@@ -2049,44 +2049,44 @@ struct eth_tx_doorbell { | |||
2049 | * ustorm status block | 2049 | * ustorm status block |
2050 | */ | 2050 | */ |
2051 | struct ustorm_def_status_block { | 2051 | struct ustorm_def_status_block { |
2052 | u16 index_values[HC_USTORM_DEF_SB_NUM_INDICES]; | 2052 | __le16 index_values[HC_USTORM_DEF_SB_NUM_INDICES]; |
2053 | u16 status_block_index; | 2053 | __le16 status_block_index; |
2054 | u8 func; | 2054 | u8 func; |
2055 | u8 status_block_id; | 2055 | u8 status_block_id; |
2056 | u32 __flags; | 2056 | __le32 __flags; |
2057 | }; | 2057 | }; |
2058 | 2058 | ||
2059 | /* | 2059 | /* |
2060 | * cstorm status block | 2060 | * cstorm status block |
2061 | */ | 2061 | */ |
2062 | struct cstorm_def_status_block { | 2062 | struct cstorm_def_status_block { |
2063 | u16 index_values[HC_CSTORM_DEF_SB_NUM_INDICES]; | 2063 | __le16 index_values[HC_CSTORM_DEF_SB_NUM_INDICES]; |
2064 | u16 status_block_index; | 2064 | __le16 status_block_index; |
2065 | u8 func; | 2065 | u8 func; |
2066 | u8 status_block_id; | 2066 | u8 status_block_id; |
2067 | u32 __flags; | 2067 | __le32 __flags; |
2068 | }; | 2068 | }; |
2069 | 2069 | ||
2070 | /* | 2070 | /* |
2071 | * xstorm status block | 2071 | * xstorm status block |
2072 | */ | 2072 | */ |
2073 | struct xstorm_def_status_block { | 2073 | struct xstorm_def_status_block { |
2074 | u16 index_values[HC_XSTORM_DEF_SB_NUM_INDICES]; | 2074 | __le16 index_values[HC_XSTORM_DEF_SB_NUM_INDICES]; |
2075 | u16 status_block_index; | 2075 | __le16 status_block_index; |
2076 | u8 func; | 2076 | u8 func; |
2077 | u8 status_block_id; | 2077 | u8 status_block_id; |
2078 | u32 __flags; | 2078 | __le32 __flags; |
2079 | }; | 2079 | }; |
2080 | 2080 | ||
2081 | /* | 2081 | /* |
2082 | * tstorm status block | 2082 | * tstorm status block |
2083 | */ | 2083 | */ |
2084 | struct tstorm_def_status_block { | 2084 | struct tstorm_def_status_block { |
2085 | u16 index_values[HC_TSTORM_DEF_SB_NUM_INDICES]; | 2085 | __le16 index_values[HC_TSTORM_DEF_SB_NUM_INDICES]; |
2086 | u16 status_block_index; | 2086 | __le16 status_block_index; |
2087 | u8 func; | 2087 | u8 func; |
2088 | u8 status_block_id; | 2088 | u8 status_block_id; |
2089 | u32 __flags; | 2089 | __le32 __flags; |
2090 | }; | 2090 | }; |
2091 | 2091 | ||
2092 | /* | 2092 | /* |
@@ -2105,22 +2105,22 @@ struct host_def_status_block { | |||
2105 | * ustorm status block | 2105 | * ustorm status block |
2106 | */ | 2106 | */ |
2107 | struct ustorm_status_block { | 2107 | struct ustorm_status_block { |
2108 | u16 index_values[HC_USTORM_SB_NUM_INDICES]; | 2108 | __le16 index_values[HC_USTORM_SB_NUM_INDICES]; |
2109 | u16 status_block_index; | 2109 | __le16 status_block_index; |
2110 | u8 func; | 2110 | u8 func; |
2111 | u8 status_block_id; | 2111 | u8 status_block_id; |
2112 | u32 __flags; | 2112 | __le32 __flags; |
2113 | }; | 2113 | }; |
2114 | 2114 | ||
2115 | /* | 2115 | /* |
2116 | * cstorm status block | 2116 | * cstorm status block |
2117 | */ | 2117 | */ |
2118 | struct cstorm_status_block { | 2118 | struct cstorm_status_block { |
2119 | u16 index_values[HC_CSTORM_SB_NUM_INDICES]; | 2119 | __le16 index_values[HC_CSTORM_SB_NUM_INDICES]; |
2120 | u16 status_block_index; | 2120 | __le16 status_block_index; |
2121 | u8 func; | 2121 | u8 func; |
2122 | u8 status_block_id; | 2122 | u8 status_block_id; |
2123 | u32 __flags; | 2123 | __le32 __flags; |
2124 | }; | 2124 | }; |
2125 | 2125 | ||
2126 | /* | 2126 | /* |
@@ -2186,12 +2186,12 @@ struct eth_fast_path_rx_cqe { | |||
2186 | #define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7 | 2186 | #define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7 |
2187 | u8 placement_offset; | 2187 | u8 placement_offset; |
2188 | u8 queue_index; | 2188 | u8 queue_index; |
2189 | u32 rss_hash_result; | 2189 | __le32 rss_hash_result; |
2190 | u16 vlan_tag; | 2190 | __le16 vlan_tag; |
2191 | u16 pkt_len; | 2191 | __le16 pkt_len; |
2192 | u16 len_on_bd; | 2192 | __le16 len_on_bd; |
2193 | struct parsing_flags pars_flags; | 2193 | struct parsing_flags pars_flags; |
2194 | u16 sgl[8]; | 2194 | __le16 sgl[8]; |
2195 | }; | 2195 | }; |
2196 | 2196 | ||
2197 | 2197 | ||
@@ -2225,8 +2225,8 @@ struct eth_query_ramrod_data { | |||
2225 | * Place holder for ramrods protocol specific data | 2225 | * Place holder for ramrods protocol specific data |
2226 | */ | 2226 | */ |
2227 | struct ramrod_data { | 2227 | struct ramrod_data { |
2228 | u32 data_lo; | 2228 | __le32 data_lo; |
2229 | u32 data_hi; | 2229 | __le32 data_hi; |
2230 | }; | 2230 | }; |
2231 | 2231 | ||
2232 | /* | 2232 | /* |
@@ -2257,23 +2257,23 @@ struct common_ramrod_eth_rx_cqe { | |||
2257 | #define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x7F<<1) | 2257 | #define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x7F<<1) |
2258 | #define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 1 | 2258 | #define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 1 |
2259 | u8 conn_type; | 2259 | u8 conn_type; |
2260 | u16 reserved1; | 2260 | __le16 reserved1; |
2261 | u32 conn_and_cmd_data; | 2261 | __le32 conn_and_cmd_data; |
2262 | #define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0) | 2262 | #define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0) |
2263 | #define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0 | 2263 | #define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0 |
2264 | #define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24) | 2264 | #define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24) |
2265 | #define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24 | 2265 | #define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24 |
2266 | struct ramrod_data protocol_data; | 2266 | struct ramrod_data protocol_data; |
2267 | u32 reserved2[4]; | 2267 | __le32 reserved2[4]; |
2268 | }; | 2268 | }; |
2269 | 2269 | ||
2270 | /* | 2270 | /* |
2271 | * Rx Last CQE in page (in ETH) | 2271 | * Rx Last CQE in page (in ETH) |
2272 | */ | 2272 | */ |
2273 | struct eth_rx_cqe_next_page { | 2273 | struct eth_rx_cqe_next_page { |
2274 | u32 addr_lo; | 2274 | __le32 addr_lo; |
2275 | u32 addr_hi; | 2275 | __le32 addr_hi; |
2276 | u32 reserved[6]; | 2276 | __le32 reserved[6]; |
2277 | }; | 2277 | }; |
2278 | 2278 | ||
2279 | /* | 2279 | /* |
@@ -2290,17 +2290,17 @@ union eth_rx_cqe { | |||
2290 | * common data for all protocols | 2290 | * common data for all protocols |
2291 | */ | 2291 | */ |
2292 | struct spe_hdr { | 2292 | struct spe_hdr { |
2293 | u32 conn_and_cmd_data; | 2293 | __le32 conn_and_cmd_data; |
2294 | #define SPE_HDR_CID (0xFFFFFF<<0) | 2294 | #define SPE_HDR_CID (0xFFFFFF<<0) |
2295 | #define SPE_HDR_CID_SHIFT 0 | 2295 | #define SPE_HDR_CID_SHIFT 0 |
2296 | #define SPE_HDR_CMD_ID (0xFF<<24) | 2296 | #define SPE_HDR_CMD_ID (0xFF<<24) |
2297 | #define SPE_HDR_CMD_ID_SHIFT 24 | 2297 | #define SPE_HDR_CMD_ID_SHIFT 24 |
2298 | u16 type; | 2298 | __le16 type; |
2299 | #define SPE_HDR_CONN_TYPE (0xFF<<0) | 2299 | #define SPE_HDR_CONN_TYPE (0xFF<<0) |
2300 | #define SPE_HDR_CONN_TYPE_SHIFT 0 | 2300 | #define SPE_HDR_CONN_TYPE_SHIFT 0 |
2301 | #define SPE_HDR_COMMON_RAMROD (0xFF<<8) | 2301 | #define SPE_HDR_COMMON_RAMROD (0xFF<<8) |
2302 | #define SPE_HDR_COMMON_RAMROD_SHIFT 8 | 2302 | #define SPE_HDR_COMMON_RAMROD_SHIFT 8 |
2303 | u16 reserved; | 2303 | __le16 reserved; |
2304 | }; | 2304 | }; |
2305 | 2305 | ||
2306 | /* | 2306 | /* |
@@ -2329,9 +2329,9 @@ struct eth_spe { | |||
2329 | * doorbell data in host memory | 2329 | * doorbell data in host memory |
2330 | */ | 2330 | */ |
2331 | struct eth_tx_db_data { | 2331 | struct eth_tx_db_data { |
2332 | u32 packets_prod; | 2332 | __le32 packets_prod; |
2333 | u16 bds_prod; | 2333 | __le16 bds_prod; |
2334 | u16 reserved; | 2334 | __le16 reserved; |
2335 | }; | 2335 | }; |
2336 | 2336 | ||
2337 | 2337 | ||
@@ -2410,10 +2410,10 @@ struct mac_configuration_hdr { | |||
2410 | * MAC address in list for ramrod | 2410 | * MAC address in list for ramrod |
2411 | */ | 2411 | */ |
2412 | struct tstorm_cam_entry { | 2412 | struct tstorm_cam_entry { |
2413 | u16 lsb_mac_addr; | 2413 | __le16 lsb_mac_addr; |
2414 | u16 middle_mac_addr; | 2414 | __le16 middle_mac_addr; |
2415 | u16 msb_mac_addr; | 2415 | __le16 msb_mac_addr; |
2416 | u16 flags; | 2416 | __le16 flags; |
2417 | #define TSTORM_CAM_ENTRY_PORT_ID (0x1<<0) | 2417 | #define TSTORM_CAM_ENTRY_PORT_ID (0x1<<0) |
2418 | #define TSTORM_CAM_ENTRY_PORT_ID_SHIFT 0 | 2418 | #define TSTORM_CAM_ENTRY_PORT_ID_SHIFT 0 |
2419 | #define TSTORM_CAM_ENTRY_RSRVVAL0 (0x7<<1) | 2419 | #define TSTORM_CAM_ENTRY_RSRVVAL0 (0x7<<1) |
@@ -2462,11 +2462,11 @@ struct mac_configuration_cmd { | |||
2462 | * MAC address in list for ramrod | 2462 | * MAC address in list for ramrod |
2463 | */ | 2463 | */ |
2464 | struct mac_configuration_entry_e1h { | 2464 | struct mac_configuration_entry_e1h { |
2465 | u16 lsb_mac_addr; | 2465 | __le16 lsb_mac_addr; |
2466 | u16 middle_mac_addr; | 2466 | __le16 middle_mac_addr; |
2467 | u16 msb_mac_addr; | 2467 | __le16 msb_mac_addr; |
2468 | u16 vlan_id; | 2468 | __le16 vlan_id; |
2469 | u16 e1hov_id; | 2469 | __le16 e1hov_id; |
2470 | u8 client_id; | 2470 | u8 client_id; |
2471 | u8 flags; | 2471 | u8 flags; |
2472 | #define MAC_CONFIGURATION_ENTRY_E1H_PORT (0x1<<0) | 2472 | #define MAC_CONFIGURATION_ENTRY_E1H_PORT (0x1<<0) |
@@ -2721,16 +2721,16 @@ struct cmng_struct_per_port { | |||
2721 | */ | 2721 | */ |
2722 | struct xstorm_per_client_stats { | 2722 | struct xstorm_per_client_stats { |
2723 | struct regpair total_sent_bytes; | 2723 | struct regpair total_sent_bytes; |
2724 | u32 total_sent_pkts; | 2724 | __le32 total_sent_pkts; |
2725 | u32 unicast_pkts_sent; | 2725 | __le32 unicast_pkts_sent; |
2726 | struct regpair unicast_bytes_sent; | 2726 | struct regpair unicast_bytes_sent; |
2727 | struct regpair multicast_bytes_sent; | 2727 | struct regpair multicast_bytes_sent; |
2728 | u32 multicast_pkts_sent; | 2728 | __le32 multicast_pkts_sent; |
2729 | u32 broadcast_pkts_sent; | 2729 | __le32 broadcast_pkts_sent; |
2730 | struct regpair broadcast_bytes_sent; | 2730 | struct regpair broadcast_bytes_sent; |
2731 | u16 stats_counter; | 2731 | __le16 stats_counter; |
2732 | u16 reserved0; | 2732 | __le16 reserved0; |
2733 | u32 reserved1; | 2733 | __le32 reserved1; |
2734 | }; | 2734 | }; |
2735 | 2735 | ||
2736 | 2736 | ||
@@ -2746,10 +2746,10 @@ struct xstorm_common_stats { | |||
2746 | * Protocol-common statistics collected by the Tstorm (per port) | 2746 | * Protocol-common statistics collected by the Tstorm (per port) |
2747 | */ | 2747 | */ |
2748 | struct tstorm_per_port_stats { | 2748 | struct tstorm_per_port_stats { |
2749 | u32 mac_filter_discard; | 2749 | __le32 mac_filter_discard; |
2750 | u32 xxoverflow_discard; | 2750 | __le32 xxoverflow_discard; |
2751 | u32 brb_truncate_discard; | 2751 | __le32 brb_truncate_discard; |
2752 | u32 mac_discard; | 2752 | __le32 mac_discard; |
2753 | }; | 2753 | }; |
2754 | 2754 | ||
2755 | 2755 | ||
@@ -2762,17 +2762,17 @@ struct tstorm_per_client_stats { | |||
2762 | struct regpair rcv_broadcast_bytes; | 2762 | struct regpair rcv_broadcast_bytes; |
2763 | struct regpair rcv_multicast_bytes; | 2763 | struct regpair rcv_multicast_bytes; |
2764 | struct regpair rcv_error_bytes; | 2764 | struct regpair rcv_error_bytes; |
2765 | u32 checksum_discard; | 2765 | __le32 checksum_discard; |
2766 | u32 packets_too_big_discard; | 2766 | __le32 packets_too_big_discard; |
2767 | u32 total_rcv_pkts; | 2767 | __le32 total_rcv_pkts; |
2768 | u32 rcv_unicast_pkts; | 2768 | __le32 rcv_unicast_pkts; |
2769 | u32 rcv_broadcast_pkts; | 2769 | __le32 rcv_broadcast_pkts; |
2770 | u32 rcv_multicast_pkts; | 2770 | __le32 rcv_multicast_pkts; |
2771 | u32 no_buff_discard; | 2771 | __le32 no_buff_discard; |
2772 | u32 ttl0_discard; | 2772 | __le32 ttl0_discard; |
2773 | u16 stats_counter; | 2773 | __le16 stats_counter; |
2774 | u16 reserved0; | 2774 | __le16 reserved0; |
2775 | u32 reserved1; | 2775 | __le32 reserved1; |
2776 | }; | 2776 | }; |
2777 | 2777 | ||
2778 | /* | 2778 | /* |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 2542ba88a290..26451f6a7c49 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -473,7 +473,7 @@ static int bnx2x_mc_assert(struct bnx2x *bp) | |||
473 | static void bnx2x_fw_dump(struct bnx2x *bp) | 473 | static void bnx2x_fw_dump(struct bnx2x *bp) |
474 | { | 474 | { |
475 | u32 mark, offset; | 475 | u32 mark, offset; |
476 | u32 data[9]; | 476 | __be32 data[9]; |
477 | int word; | 477 | int word; |
478 | 478 | ||
479 | mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); | 479 | mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); |
@@ -3000,8 +3000,8 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) | |||
3000 | 3000 | ||
3001 | #define UPDATE_EXTEND_TSTAT(s, t) \ | 3001 | #define UPDATE_EXTEND_TSTAT(s, t) \ |
3002 | do { \ | 3002 | do { \ |
3003 | diff = le32_to_cpu(tclient->s) - old_tclient->s; \ | 3003 | diff = le32_to_cpu(tclient->s) - le32_to_cpu(old_tclient->s); \ |
3004 | old_tclient->s = le32_to_cpu(tclient->s); \ | 3004 | old_tclient->s = tclient->s; \ |
3005 | ADD_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \ | 3005 | ADD_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \ |
3006 | } while (0) | 3006 | } while (0) |
3007 | 3007 | ||
@@ -3014,8 +3014,8 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) | |||
3014 | 3014 | ||
3015 | #define UPDATE_EXTEND_XSTAT(s, t) \ | 3015 | #define UPDATE_EXTEND_XSTAT(s, t) \ |
3016 | do { \ | 3016 | do { \ |
3017 | diff = le32_to_cpu(xclient->s) - old_xclient->s; \ | 3017 | diff = le32_to_cpu(xclient->s) - le32_to_cpu(old_xclient->s); \ |
3018 | old_xclient->s = le32_to_cpu(xclient->s); \ | 3018 | old_xclient->s = xclient->s; \ |
3019 | ADD_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \ | 3019 | ADD_EXTEND_64(qstats->t##_hi, qstats->t##_lo, diff); \ |
3020 | } while (0) | 3020 | } while (0) |
3021 | 3021 | ||
@@ -3524,7 +3524,10 @@ static void bnx2x_bmac_stats_update(struct bnx2x *bp) | |||
3524 | struct bmac_stats *new = bnx2x_sp(bp, mac_stats.bmac_stats); | 3524 | struct bmac_stats *new = bnx2x_sp(bp, mac_stats.bmac_stats); |
3525 | struct host_port_stats *pstats = bnx2x_sp(bp, port_stats); | 3525 | struct host_port_stats *pstats = bnx2x_sp(bp, port_stats); |
3526 | struct bnx2x_eth_stats *estats = &bp->eth_stats; | 3526 | struct bnx2x_eth_stats *estats = &bp->eth_stats; |
3527 | struct regpair diff; | 3527 | struct { |
3528 | u32 lo; | ||
3529 | u32 hi; | ||
3530 | } diff; | ||
3528 | 3531 | ||
3529 | UPDATE_STAT64(rx_stat_grerb, rx_stat_ifhcinbadoctets); | 3532 | UPDATE_STAT64(rx_stat_grerb, rx_stat_ifhcinbadoctets); |
3530 | UPDATE_STAT64(rx_stat_grfcs, rx_stat_dot3statsfcserrors); | 3533 | UPDATE_STAT64(rx_stat_grfcs, rx_stat_dot3statsfcserrors); |
@@ -3630,7 +3633,10 @@ static int bnx2x_hw_stats_update(struct bnx2x *bp) | |||
3630 | struct nig_stats *old = &(bp->port.old_nig_stats); | 3633 | struct nig_stats *old = &(bp->port.old_nig_stats); |
3631 | struct host_port_stats *pstats = bnx2x_sp(bp, port_stats); | 3634 | struct host_port_stats *pstats = bnx2x_sp(bp, port_stats); |
3632 | struct bnx2x_eth_stats *estats = &bp->eth_stats; | 3635 | struct bnx2x_eth_stats *estats = &bp->eth_stats; |
3633 | struct regpair diff; | 3636 | struct { |
3637 | u32 lo; | ||
3638 | u32 hi; | ||
3639 | } diff; | ||
3634 | u32 nig_timer_max; | 3640 | u32 nig_timer_max; |
3635 | 3641 | ||
3636 | if (bp->link_vars.mac_type == MAC_TYPE_BMAC) | 3642 | if (bp->link_vars.mac_type == MAC_TYPE_BMAC) |
@@ -3994,12 +4000,12 @@ static void bnx2x_stats_update(struct bnx2x *bp) | |||
3994 | "mac_discard %u mac_filter_discard %u " | 4000 | "mac_discard %u mac_filter_discard %u " |
3995 | "xxovrflow_discard %u brb_truncate_discard %u " | 4001 | "xxovrflow_discard %u brb_truncate_discard %u " |
3996 | "ttl0_discard %u\n", | 4002 | "ttl0_discard %u\n", |
3997 | old_tclient->checksum_discard, | 4003 | le32_to_cpu(old_tclient->checksum_discard), |
3998 | bnx2x_hilo(&qstats->etherstatsoverrsizepkts_hi), | 4004 | bnx2x_hilo(&qstats->etherstatsoverrsizepkts_hi), |
3999 | bnx2x_hilo(&qstats->no_buff_discard_hi), | 4005 | bnx2x_hilo(&qstats->no_buff_discard_hi), |
4000 | estats->mac_discard, estats->mac_filter_discard, | 4006 | estats->mac_discard, estats->mac_filter_discard, |
4001 | estats->xxoverflow_discard, estats->brb_truncate_discard, | 4007 | estats->xxoverflow_discard, estats->brb_truncate_discard, |
4002 | old_tclient->ttl0_discard); | 4008 | le32_to_cpu(old_tclient->ttl0_discard)); |
4003 | 4009 | ||
4004 | for_each_queue(bp, i) { | 4010 | for_each_queue(bp, i) { |
4005 | printk(KERN_DEBUG "[%d]: %lu\t%lu\t%lu\n", i, | 4011 | printk(KERN_DEBUG "[%d]: %lu\t%lu\t%lu\n", i, |
@@ -6610,9 +6616,9 @@ static void bnx2x_set_mac_addr_e1(struct bnx2x *bp, int set) | |||
6610 | config->config_table[0].cam_entry.lsb_mac_addr); | 6616 | config->config_table[0].cam_entry.lsb_mac_addr); |
6611 | 6617 | ||
6612 | /* broadcast */ | 6618 | /* broadcast */ |
6613 | config->config_table[1].cam_entry.msb_mac_addr = 0xffff; | 6619 | config->config_table[1].cam_entry.msb_mac_addr = cpu_to_le16(0xffff); |
6614 | config->config_table[1].cam_entry.middle_mac_addr = 0xffff; | 6620 | config->config_table[1].cam_entry.middle_mac_addr = cpu_to_le16(0xffff); |
6615 | config->config_table[1].cam_entry.lsb_mac_addr = 0xffff; | 6621 | config->config_table[1].cam_entry.lsb_mac_addr = cpu_to_le16(0xffff); |
6616 | config->config_table[1].cam_entry.flags = cpu_to_le16(port); | 6622 | config->config_table[1].cam_entry.flags = cpu_to_le16(port); |
6617 | if (set) | 6623 | if (set) |
6618 | config->config_table[1].target_table_entry.flags = | 6624 | config->config_table[1].target_table_entry.flags = |
@@ -7035,7 +7041,7 @@ static int bnx2x_stop_multi(struct bnx2x *bp, int index) | |||
7035 | 7041 | ||
7036 | static int bnx2x_stop_leading(struct bnx2x *bp) | 7042 | static int bnx2x_stop_leading(struct bnx2x *bp) |
7037 | { | 7043 | { |
7038 | u16 dsb_sp_prod_idx; | 7044 | __le16 dsb_sp_prod_idx; |
7039 | /* if the other port is handling traffic, | 7045 | /* if the other port is handling traffic, |
7040 | this can take a lot of time */ | 7046 | this can take a lot of time */ |
7041 | int cnt = 500; | 7047 | int cnt = 500; |
@@ -8625,7 +8631,7 @@ static void bnx2x_disable_nvram_access(struct bnx2x *bp) | |||
8625 | MCPR_NVM_ACCESS_ENABLE_WR_EN))); | 8631 | MCPR_NVM_ACCESS_ENABLE_WR_EN))); |
8626 | } | 8632 | } |
8627 | 8633 | ||
8628 | static int bnx2x_nvram_read_dword(struct bnx2x *bp, u32 offset, u32 *ret_val, | 8634 | static int bnx2x_nvram_read_dword(struct bnx2x *bp, u32 offset, __be32 *ret_val, |
8629 | u32 cmd_flags) | 8635 | u32 cmd_flags) |
8630 | { | 8636 | { |
8631 | int count, i, rc; | 8637 | int count, i, rc; |
@@ -8661,8 +8667,7 @@ static int bnx2x_nvram_read_dword(struct bnx2x *bp, u32 offset, u32 *ret_val, | |||
8661 | /* we read nvram data in cpu order | 8667 | /* we read nvram data in cpu order |
8662 | * but ethtool sees it as an array of bytes | 8668 | * but ethtool sees it as an array of bytes |
8663 | * converting to big-endian will do the work */ | 8669 | * converting to big-endian will do the work */ |
8664 | val = cpu_to_be32(val); | 8670 | *ret_val = cpu_to_be32(val); |
8665 | *ret_val = val; | ||
8666 | rc = 0; | 8671 | rc = 0; |
8667 | break; | 8672 | break; |
8668 | } | 8673 | } |
@@ -8676,7 +8681,7 @@ static int bnx2x_nvram_read(struct bnx2x *bp, u32 offset, u8 *ret_buf, | |||
8676 | { | 8681 | { |
8677 | int rc; | 8682 | int rc; |
8678 | u32 cmd_flags; | 8683 | u32 cmd_flags; |
8679 | u32 val; | 8684 | __be32 val; |
8680 | 8685 | ||
8681 | if ((offset & 0x03) || (buf_size & 0x03) || (buf_size == 0)) { | 8686 | if ((offset & 0x03) || (buf_size & 0x03) || (buf_size == 0)) { |
8682 | DP(BNX2X_MSG_NVM, | 8687 | DP(BNX2X_MSG_NVM, |
@@ -8795,7 +8800,7 @@ static int bnx2x_nvram_write1(struct bnx2x *bp, u32 offset, u8 *data_buf, | |||
8795 | int rc; | 8800 | int rc; |
8796 | u32 cmd_flags; | 8801 | u32 cmd_flags; |
8797 | u32 align_offset; | 8802 | u32 align_offset; |
8798 | u32 val; | 8803 | __be32 val; |
8799 | 8804 | ||
8800 | if (offset + buf_size > bp->common.flash_size) { | 8805 | if (offset + buf_size > bp->common.flash_size) { |
8801 | DP(BNX2X_MSG_NVM, "Invalid parameter: offset (0x%x) +" | 8806 | DP(BNX2X_MSG_NVM, "Invalid parameter: offset (0x%x) +" |
@@ -9387,11 +9392,9 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up) | |||
9387 | 9392 | ||
9388 | wmb(); | 9393 | wmb(); |
9389 | 9394 | ||
9390 | fp->hw_tx_prods->bds_prod = | 9395 | le16_add_cpu(&fp->hw_tx_prods->bds_prod, 1); |
9391 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + 1); | ||
9392 | mb(); /* FW restriction: must not reorder writing nbd and packets */ | 9396 | mb(); /* FW restriction: must not reorder writing nbd and packets */ |
9393 | fp->hw_tx_prods->packets_prod = | 9397 | le32_add_cpu(&fp->hw_tx_prods->packets_prod, 1); |
9394 | cpu_to_le32(le32_to_cpu(fp->hw_tx_prods->packets_prod) + 1); | ||
9395 | DOORBELL(bp, fp->index, 0); | 9398 | DOORBELL(bp, fp->index, 0); |
9396 | 9399 | ||
9397 | mmiowb(); | 9400 | mmiowb(); |
@@ -9491,7 +9494,7 @@ static int bnx2x_test_nvram(struct bnx2x *bp) | |||
9491 | { 0x778, 0x70 }, | 9494 | { 0x778, 0x70 }, |
9492 | { 0, 0 } | 9495 | { 0, 0 } |
9493 | }; | 9496 | }; |
9494 | u32 buf[0x350 / 4]; | 9497 | __be32 buf[0x350 / 4]; |
9495 | u8 *data = (u8 *)buf; | 9498 | u8 *data = (u8 *)buf; |
9496 | int i, rc; | 9499 | int i, rc; |
9497 | u32 magic, csum; | 9500 | u32 magic, csum; |
@@ -10130,7 +10133,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) | |||
10130 | rc = XMIT_PLAIN; | 10133 | rc = XMIT_PLAIN; |
10131 | 10134 | ||
10132 | else { | 10135 | else { |
10133 | if (skb->protocol == ntohs(ETH_P_IPV6)) { | 10136 | if (skb->protocol == htons(ETH_P_IPV6)) { |
10134 | rc = XMIT_CSUM_V6; | 10137 | rc = XMIT_CSUM_V6; |
10135 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) | 10138 | if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP) |
10136 | rc |= XMIT_CSUM_TCP; | 10139 | rc |= XMIT_CSUM_TCP; |
@@ -10340,9 +10343,9 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
10340 | hlen = (skb_network_header(skb) - skb->data + vlan_off) / 2; | 10343 | hlen = (skb_network_header(skb) - skb->data + vlan_off) / 2; |
10341 | 10344 | ||
10342 | /* for now NS flag is not used in Linux */ | 10345 | /* for now NS flag is not used in Linux */ |
10343 | pbd->global_data = (hlen | | 10346 | pbd->global_data = |
10344 | ((skb->protocol == ntohs(ETH_P_8021Q)) << | 10347 | (hlen | ((skb->protocol == cpu_to_be16(ETH_P_8021Q)) << |
10345 | ETH_TX_PARSE_BD_LLC_SNAP_EN_SHIFT)); | 10348 | ETH_TX_PARSE_BD_LLC_SNAP_EN_SHIFT)); |
10346 | 10349 | ||
10347 | pbd->ip_hlen = (skb_transport_header(skb) - | 10350 | pbd->ip_hlen = (skb_transport_header(skb) - |
10348 | skb_network_header(skb)) / 2; | 10351 | skb_network_header(skb)) / 2; |
@@ -10486,11 +10489,9 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
10486 | */ | 10489 | */ |
10487 | wmb(); | 10490 | wmb(); |
10488 | 10491 | ||
10489 | fp->hw_tx_prods->bds_prod = | 10492 | le16_add_cpu(&fp->hw_tx_prods->bds_prod, nbd); |
10490 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + nbd); | ||
10491 | mb(); /* FW restriction: must not reorder writing nbd and packets */ | 10493 | mb(); /* FW restriction: must not reorder writing nbd and packets */ |
10492 | fp->hw_tx_prods->packets_prod = | 10494 | le32_add_cpu(&fp->hw_tx_prods->packets_prod, 1); |
10493 | cpu_to_le32(le32_to_cpu(fp->hw_tx_prods->packets_prod) + 1); | ||
10494 | DOORBELL(bp, fp->index, 0); | 10495 | DOORBELL(bp, fp->index, 0); |
10495 | 10496 | ||
10496 | mmiowb(); | 10497 | mmiowb(); |