diff options
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r-- | drivers/net/benet/be_main.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index cb0a4a6d5dea..49d51965312e 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -879,7 +879,7 @@ static void be_rx_compl_process(struct be_adapter *adapter, | |||
879 | return; | 879 | return; |
880 | } | 880 | } |
881 | vid = AMAP_GET_BITS(struct amap_eth_rx_compl, vlan_tag, rxcp); | 881 | vid = AMAP_GET_BITS(struct amap_eth_rx_compl, vlan_tag, rxcp); |
882 | vid = be16_to_cpu(vid); | 882 | vid = swab16(vid); |
883 | vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, vid); | 883 | vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, vid); |
884 | } else { | 884 | } else { |
885 | netif_receive_skb(skb); | 885 | netif_receive_skb(skb); |
@@ -956,7 +956,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, | |||
956 | napi_gro_frags(&eq_obj->napi); | 956 | napi_gro_frags(&eq_obj->napi); |
957 | } else { | 957 | } else { |
958 | vid = AMAP_GET_BITS(struct amap_eth_rx_compl, vlan_tag, rxcp); | 958 | vid = AMAP_GET_BITS(struct amap_eth_rx_compl, vlan_tag, rxcp); |
959 | vid = be16_to_cpu(vid); | 959 | vid = swab16(vid); |
960 | 960 | ||
961 | if (!adapter->vlan_grp || adapter->vlans_added == 0) | 961 | if (!adapter->vlan_grp || adapter->vlans_added == 0) |
962 | return; | 962 | return; |
@@ -1977,7 +1977,7 @@ static bool be_flash_redboot(struct be_adapter *adapter, | |||
1977 | p += crc_offset; | 1977 | p += crc_offset; |
1978 | 1978 | ||
1979 | status = be_cmd_get_flash_crc(adapter, flashed_crc, | 1979 | status = be_cmd_get_flash_crc(adapter, flashed_crc, |
1980 | (img_start + image_size - 4)); | 1980 | (image_size - 4)); |
1981 | if (status) { | 1981 | if (status) { |
1982 | dev_err(&adapter->pdev->dev, | 1982 | dev_err(&adapter->pdev->dev, |
1983 | "could not get crc from flash, not flashing redboot\n"); | 1983 | "could not get crc from flash, not flashing redboot\n"); |
@@ -2113,7 +2113,7 @@ int be_load_fw(struct be_adapter *adapter, u8 *func) | |||
2113 | struct flash_file_hdr_g3 *fhdr3; | 2113 | struct flash_file_hdr_g3 *fhdr3; |
2114 | struct image_hdr *img_hdr_ptr = NULL; | 2114 | struct image_hdr *img_hdr_ptr = NULL; |
2115 | struct be_dma_mem flash_cmd; | 2115 | struct be_dma_mem flash_cmd; |
2116 | int status, i = 0; | 2116 | int status, i = 0, num_imgs = 0; |
2117 | const u8 *p; | 2117 | const u8 *p; |
2118 | 2118 | ||
2119 | strcpy(fw_file, func); | 2119 | strcpy(fw_file, func); |
@@ -2139,15 +2139,14 @@ int be_load_fw(struct be_adapter *adapter, u8 *func) | |||
2139 | if ((adapter->generation == BE_GEN3) && | 2139 | if ((adapter->generation == BE_GEN3) && |
2140 | (get_ufigen_type(fhdr) == BE_GEN3)) { | 2140 | (get_ufigen_type(fhdr) == BE_GEN3)) { |
2141 | fhdr3 = (struct flash_file_hdr_g3 *) fw->data; | 2141 | fhdr3 = (struct flash_file_hdr_g3 *) fw->data; |
2142 | for (i = 0; i < fhdr3->num_imgs; i++) { | 2142 | num_imgs = le32_to_cpu(fhdr3->num_imgs); |
2143 | for (i = 0; i < num_imgs; i++) { | ||
2143 | img_hdr_ptr = (struct image_hdr *) (fw->data + | 2144 | img_hdr_ptr = (struct image_hdr *) (fw->data + |
2144 | (sizeof(struct flash_file_hdr_g3) + | 2145 | (sizeof(struct flash_file_hdr_g3) + |
2145 | i * sizeof(struct image_hdr))); | 2146 | i * sizeof(struct image_hdr))); |
2146 | if (img_hdr_ptr->imageid == 1) { | 2147 | if (le32_to_cpu(img_hdr_ptr->imageid) == 1) |
2147 | status = be_flash_data(adapter, fw, | 2148 | status = be_flash_data(adapter, fw, &flash_cmd, |
2148 | &flash_cmd, fhdr3->num_imgs); | 2149 | num_imgs); |
2149 | } | ||
2150 | |||
2151 | } | 2150 | } |
2152 | } else if ((adapter->generation == BE_GEN2) && | 2151 | } else if ((adapter->generation == BE_GEN2) && |
2153 | (get_ufigen_type(fhdr) == BE_GEN2)) { | 2152 | (get_ufigen_type(fhdr) == BE_GEN2)) { |