Commit 1caf13eb authored by Matt Carlson's avatar Matt Carlson Committed by David S. Miller

tg3: Add new FW_TSO flag

tg3 used the fw_needed member loosely as a synonym for firmware TSO. Now
that the 57766 needs firmware download support, fw_needed can no longer be
used like this. This patch creates a new FW_TSO flag and changes the
code to use it.

Also rearrange all the TSO flags together in the enum.
Reviewed-by: default avatarBenjamin Li <benli@broadcom.com>
Signed-off-by: default avatarNithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a6f3587c
...@@ -3618,9 +3618,7 @@ static int tg3_load_tso_firmware(struct tg3 *tp) ...@@ -3618,9 +3618,7 @@ static int tg3_load_tso_firmware(struct tg3 *tp)
unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size; unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size;
int err, i; int err, i;
if (tg3_flag(tp, HW_TSO_1) || if (!tg3_flag(tp, FW_TSO))
tg3_flag(tp, HW_TSO_2) ||
tg3_flag(tp, HW_TSO_3))
return 0; return 0;
fw_data = (void *)tp->fw->data; fw_data = (void *)tp->fw->data;
...@@ -15293,6 +15291,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) ...@@ -15293,6 +15291,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
} else if (tg3_asic_rev(tp) != ASIC_REV_5700 && } else if (tg3_asic_rev(tp) != ASIC_REV_5700 &&
tg3_asic_rev(tp) != ASIC_REV_5701 && tg3_asic_rev(tp) != ASIC_REV_5701 &&
tg3_chip_rev_id(tp) != CHIPREV_ID_5705_A0) { tg3_chip_rev_id(tp) != CHIPREV_ID_5705_A0) {
tg3_flag_set(tp, FW_TSO);
tg3_flag_set(tp, TSO_BUG); tg3_flag_set(tp, TSO_BUG);
if (tg3_asic_rev(tp) == ASIC_REV_5705) if (tg3_asic_rev(tp) == ASIC_REV_5705)
tp->fw_needed = FIRMWARE_TG3TSO5; tp->fw_needed = FIRMWARE_TG3TSO5;
...@@ -15304,7 +15303,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) ...@@ -15304,7 +15303,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
if (tg3_flag(tp, HW_TSO_1) || if (tg3_flag(tp, HW_TSO_1) ||
tg3_flag(tp, HW_TSO_2) || tg3_flag(tp, HW_TSO_2) ||
tg3_flag(tp, HW_TSO_3) || tg3_flag(tp, HW_TSO_3) ||
tp->fw_needed) { tg3_flag(tp, FW_TSO)) {
/* For firmware TSO, assume ASF is disabled. /* For firmware TSO, assume ASF is disabled.
* We'll disable TSO later if we discover ASF * We'll disable TSO later if we discover ASF
* is enabled in tg3_get_eeprom_hw_cfg(). * is enabled in tg3_get_eeprom_hw_cfg().
...@@ -15591,7 +15590,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) ...@@ -15591,7 +15590,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent)
*/ */
tg3_get_eeprom_hw_cfg(tp); tg3_get_eeprom_hw_cfg(tp);
if (tp->fw_needed && tg3_flag(tp, ENABLE_ASF)) { if (tg3_flag(tp, FW_TSO) && tg3_flag(tp, ENABLE_ASF)) {
tg3_flag_clear(tp, TSO_CAPABLE); tg3_flag_clear(tp, TSO_CAPABLE);
tg3_flag_clear(tp, TSO_BUG); tg3_flag_clear(tp, TSO_BUG);
tp->fw_needed = NULL; tp->fw_needed = NULL;
......
...@@ -3009,17 +3009,18 @@ enum TG3_FLAGS { ...@@ -3009,17 +3009,18 @@ enum TG3_FLAGS {
TG3_FLAG_JUMBO_CAPABLE, TG3_FLAG_JUMBO_CAPABLE,
TG3_FLAG_CHIP_RESETTING, TG3_FLAG_CHIP_RESETTING,
TG3_FLAG_INIT_COMPLETE, TG3_FLAG_INIT_COMPLETE,
TG3_FLAG_TSO_BUG,
TG3_FLAG_MAX_RXPEND_64, TG3_FLAG_MAX_RXPEND_64,
TG3_FLAG_TSO_CAPABLE,
TG3_FLAG_PCI_EXPRESS, /* BCM5785 + pci_is_pcie() */ TG3_FLAG_PCI_EXPRESS, /* BCM5785 + pci_is_pcie() */
TG3_FLAG_ASF_NEW_HANDSHAKE, TG3_FLAG_ASF_NEW_HANDSHAKE,
TG3_FLAG_HW_AUTONEG, TG3_FLAG_HW_AUTONEG,
TG3_FLAG_IS_NIC, TG3_FLAG_IS_NIC,
TG3_FLAG_FLASH, TG3_FLAG_FLASH,
TG3_FLAG_FW_TSO,
TG3_FLAG_HW_TSO_1, TG3_FLAG_HW_TSO_1,
TG3_FLAG_HW_TSO_2, TG3_FLAG_HW_TSO_2,
TG3_FLAG_HW_TSO_3, TG3_FLAG_HW_TSO_3,
TG3_FLAG_TSO_CAPABLE,
TG3_FLAG_TSO_BUG,
TG3_FLAG_ICH_WORKAROUND, TG3_FLAG_ICH_WORKAROUND,
TG3_FLAG_1SHOT_MSI, TG3_FLAG_1SHOT_MSI,
TG3_FLAG_NO_FWARE_REPORTED, TG3_FLAG_NO_FWARE_REPORTED,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment