diff --git a/drivers/net/ethernet/netswift/ngbe/ngbe_debugfs.c b/drivers/net/ethernet/netswift/ngbe/ngbe_debugfs.c index 3b99a36fbb2d30b654b589db48ce32e4de04e575..f318e246871d9bfdd8d3cf004162ec48f0135146 100644 --- a/drivers/net/ethernet/netswift/ngbe/ngbe_debugfs.c +++ b/drivers/net/ethernet/netswift/ngbe/ngbe_debugfs.c @@ -526,7 +526,7 @@ ngbe_regdump(struct ngbe_hw *hw, struct ngbe_reg_info *reg_info) default: for (i = 0; i < reg_info->length; i++) { buffer[n++] = rd32(hw, - reg_info->offset + i << 2); + reg_info->offset + (i << 2)); } break; } diff --git a/drivers/net/ethernet/netswift/ngbe/ngbe_hw.c b/drivers/net/ethernet/netswift/ngbe/ngbe_hw.c index 4c8631dfda0b759ca3672a800172d63b8980cd24..8f6fc008930b75d2646540a7709458b598cf3483 100644 --- a/drivers/net/ethernet/netswift/ngbe/ngbe_hw.c +++ b/drivers/net/ethernet/netswift/ngbe/ngbe_hw.c @@ -13,11 +13,11 @@ #define NGBE_SP_VFT_TBL_SIZE 128 #define NGBE_SP_RX_PB_SIZE 42 -STATIC s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw); -STATIC void ngbe_release_eeprom_semaphore(struct ngbe_hw *hw); -STATIC s32 ngbe_mta_vector(struct ngbe_hw *hw, u8 *mc_addr); +static s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw); +static void ngbe_release_eeprom_semaphore(struct ngbe_hw *hw); +static s32 ngbe_mta_vector(struct ngbe_hw *hw, u8 *mc_addr); -STATIC s32 ngbe_setup_copper_link(struct ngbe_hw *hw, +static s32 ngbe_setup_copper_link(struct ngbe_hw *hw, u32 speed, bool need_restart_AN); s32 ngbe_check_mac_link(struct ngbe_hw *hw, u32 *speed, @@ -469,7 +469,7 @@ s32 ngbe_led_off(struct ngbe_hw *hw, u32 index) * * Sets the hardware semaphores so EEPROM access can occur for bit-bang method **/ -STATIC s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw) +static s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw) { s32 status = NGBE_ERR_EEPROM; u32 timeout = 2000; @@ -549,7 +549,7 @@ STATIC s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw) * * This function clears hardware semaphore bits. **/ -STATIC void ngbe_release_eeprom_semaphore(struct ngbe_hw *hw) +static void ngbe_release_eeprom_semaphore(struct ngbe_hw *hw) { if (ngbe_check_mng_access(hw)) { wr32m(hw, NGBE_MNG_SW_SM, @@ -847,7 +847,7 @@ s32 ngbe_update_uc_addr_list(struct ngbe_hw *hw, u8 *addr_list, * by the MO field of the MCSTCTRL. The MO field is set during initialization * to mc_filter_type. **/ -STATIC s32 ngbe_mta_vector(struct ngbe_hw *hw, u8 *mc_addr) +static s32 ngbe_mta_vector(struct ngbe_hw *hw, u8 *mc_addr) { u32 vector = 0; @@ -1133,13 +1133,12 @@ s32 ngbe_fc_enable(struct ngbe_hw *hw) * Find the intersection between advertised settings and link partner's * advertised settings **/ -STATIC s32 ngbe_negotiate_fc(struct ngbe_hw *hw, u32 adv_reg, u32 lp_reg, +static s32 ngbe_negotiate_fc(struct ngbe_hw *hw, u32 adv_reg, u32 lp_reg, u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm) { if ((!(adv_reg)) || (!(lp_reg))) { ERROR_REPORT3(NGBE_ERROR_UNSUPPORTED, - "Local or link partner's advertised flow control " - "settings are NULL. Local: %x, link partner: %x\n", + "Local or link partner's advertised flow control settings are NULL. Local: %x, link partner: %x\n", adv_reg, lp_reg); return NGBE_ERR_FC_NOT_NEGOTIATED; } @@ -1179,7 +1178,7 @@ STATIC s32 ngbe_negotiate_fc(struct ngbe_hw *hw, u32 adv_reg, u32 lp_reg, * * Enable flow control according to IEEE clause 37. **/ -STATIC s32 ngbe_fc_autoneg_copper(struct ngbe_hw *hw) +static s32 ngbe_fc_autoneg_copper(struct ngbe_hw *hw) { u8 technology_ability_reg = 0; u8 lp_technology_ability_reg = 0; @@ -1310,15 +1309,16 @@ s32 ngbe_acquire_swfw_sync(struct ngbe_hw *hw, u32 mask) if (ngbe_check_mng_access(hw)) { gssr = rd32(hw, NGBE_MNG_SWFW_SYNC); - if (!(gssr & (fwmask | swmask))) { + if (gssr & (fwmask | swmask)) { + /* Resource is currently in use by FW or SW */ + ngbe_release_eeprom_semaphore(hw); + mdelay(5); + } else { gssr |= swmask; wr32(hw, NGBE_MNG_SWFW_SYNC, gssr); + ngbe_release_eeprom_semaphore(hw); return 0; - } else { - /* Resource is currently in use by FW or SW */ - ngbe_release_eeprom_semaphore(hw); - msec_delay(5); } } } @@ -1371,9 +1371,8 @@ s32 ngbe_disable_sec_rx_path(struct ngbe_hw *hw) secrxreg = rd32(hw, NGBE_RSEC_ST); if (secrxreg & NGBE_RSEC_ST_RSEC_RDY) break; - else /* Use interrupt-safe sleep just in case */ - usec_delay(1000); + usec_delay(1000); } /* For informational purposes only */ @@ -2680,14 +2679,14 @@ void ngbe_set_rxpba(struct ngbe_hw *hw, int num_pb, u32 headroom, wr32(hw, NGBE_TDM_PB_THRE, txpbthresh); } -STATIC const u8 ngbe_emc_temp_data[4] = { +static const u8 ngbe_emc_temp_data[4] = { NGBE_EMC_INTERNAL_DATA, NGBE_EMC_DIODE1_DATA, NGBE_EMC_DIODE2_DATA, NGBE_EMC_DIODE3_DATA }; -STATIC const u8 ngbe_emc_therm_limit[4] = { +static const u8 ngbe_emc_therm_limit[4] = { NGBE_EMC_INTERNAL_THERM_LIMIT, NGBE_EMC_DIODE1_THERM_LIMIT, NGBE_EMC_DIODE2_THERM_LIMIT, @@ -2895,7 +2894,7 @@ int ngbe_check_flash_load(struct ngbe_hw *hw, u32 check_bit) /* Lookup table mapping the HW PTYPE to the bit field for decoding */ /* for ((pt=0;pt<256;pt++)); do printf "macro(0x%02X),\n" $pt; done */ -ngbe_dptype ngbe_ptype_lookup[256] = { +struct ngbe_dec_ptype ngbe_ptype_lookup[256] = { NGBE_UKN(0x00), NGBE_UKN(0x01), NGBE_UKN(0x02), @@ -3179,6 +3178,16 @@ ngbe_dptype ngbe_ptype_lookup[256] = { NGBE_UKN(0xFF), }; +struct ngbe_dec_ptype ngbe_decode_ptype(const u8 ptype) +{ + return ngbe_ptype_lookup[ptype]; +} + +struct ngbe_dec_ptype decode_rx_desc_ptype(const union ngbe_rx_desc *rx_desc) +{ + return ngbe_decode_ptype(NGBE_RXD_PKTTYPE(rx_desc)); +} + void ngbe_init_mac_link_ops(struct ngbe_hw *hw) { struct ngbe_mac_info *mac = &hw->mac; @@ -3353,7 +3362,7 @@ enum ngbe_media_type ngbe_get_media_type(struct ngbe_hw *hw) **/ void ngbe_stop_mac_link_on_d3(struct ngbe_hw __always_unused *hw) { - return; + } /** @@ -3418,7 +3427,6 @@ s32 ngbe_setup_mac_link(struct ngbe_hw *hw, return status; } - /** * ngbe_setup_copper_link - Set the PHY autoneg advertised field * @hw: pointer to hardware structure @@ -3986,7 +3994,6 @@ s32 ngbe_phy_led_oem_chk(struct ngbe_hw *hw, u32 *data) /* one word */ buffer.length = 0; - status = ngbe_host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), NGBE_HI_COMMAND_TIMEOUT, false); @@ -4529,12 +4536,13 @@ s32 ngbe_check_mac_link(struct ngbe_hw *hw, if (link_up_wait_to_complete) { for (i = 0; i < NGBE_LINK_UP_TIME; i++) { status = TCALL(hw, phy.ops.read_reg, 0x1A, 0xA43, &value); - if (!status && (value & 0x4)) { + if (!status && (value & 0x4)) *link_up = true; - break; - } else { + else *link_up = false; - } + + if (*link_up == true) + break; msleep(100); } } else { @@ -4580,12 +4588,13 @@ s32 ngbe_check_mac_link_mdi(struct ngbe_hw *hw, if (link_up_wait_to_complete) { for (i = 0; i < NGBE_LINK_UP_TIME; i++) { status = TCALL(hw, phy.ops.read_reg_mdi, 17, 0, &value); - if (value & 0x400) { + if (value & 0x400) *link_up = true; - break; - } else { + else *link_up = false; - } + + if (*link_up == true) + break; msleep(100); } } else { @@ -4623,12 +4632,13 @@ s32 ngbe_check_mac_link_yt8521s(struct ngbe_hw *hw, if (link_up_wait_to_complete) { for (i = 0; i < NGBE_LINK_UP_TIME; i++) { status = ngbe_phy_read_reg_sds_mii_yt8521s(hw, 0x11, 0, &value); - if (value & 0x400) { + if (value & 0x400) *link_up = true; - break; - } else { + else *link_up = false; - } + + if (*link_up == true) + break; msleep(100); } } else { diff --git a/drivers/net/ethernet/netswift/ngbe/ngbe_hw.h b/drivers/net/ethernet/netswift/ngbe/ngbe_hw.h index 02945eca16fc706f9bc7ae6d865f363dc5e04506..a76a14a3b61cc5641f3229e8166b059f5542fd06 100644 --- a/drivers/net/ethernet/netswift/ngbe/ngbe_hw.h +++ b/drivers/net/ethernet/netswift/ngbe/ngbe_hw.h @@ -112,8 +112,9 @@ struct ngbe_dec_ptype { u32 prot:4; /* payload proto */ u32 layer:3; /* payload layer */ }; -typedef struct ngbe_dec_ptype ngbe_dptype; +struct ngbe_dec_ptype ngbe_decode_ptype(const u8 ptype); +struct ngbe_dec_ptype decode_rx_desc_ptype(const union ngbe_rx_desc *rx_desc); u16 ngbe_get_pcie_msix_count(struct ngbe_hw *hw); s32 ngbe_init_hw(struct ngbe_hw *hw); s32 ngbe_start_hw(struct ngbe_hw *hw); diff --git a/drivers/net/ethernet/netswift/ngbe/ngbe_main.c b/drivers/net/ethernet/netswift/ngbe/ngbe_main.c index a7cddfece6e2a8af58fe32fc4731442b0c0413c0..d6e06a99252b876235e18a7ffb9549a91e9631ef 100644 --- a/drivers/net/ethernet/netswift/ngbe/ngbe_main.c +++ b/drivers/net/ethernet/netswift/ngbe/ngbe_main.c @@ -36,12 +36,9 @@ const char ngbe_driver_version[32] = DRV_VERSION; static const char ngbe_copyright[] = "Copyright (c) 2018 -2019 Beijing WangXun Technology Co., Ltd"; static const char ngbe_overheat_msg[] = - "Network adapter has been stopped because it has over heated. " - "If the problem persists, restart the computer, or " - "power off the system and replace the adapter"; + "Network adapter has been stopped because it has over heated. If the problem persists, restart the computer, or power off the system and replace the adapter"; static const char ngbe_underheat_msg[] = - "Network adapter has been started again since the temperature " - "has been back to normal state"; + "Network adapter has been started again since the temperature has been back to normal state"; /* ngbe_pci_tbl - PCI Device ID Table * @@ -84,19 +81,6 @@ static bool ngbe_check_cfg_remove(struct ngbe_hw *hw, struct pci_dev *pdev); static void ngbe_clean_rx_ring(struct ngbe_ring *rx_ring); static void ngbe_clean_tx_ring(struct ngbe_ring *tx_ring); -extern ngbe_dptype ngbe_ptype_lookup[256]; - -static inline ngbe_dptype ngbe_decode_ptype(const u8 ptype) -{ - return ngbe_ptype_lookup[ptype]; -} - -static inline ngbe_dptype -decode_rx_desc_ptype(const union ngbe_rx_desc *rx_desc) -{ - return ngbe_decode_ptype(NGBE_RXD_PKTTYPE(rx_desc)); -} - static void ngbe_check_minimum_link(struct ngbe_adapter *adapter, int expected_gts) { @@ -690,7 +674,7 @@ static inline void ngbe_rx_checksum(struct ngbe_ring *ring, union ngbe_rx_desc *rx_desc, struct sk_buff *skb) { - ngbe_dptype dptype = decode_rx_desc_ptype(rx_desc); + struct ngbe_dec_ptype dptype = decode_rx_desc_ptype(rx_desc); skb->ip_summed = CHECKSUM_NONE; @@ -3117,9 +3101,7 @@ static int ngbe_hpbthresh(struct ngbe_adapter *adapter) * to user and a do the best we can. */ if (marker < 0) { - e_warn(drv, "Packet Buffer can not provide enough" - "headroom to support flow control." - "Decrease MTU or number of traffic classes\n"); + e_warn(drv, "Packet Buffer can not provide enough headroom to support flow control. Decrease MTU or number of traffic classes\n"); marker = tc + 1; } @@ -3127,7 +3109,7 @@ static int ngbe_hpbthresh(struct ngbe_adapter *adapter) } /** - * ngbe_lpbthresh - calculate low water mark for for flow control + * ngbe_lpbthresh - calculate low water mark for flow control * * @adapter: board private structure to calculate for * @pb - packet buffer to calculate @@ -3393,12 +3375,7 @@ void ngbe_reset(struct ngbe_adapter *adapter) break; case NGBE_ERR_EEPROM_VERSION: /* We are running on a pre-production device, log a warning */ - e_dev_warn("This device is a pre-production adapter/LOM. " - "Please be aware there may be issues associated " - "with your hardware. If you are experiencing " - "problems please contact your hardware " - "representative who provided you with this " - "hardware.\n"); + e_dev_warn("This device is a pre-production adapter/LOM.\n"); break; default: e_dev_err("Hardware Error: %d\n", err); @@ -5196,7 +5173,7 @@ union network_header { void *raw; }; -static ngbe_dptype encode_tx_desc_ptype(const struct ngbe_tx_buffer *first) +static struct ngbe_dec_ptype encode_tx_desc_ptype(const struct ngbe_tx_buffer *first) { struct sk_buff *skb = first->skb; u8 tun_prot = 0; @@ -5318,7 +5295,7 @@ static ngbe_dptype encode_tx_desc_ptype(const struct ngbe_tx_buffer *first) static int ngbe_tso(struct ngbe_ring *tx_ring, struct ngbe_tx_buffer *first, - u8 *hdr_len, ngbe_dptype dptype) + u8 *hdr_len, struct ngbe_dec_ptype dptype) { struct sk_buff *skb = first->skb; u32 vlan_macip_lens, type_tucmd; @@ -5441,7 +5418,7 @@ static int ngbe_tso(struct ngbe_ring *tx_ring, } static void ngbe_tx_csum(struct ngbe_ring *tx_ring, - struct ngbe_tx_buffer *first, ngbe_dptype dptype) + struct ngbe_tx_buffer *first, struct ngbe_dec_ptype dptype) { struct sk_buff *skb = first->skb; u32 vlan_macip_lens = 0; @@ -5851,7 +5828,7 @@ netdev_tx_t ngbe_xmit_frame_ring(struct sk_buff *skb, u16 count = TXD_USE_COUNT(skb_headlen(skb)); __be16 protocol = skb->protocol; u8 hdr_len = 0; - ngbe_dptype dptype; + struct ngbe_dec_ptype dptype; /* need: 1 descriptor per page * PAGE_SIZE/NGBE_MAX_DATA_PER_TXD, * + 1 desc for skb_headlen/NGBE_MAX_DATA_PER_TXD, @@ -6597,12 +6574,7 @@ static int ngbe_probe(struct pci_dev *pdev, err = TCALL(hw, mac.ops.start_hw); if (err == NGBE_ERR_EEPROM_VERSION) { /* We are running on a pre-production device, log a warning */ - e_dev_warn("This device is a pre-production adapter/LOM. " - "Please be aware there may be issues associated " - "with your hardware. If you are experiencing " - "problems please contact your hardware " - "representative who provided you with this " - "hardware.\n"); + e_dev_warn("This device is a pre-production adapter/LOM.\n"); } else if (err) { e_dev_err("HW init failed, err = %d\n", err); goto err_register; diff --git a/drivers/net/ethernet/netswift/ngbe/ngbe_param.c b/drivers/net/ethernet/netswift/ngbe/ngbe_param.c index 27856ef1ba9046cad13aa5331979774a73e58f5a..66e1b603b82d81abfd9ac825933263086b47c3a3 100644 --- a/drivers/net/ethernet/netswift/ngbe/ngbe_param.c +++ b/drivers/net/ethernet/netswift/ngbe/ngbe_param.c @@ -39,10 +39,8 @@ * * Default Value: 2 */ -NGBE_PARAM(InterruptType, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), " - "default IntMode (deprecated)"); -NGBE_PARAM(IntMode, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), " - "default 2"); +NGBE_PARAM(InterruptType, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default IntMode (deprecated)"); +NGBE_PARAM(IntMode, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default 2"); #define NGBE_INT_LEGACY 0 #define NGBE_INT_MSI 1 #define NGBE_INT_MSIX 2 @@ -68,8 +66,7 @@ NGBE_PARAM(MQ, "Disable or enable Multiple Queues, default 1"); * Default Value: 0 */ -NGBE_PARAM(RSS, "Number of Receive-Side Scaling Descriptor Queues, " - "default 0=number of cpus"); +NGBE_PARAM(RSS, "Number of Receive-Side Scaling Descriptor Queues, default 0=number of cpus"); /* VMDQ - Virtual Machine Device Queues (VMDQ) * @@ -82,8 +79,7 @@ NGBE_PARAM(RSS, "Number of Receive-Side Scaling Descriptor Queues, " #define NGBE_DEFAULT_NUM_VMDQ 8 -NGBE_PARAM(VMDQ, "Number of Virtual Machine Device Queues: 0/1 = disable, " - "2-16 enable (default=" XSTRINGIFY(NGBE_DEFAULT_NUM_VMDQ) ")"); +NGBE_PARAM(VMDQ, "Number of Virtual Machine Device Queues: 0/1 = disable, 2-16 enable (default=" XSTRINGIFY(NGBE_DEFAULT_NUM_VMDQ) ")"); #ifdef CONFIG_PCI_IOV /* max_vfs - SR I/O Virtualization @@ -97,9 +93,7 @@ NGBE_PARAM(VMDQ, "Number of Virtual Machine Device Queues: 0/1 = disable, " #define MAX_SRIOV_VFS 8 -NGBE_PARAM(max_vfs, "Number of Virtual Functions: 0 = disable (default), " - "1-" XSTRINGIFY(MAX_SRIOV_VFS) " = enable " - "this many VFs"); +NGBE_PARAM(max_vfs, "Number of Virtual Functions: 0 = disable (default), 1-" XSTRINGIFY(MAX_SRIOV_VFS) " = enable this many VFs"); /* VEPA - Set internal bridge to VEPA mode * @@ -217,8 +211,7 @@ NGBE_PARAM(dmac_watchdog, * * Default Value: 0 */ -NGBE_PARAM(RxBufferMode, "0=(default)no header split\n" - "\t\t\t1=hdr split for recognized packet\n"); +NGBE_PARAM(RxBufferMode, "0=(default)no header split\n\t\t\t1=hdr split for recognized packet\n"); #define NGBE_RXBUFMODE_NO_HEADER_SPLIT 0 #define NGBE_RXBUFMODE_HEADER_SPLIT 1 @@ -481,9 +474,7 @@ void ngbe_check_options(struct ngbe_adapter *adapter) if (*aflags & NGBE_FLAG_VMDQ_ENABLED) { if (!(*aflags & NGBE_FLAG_MQ_CAPABLE)) { DPRINTK(PROBE, INFO, - "VMDQ is not supported while multiple " - "queues are disabled. " - "Disabling VMDQ.\n"); + "VMDQ is not supported while multiple queues are disabled. Disabling VMDQ.\n"); *aflags &= ~NGBE_FLAG_VMDQ_ENABLED; feature[RING_F_VMDQ].limit = 0; } diff --git a/drivers/net/ethernet/netswift/ngbe/ngbe_phy.c b/drivers/net/ethernet/netswift/ngbe/ngbe_phy.c index f447d5bf79ed19b52950e695394c3cca9d1e66ab..562bf878294d9603323167c9f4f029f005b45362 100644 --- a/drivers/net/ethernet/netswift/ngbe/ngbe_phy.c +++ b/drivers/net/ethernet/netswift/ngbe/ngbe_phy.c @@ -84,14 +84,16 @@ s32 ngbe_check_internal_phy_id(struct ngbe_hw *hw) ngbe_phy_read_reg(hw, NGBE_MDI_PHY_ID2_OFFSET, 0, &phy_id_low); phy_id |= (phy_id_low & NGBE_MDI_PHY_ID_MASK) >> 10; - if (phy_id != NGBE_INTERNAL_PHY_ID) { + if (phy_id == NGBE_INTERNAL_PHY_ID) { + hw->phy.id = (u32)phy_id; + } else { ERROR_REPORT1(NGBE_ERROR_UNSUPPORTED, "internal phy id 0x%x not supported.\n", phy_id); + return NGBE_ERR_DEVICE_NOT_SUPPORTED; - } else { - hw->phy.id = (u32)phy_id; } + return NGBE_OK; } @@ -259,6 +261,7 @@ s32 ngbe_phy_write_reg_sds_mii_yt8521s(struct ngbe_hw *hw, u16 phy_data) { s32 status = 0; + status = ngbe_phy_write_reg_ext_yt8521s(hw, 0xa000, device_type, 0x02); if (!status) @@ -288,12 +291,13 @@ s32 ngbe_check_mdi_phy_id(struct ngbe_hw *hw) ngbe_phy_read_reg_mdi(hw, NGBE_MDI_PHY_ID2_OFFSET, 0, &phy_id_low); phy_id |= (phy_id_low & NGBE_MDI_PHY_ID_MASK) >> 10; - if (phy_id != NGBE_M88E1512_PHY_ID) { + if (phy_id == NGBE_M88E1512_PHY_ID) { + hw->phy.id = phy_id; + } else { ERROR_REPORT1(NGBE_ERROR_UNSUPPORTED, "MDI phy id 0x%x not supported.\n", phy_id); + return NGBE_ERR_DEVICE_NOT_SUPPORTED; - } else { - hw->phy.id = phy_id; } if (hw->phy.type == ngbe_phy_m88e1512_unknown) { @@ -363,13 +367,13 @@ s32 ngbe_check_yt_phy_id(struct ngbe_hw *hw) return NGBE_ERR_DEVICE_NOT_SUPPORTED; ngbe_phy_read_reg_sds_mii_yt8521s(hw, 0x3, 0, &phy_id); - if ((phy_id != NGBE_YT8521S_PHY_ID) && (phy_id != NGBE_YT8531S_PHY_ID)) { + if (phy_id == NGBE_YT8521S_PHY_ID || phy_id == NGBE_YT8531S_PHY_ID) { + hw->phy.id = phy_id; + } else { ERROR_REPORT1(NGBE_ERROR_UNSUPPORTED, - "MDI phy id 0x%x not supported.\n", phy_id); + "MDI phy id 0x%x not supported.\n", phy_id); return NGBE_ERR_DEVICE_NOT_SUPPORTED; - } else { - hw->phy.id = phy_id; } return NGBE_OK; diff --git a/drivers/net/ethernet/netswift/ngbe/ngbe_ptp.c b/drivers/net/ethernet/netswift/ngbe/ngbe_ptp.c index 6e951c9410da8a0eb4f081a0a1907838828e63b8..0dbdc1e2287bec131a809466881b8980ec99b4dc 100644 --- a/drivers/net/ethernet/netswift/ngbe/ngbe_ptp.c +++ b/drivers/net/ethernet/netswift/ngbe/ngbe_ptp.c @@ -751,13 +751,13 @@ static long ngbe_ptp_create_clock(struct ngbe_adapter *adapter) adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps, pci_dev_to_dev(adapter->pdev)); - if (IS_ERR(adapter->ptp_clock)) { + if (!IS_ERR(adapter->ptp_clock)) { + e_dev_info("registered PHC device on %s\n", netdev->name); + } else { err = PTR_ERR(adapter->ptp_clock); adapter->ptp_clock = NULL; e_dev_err("ptp_clock_register failed\n"); return err; - } else { - e_dev_info("registered PHC device on %s\n", netdev->name); } /* Set the default timestamp mode to disabled here. We do this in diff --git a/drivers/net/ethernet/netswift/ngbe/ngbe_sriov.c b/drivers/net/ethernet/netswift/ngbe/ngbe_sriov.c index 4c68134e42f0dc5449d3b00f6c6f217616ec4e94..82d69f94f620633891b423e9c5074cb07f2a5b0d 100644 --- a/drivers/net/ethernet/netswift/ngbe/ngbe_sriov.c +++ b/drivers/net/ethernet/netswift/ngbe/ngbe_sriov.c @@ -174,9 +174,7 @@ void ngbe_enable_sriov(struct ngbe_adapter *adapter) if (pre_existing_vfs) { adapter->num_vfs = pre_existing_vfs; dev_warn(&adapter->pdev->dev, - "Virtual Functions already enabled for this device -" - "Please reload all VF drivers to avoid spoofed packet " - "errors\n"); + "Virtual Functions already enabled for this device -Please reload all VF drivers to avoid spoofed packet errors\n"); } else { int err; /* The sapphire supports up to 64 VFs per physical function @@ -732,8 +730,7 @@ static int ngbe_vf_reset_msg(struct ngbe_adapter *adapter, u16 vf) } else { msgbuf[0] |= NGBE_VT_MSGTYPE_NACK; dev_warn(pci_dev_to_dev(adapter->pdev), - "VF %d has no MAC address assigned, you may have to " - "assign one manually\n", vf); + "VF %d has no MAC address assigned, you may have to assign one manually\n", vf); } /* @@ -759,15 +756,7 @@ static int ngbe_set_vf_mac_addr(struct ngbe_adapter *adapter, if (adapter->vfinfo[vf].pf_set_mac && memcmp(adapter->vfinfo[vf].vf_mac_addresses, new_mac, ETH_ALEN)) { - u8 *pm = adapter->vfinfo[vf].vf_mac_addresses; - e_warn(drv, - "VF %d attempted to set a new MAC address but it already " - "has an administratively set MAC address " - "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X\n", - vf, pm[0], pm[1], pm[2], pm[3], pm[4], pm[5]); - e_warn(drv, "Check the VF driver and if it is not using the " - "correct MAC address you may need to reload the VF " - "driver\n"); + e_warn(drv, "Check the VF driver and if it is not using the correct MAC address you may need to reload the VF driver\n"); return -1; } return ngbe_set_vf_mac(adapter, vf, new_mac) < 0; @@ -809,11 +798,8 @@ static int ngbe_set_vf_vlan_msg(struct ngbe_adapter *adapter, u8 tcs = netdev_get_num_tc(adapter->netdev); if (adapter->vfinfo[vf].pf_vlan || tcs) { - e_warn(drv, - "VF %d attempted to override administratively set VLAN " - "configuration\n" - "Reload the VF driver to resume operations\n", - vf); + e_warn(drv, "VF %d attempted to override administratively set VLAN configuration\n", vf); + e_warn(drv, "Reload the VF driver to resume operations\n"); return -1; }