未验证 提交 88ff0e2d 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!277 net: ngbe: fix ngbe checkpatch warnnings

Merge Pull Request from: @duanqiangwen 
 
This PR is t fix Beijing WangXun Technology Co. net-swift ngbe NIC coding style warnings.

Issue:https://gitee.com/openeuler/kernel/issues/I61PSD

Net-Swift Official Website:
https://www.net-swift.com
ngbe Out-of-Tree Linux Driver Source Code:
Click https://www.net-swift.com/p/contact to contact us. 
 
Link:https://gitee.com/openeuler/kernel/pulls/277 
Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
Reviewed-by: Xie XiuQi <xiexiuqi@huawei.com> 
Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> 
...@@ -526,7 +526,7 @@ ngbe_regdump(struct ngbe_hw *hw, struct ngbe_reg_info *reg_info) ...@@ -526,7 +526,7 @@ ngbe_regdump(struct ngbe_hw *hw, struct ngbe_reg_info *reg_info)
default: default:
for (i = 0; i < reg_info->length; i++) { for (i = 0; i < reg_info->length; i++) {
buffer[n++] = rd32(hw, buffer[n++] = rd32(hw,
reg_info->offset + i << 2); reg_info->offset + (i << 2));
} }
break; break;
} }
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
#define NGBE_SP_VFT_TBL_SIZE 128 #define NGBE_SP_VFT_TBL_SIZE 128
#define NGBE_SP_RX_PB_SIZE 42 #define NGBE_SP_RX_PB_SIZE 42
STATIC s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw); static s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw);
STATIC void ngbe_release_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_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, u32 speed,
bool need_restart_AN); bool need_restart_AN);
s32 ngbe_check_mac_link(struct ngbe_hw *hw, u32 *speed, 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) ...@@ -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 * 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; s32 status = NGBE_ERR_EEPROM;
u32 timeout = 2000; u32 timeout = 2000;
...@@ -549,7 +549,7 @@ STATIC s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw) ...@@ -549,7 +549,7 @@ STATIC s32 ngbe_get_eeprom_semaphore(struct ngbe_hw *hw)
* *
* This function clears hardware semaphore bits. * 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)) { if (ngbe_check_mng_access(hw)) {
wr32m(hw, NGBE_MNG_SW_SM, wr32m(hw, NGBE_MNG_SW_SM,
...@@ -847,7 +847,7 @@ s32 ngbe_update_uc_addr_list(struct ngbe_hw *hw, u8 *addr_list, ...@@ -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 * by the MO field of the MCSTCTRL. The MO field is set during initialization
* to mc_filter_type. * 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; u32 vector = 0;
...@@ -1133,13 +1133,12 @@ s32 ngbe_fc_enable(struct ngbe_hw *hw) ...@@ -1133,13 +1133,12 @@ s32 ngbe_fc_enable(struct ngbe_hw *hw)
* Find the intersection between advertised settings and link partner's * Find the intersection between advertised settings and link partner's
* advertised settings * 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) u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm)
{ {
if ((!(adv_reg)) || (!(lp_reg))) { if ((!(adv_reg)) || (!(lp_reg))) {
ERROR_REPORT3(NGBE_ERROR_UNSUPPORTED, ERROR_REPORT3(NGBE_ERROR_UNSUPPORTED,
"Local or link partner's advertised flow control " "Local or link partner's advertised flow control settings are NULL. Local: %x, link partner: %x\n",
"settings are NULL. Local: %x, link partner: %x\n",
adv_reg, lp_reg); adv_reg, lp_reg);
return NGBE_ERR_FC_NOT_NEGOTIATED; 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, ...@@ -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. * 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 technology_ability_reg = 0;
u8 lp_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) ...@@ -1310,15 +1309,16 @@ s32 ngbe_acquire_swfw_sync(struct ngbe_hw *hw, u32 mask)
if (ngbe_check_mng_access(hw)) { if (ngbe_check_mng_access(hw)) {
gssr = rd32(hw, NGBE_MNG_SWFW_SYNC); 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; gssr |= swmask;
wr32(hw, NGBE_MNG_SWFW_SYNC, gssr); wr32(hw, NGBE_MNG_SWFW_SYNC, gssr);
ngbe_release_eeprom_semaphore(hw); ngbe_release_eeprom_semaphore(hw);
return 0; 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) ...@@ -1371,9 +1371,8 @@ s32 ngbe_disable_sec_rx_path(struct ngbe_hw *hw)
secrxreg = rd32(hw, NGBE_RSEC_ST); secrxreg = rd32(hw, NGBE_RSEC_ST);
if (secrxreg & NGBE_RSEC_ST_RSEC_RDY) if (secrxreg & NGBE_RSEC_ST_RSEC_RDY)
break; break;
else
/* Use interrupt-safe sleep just in case */ /* Use interrupt-safe sleep just in case */
usec_delay(1000); usec_delay(1000);
} }
/* For informational purposes only */ /* For informational purposes only */
...@@ -2680,14 +2679,14 @@ void ngbe_set_rxpba(struct ngbe_hw *hw, int num_pb, u32 headroom, ...@@ -2680,14 +2679,14 @@ void ngbe_set_rxpba(struct ngbe_hw *hw, int num_pb, u32 headroom,
wr32(hw, NGBE_TDM_PB_THRE, txpbthresh); 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_INTERNAL_DATA,
NGBE_EMC_DIODE1_DATA, NGBE_EMC_DIODE1_DATA,
NGBE_EMC_DIODE2_DATA, NGBE_EMC_DIODE2_DATA,
NGBE_EMC_DIODE3_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_INTERNAL_THERM_LIMIT,
NGBE_EMC_DIODE1_THERM_LIMIT, NGBE_EMC_DIODE1_THERM_LIMIT,
NGBE_EMC_DIODE2_THERM_LIMIT, NGBE_EMC_DIODE2_THERM_LIMIT,
...@@ -2895,7 +2894,7 @@ int ngbe_check_flash_load(struct ngbe_hw *hw, u32 check_bit) ...@@ -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 */ /* 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 */ /* 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(0x00),
NGBE_UKN(0x01), NGBE_UKN(0x01),
NGBE_UKN(0x02), NGBE_UKN(0x02),
...@@ -3179,6 +3178,16 @@ ngbe_dptype ngbe_ptype_lookup[256] = { ...@@ -3179,6 +3178,16 @@ ngbe_dptype ngbe_ptype_lookup[256] = {
NGBE_UKN(0xFF), 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) void ngbe_init_mac_link_ops(struct ngbe_hw *hw)
{ {
struct ngbe_mac_info *mac = &hw->mac; struct ngbe_mac_info *mac = &hw->mac;
...@@ -3353,7 +3362,7 @@ enum ngbe_media_type ngbe_get_media_type(struct ngbe_hw *hw) ...@@ -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) 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, ...@@ -3418,7 +3427,6 @@ s32 ngbe_setup_mac_link(struct ngbe_hw *hw,
return status; return status;
} }
/** /**
* ngbe_setup_copper_link - Set the PHY autoneg advertised field * ngbe_setup_copper_link - Set the PHY autoneg advertised field
* @hw: pointer to hardware structure * @hw: pointer to hardware structure
...@@ -3986,7 +3994,6 @@ s32 ngbe_phy_led_oem_chk(struct ngbe_hw *hw, u32 *data) ...@@ -3986,7 +3994,6 @@ s32 ngbe_phy_led_oem_chk(struct ngbe_hw *hw, u32 *data)
/* one word */ /* one word */
buffer.length = 0; buffer.length = 0;
status = ngbe_host_interface_command(hw, (u32 *)&buffer, status = ngbe_host_interface_command(hw, (u32 *)&buffer,
sizeof(buffer), sizeof(buffer),
NGBE_HI_COMMAND_TIMEOUT, false); NGBE_HI_COMMAND_TIMEOUT, false);
...@@ -4529,12 +4536,13 @@ s32 ngbe_check_mac_link(struct ngbe_hw *hw, ...@@ -4529,12 +4536,13 @@ s32 ngbe_check_mac_link(struct ngbe_hw *hw,
if (link_up_wait_to_complete) { if (link_up_wait_to_complete) {
for (i = 0; i < NGBE_LINK_UP_TIME; i++) { for (i = 0; i < NGBE_LINK_UP_TIME; i++) {
status = TCALL(hw, phy.ops.read_reg, 0x1A, 0xA43, &value); status = TCALL(hw, phy.ops.read_reg, 0x1A, 0xA43, &value);
if (!status && (value & 0x4)) { if (!status && (value & 0x4))
*link_up = true; *link_up = true;
break; else
} else {
*link_up = false; *link_up = false;
}
if (*link_up == true)
break;
msleep(100); msleep(100);
} }
} else { } else {
...@@ -4580,12 +4588,13 @@ s32 ngbe_check_mac_link_mdi(struct ngbe_hw *hw, ...@@ -4580,12 +4588,13 @@ s32 ngbe_check_mac_link_mdi(struct ngbe_hw *hw,
if (link_up_wait_to_complete) { if (link_up_wait_to_complete) {
for (i = 0; i < NGBE_LINK_UP_TIME; i++) { for (i = 0; i < NGBE_LINK_UP_TIME; i++) {
status = TCALL(hw, phy.ops.read_reg_mdi, 17, 0, &value); status = TCALL(hw, phy.ops.read_reg_mdi, 17, 0, &value);
if (value & 0x400) { if (value & 0x400)
*link_up = true; *link_up = true;
break; else
} else {
*link_up = false; *link_up = false;
}
if (*link_up == true)
break;
msleep(100); msleep(100);
} }
} else { } else {
...@@ -4623,12 +4632,13 @@ s32 ngbe_check_mac_link_yt8521s(struct ngbe_hw *hw, ...@@ -4623,12 +4632,13 @@ s32 ngbe_check_mac_link_yt8521s(struct ngbe_hw *hw,
if (link_up_wait_to_complete) { if (link_up_wait_to_complete) {
for (i = 0; i < NGBE_LINK_UP_TIME; i++) { for (i = 0; i < NGBE_LINK_UP_TIME; i++) {
status = ngbe_phy_read_reg_sds_mii_yt8521s(hw, 0x11, 0, &value); status = ngbe_phy_read_reg_sds_mii_yt8521s(hw, 0x11, 0, &value);
if (value & 0x400) { if (value & 0x400)
*link_up = true; *link_up = true;
break; else
} else {
*link_up = false; *link_up = false;
}
if (*link_up == true)
break;
msleep(100); msleep(100);
} }
} else { } else {
......
...@@ -112,8 +112,9 @@ struct ngbe_dec_ptype { ...@@ -112,8 +112,9 @@ struct ngbe_dec_ptype {
u32 prot:4; /* payload proto */ u32 prot:4; /* payload proto */
u32 layer:3; /* payload layer */ 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); u16 ngbe_get_pcie_msix_count(struct ngbe_hw *hw);
s32 ngbe_init_hw(struct ngbe_hw *hw); s32 ngbe_init_hw(struct ngbe_hw *hw);
s32 ngbe_start_hw(struct ngbe_hw *hw); s32 ngbe_start_hw(struct ngbe_hw *hw);
......
...@@ -36,12 +36,9 @@ const char ngbe_driver_version[32] = DRV_VERSION; ...@@ -36,12 +36,9 @@ const char ngbe_driver_version[32] = DRV_VERSION;
static const char ngbe_copyright[] = static const char ngbe_copyright[] =
"Copyright (c) 2018 -2019 Beijing WangXun Technology Co., Ltd"; "Copyright (c) 2018 -2019 Beijing WangXun Technology Co., Ltd";
static const char ngbe_overheat_msg[] = static const char ngbe_overheat_msg[] =
"Network adapter has been stopped because it has over heated. " "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";
"If the problem persists, restart the computer, or "
"power off the system and replace the adapter";
static const char ngbe_underheat_msg[] = static const char ngbe_underheat_msg[] =
"Network adapter has been started again since the temperature " "Network adapter has been started again since the temperature has been back to normal state";
"has been back to normal state";
/* ngbe_pci_tbl - PCI Device ID Table /* 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); ...@@ -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_rx_ring(struct ngbe_ring *rx_ring);
static void ngbe_clean_tx_ring(struct ngbe_ring *tx_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, static void ngbe_check_minimum_link(struct ngbe_adapter *adapter,
int expected_gts) int expected_gts)
{ {
...@@ -690,7 +674,7 @@ static inline void ngbe_rx_checksum(struct ngbe_ring *ring, ...@@ -690,7 +674,7 @@ static inline void ngbe_rx_checksum(struct ngbe_ring *ring,
union ngbe_rx_desc *rx_desc, union ngbe_rx_desc *rx_desc,
struct sk_buff *skb) 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; skb->ip_summed = CHECKSUM_NONE;
...@@ -3117,9 +3101,7 @@ static int ngbe_hpbthresh(struct ngbe_adapter *adapter) ...@@ -3117,9 +3101,7 @@ static int ngbe_hpbthresh(struct ngbe_adapter *adapter)
* to user and a do the best we can. * to user and a do the best we can.
*/ */
if (marker < 0) { if (marker < 0) {
e_warn(drv, "Packet Buffer can not provide enough" e_warn(drv, "Packet Buffer can not provide enough headroom to support flow control. Decrease MTU or number of traffic classes\n");
"headroom to support flow control."
"Decrease MTU or number of traffic classes\n");
marker = tc + 1; marker = tc + 1;
} }
...@@ -3127,7 +3109,7 @@ static int ngbe_hpbthresh(struct ngbe_adapter *adapter) ...@@ -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 * @adapter: board private structure to calculate for
* @pb - packet buffer to calculate * @pb - packet buffer to calculate
...@@ -3393,12 +3375,7 @@ void ngbe_reset(struct ngbe_adapter *adapter) ...@@ -3393,12 +3375,7 @@ void ngbe_reset(struct ngbe_adapter *adapter)
break; break;
case NGBE_ERR_EEPROM_VERSION: case NGBE_ERR_EEPROM_VERSION:
/* We are running on a pre-production device, log a warning */ /* We are running on a pre-production device, log a warning */
e_dev_warn("This device is a pre-production adapter/LOM. " e_dev_warn("This device is a pre-production adapter/LOM.\n");
"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");
break; break;
default: default:
e_dev_err("Hardware Error: %d\n", err); e_dev_err("Hardware Error: %d\n", err);
...@@ -5196,7 +5173,7 @@ union network_header { ...@@ -5196,7 +5173,7 @@ union network_header {
void *raw; 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; struct sk_buff *skb = first->skb;
u8 tun_prot = 0; u8 tun_prot = 0;
...@@ -5318,7 +5295,7 @@ static ngbe_dptype encode_tx_desc_ptype(const struct ngbe_tx_buffer *first) ...@@ -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, static int ngbe_tso(struct ngbe_ring *tx_ring,
struct ngbe_tx_buffer *first, 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; struct sk_buff *skb = first->skb;
u32 vlan_macip_lens, type_tucmd; u32 vlan_macip_lens, type_tucmd;
...@@ -5441,7 +5418,7 @@ static int ngbe_tso(struct ngbe_ring *tx_ring, ...@@ -5441,7 +5418,7 @@ static int ngbe_tso(struct ngbe_ring *tx_ring,
} }
static void ngbe_tx_csum(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; struct sk_buff *skb = first->skb;
u32 vlan_macip_lens = 0; u32 vlan_macip_lens = 0;
...@@ -5851,7 +5828,7 @@ netdev_tx_t ngbe_xmit_frame_ring(struct sk_buff *skb, ...@@ -5851,7 +5828,7 @@ netdev_tx_t ngbe_xmit_frame_ring(struct sk_buff *skb,
u16 count = TXD_USE_COUNT(skb_headlen(skb)); u16 count = TXD_USE_COUNT(skb_headlen(skb));
__be16 protocol = skb->protocol; __be16 protocol = skb->protocol;
u8 hdr_len = 0; u8 hdr_len = 0;
ngbe_dptype dptype; struct ngbe_dec_ptype dptype;
/* need: 1 descriptor per page * PAGE_SIZE/NGBE_MAX_DATA_PER_TXD, /* need: 1 descriptor per page * PAGE_SIZE/NGBE_MAX_DATA_PER_TXD,
* + 1 desc for skb_headlen/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, ...@@ -6597,12 +6574,7 @@ static int ngbe_probe(struct pci_dev *pdev,
err = TCALL(hw, mac.ops.start_hw); err = TCALL(hw, mac.ops.start_hw);
if (err == NGBE_ERR_EEPROM_VERSION) { if (err == NGBE_ERR_EEPROM_VERSION) {
/* We are running on a pre-production device, log a warning */ /* We are running on a pre-production device, log a warning */
e_dev_warn("This device is a pre-production adapter/LOM. " e_dev_warn("This device is a pre-production adapter/LOM.\n");
"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");
} else if (err) { } else if (err) {
e_dev_err("HW init failed, err = %d\n", err); e_dev_err("HW init failed, err = %d\n", err);
goto err_register; goto err_register;
......
...@@ -39,10 +39,8 @@ ...@@ -39,10 +39,8 @@
* *
* Default Value: 2 * Default Value: 2
*/ */
NGBE_PARAM(InterruptType, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), " NGBE_PARAM(InterruptType, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default IntMode (deprecated)");
"default IntMode (deprecated)"); NGBE_PARAM(IntMode, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), default 2");
NGBE_PARAM(IntMode, "Change Interrupt Mode (0=Legacy, 1=MSI, 2=MSI-X), "
"default 2");
#define NGBE_INT_LEGACY 0 #define NGBE_INT_LEGACY 0
#define NGBE_INT_MSI 1 #define NGBE_INT_MSI 1
#define NGBE_INT_MSIX 2 #define NGBE_INT_MSIX 2
...@@ -68,8 +66,7 @@ NGBE_PARAM(MQ, "Disable or enable Multiple Queues, default 1"); ...@@ -68,8 +66,7 @@ NGBE_PARAM(MQ, "Disable or enable Multiple Queues, default 1");
* Default Value: 0 * Default Value: 0
*/ */
NGBE_PARAM(RSS, "Number of Receive-Side Scaling Descriptor Queues, " NGBE_PARAM(RSS, "Number of Receive-Side Scaling Descriptor Queues, default 0=number of cpus");
"default 0=number of cpus");
/* VMDQ - Virtual Machine Device Queues (VMDQ) /* VMDQ - Virtual Machine Device Queues (VMDQ)
* *
...@@ -82,8 +79,7 @@ NGBE_PARAM(RSS, "Number of Receive-Side Scaling Descriptor Queues, " ...@@ -82,8 +79,7 @@ NGBE_PARAM(RSS, "Number of Receive-Side Scaling Descriptor Queues, "
#define NGBE_DEFAULT_NUM_VMDQ 8 #define NGBE_DEFAULT_NUM_VMDQ 8
NGBE_PARAM(VMDQ, "Number of Virtual Machine Device Queues: 0/1 = disable, " NGBE_PARAM(VMDQ, "Number of Virtual Machine Device Queues: 0/1 = disable, 2-16 enable (default=" XSTRINGIFY(NGBE_DEFAULT_NUM_VMDQ) ")");
"2-16 enable (default=" XSTRINGIFY(NGBE_DEFAULT_NUM_VMDQ) ")");
#ifdef CONFIG_PCI_IOV #ifdef CONFIG_PCI_IOV
/* max_vfs - SR I/O Virtualization /* max_vfs - SR I/O Virtualization
...@@ -97,9 +93,7 @@ NGBE_PARAM(VMDQ, "Number of Virtual Machine Device Queues: 0/1 = disable, " ...@@ -97,9 +93,7 @@ NGBE_PARAM(VMDQ, "Number of Virtual Machine Device Queues: 0/1 = disable, "
#define MAX_SRIOV_VFS 8 #define MAX_SRIOV_VFS 8
NGBE_PARAM(max_vfs, "Number of Virtual Functions: 0 = disable (default), " NGBE_PARAM(max_vfs, "Number of Virtual Functions: 0 = disable (default), 1-" XSTRINGIFY(MAX_SRIOV_VFS) " = enable this many VFs");
"1-" XSTRINGIFY(MAX_SRIOV_VFS) " = enable "
"this many VFs");
/* VEPA - Set internal bridge to VEPA mode /* VEPA - Set internal bridge to VEPA mode
* *
...@@ -217,8 +211,7 @@ NGBE_PARAM(dmac_watchdog, ...@@ -217,8 +211,7 @@ NGBE_PARAM(dmac_watchdog,
* *
* Default Value: 0 * Default Value: 0
*/ */
NGBE_PARAM(RxBufferMode, "0=(default)no header split\n" NGBE_PARAM(RxBufferMode, "0=(default)no header split\n\t\t\t1=hdr split for recognized packet\n");
"\t\t\t1=hdr split for recognized packet\n");
#define NGBE_RXBUFMODE_NO_HEADER_SPLIT 0 #define NGBE_RXBUFMODE_NO_HEADER_SPLIT 0
#define NGBE_RXBUFMODE_HEADER_SPLIT 1 #define NGBE_RXBUFMODE_HEADER_SPLIT 1
...@@ -481,9 +474,7 @@ void ngbe_check_options(struct ngbe_adapter *adapter) ...@@ -481,9 +474,7 @@ void ngbe_check_options(struct ngbe_adapter *adapter)
if (*aflags & NGBE_FLAG_VMDQ_ENABLED) { if (*aflags & NGBE_FLAG_VMDQ_ENABLED) {
if (!(*aflags & NGBE_FLAG_MQ_CAPABLE)) { if (!(*aflags & NGBE_FLAG_MQ_CAPABLE)) {
DPRINTK(PROBE, INFO, DPRINTK(PROBE, INFO,
"VMDQ is not supported while multiple " "VMDQ is not supported while multiple queues are disabled. Disabling VMDQ.\n");
"queues are disabled. "
"Disabling VMDQ.\n");
*aflags &= ~NGBE_FLAG_VMDQ_ENABLED; *aflags &= ~NGBE_FLAG_VMDQ_ENABLED;
feature[RING_F_VMDQ].limit = 0; feature[RING_F_VMDQ].limit = 0;
} }
......
...@@ -84,14 +84,16 @@ s32 ngbe_check_internal_phy_id(struct ngbe_hw *hw) ...@@ -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); 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; 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, ERROR_REPORT1(NGBE_ERROR_UNSUPPORTED,
"internal phy id 0x%x not supported.\n", phy_id); "internal phy id 0x%x not supported.\n", phy_id);
return NGBE_ERR_DEVICE_NOT_SUPPORTED; return NGBE_ERR_DEVICE_NOT_SUPPORTED;
} else {
hw->phy.id = (u32)phy_id;
} }
return NGBE_OK; return NGBE_OK;
} }
...@@ -259,6 +261,7 @@ s32 ngbe_phy_write_reg_sds_mii_yt8521s(struct ngbe_hw *hw, ...@@ -259,6 +261,7 @@ s32 ngbe_phy_write_reg_sds_mii_yt8521s(struct ngbe_hw *hw,
u16 phy_data) u16 phy_data)
{ {
s32 status = 0; s32 status = 0;
status = ngbe_phy_write_reg_ext_yt8521s(hw, 0xa000, device_type, 0x02); status = ngbe_phy_write_reg_ext_yt8521s(hw, 0xa000, device_type, 0x02);
if (!status) if (!status)
...@@ -288,12 +291,13 @@ s32 ngbe_check_mdi_phy_id(struct ngbe_hw *hw) ...@@ -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); 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; 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, 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; return NGBE_ERR_DEVICE_NOT_SUPPORTED;
} else {
hw->phy.id = phy_id;
} }
if (hw->phy.type == ngbe_phy_m88e1512_unknown) { if (hw->phy.type == ngbe_phy_m88e1512_unknown) {
...@@ -363,13 +367,13 @@ s32 ngbe_check_yt_phy_id(struct ngbe_hw *hw) ...@@ -363,13 +367,13 @@ s32 ngbe_check_yt_phy_id(struct ngbe_hw *hw)
return NGBE_ERR_DEVICE_NOT_SUPPORTED; return NGBE_ERR_DEVICE_NOT_SUPPORTED;
ngbe_phy_read_reg_sds_mii_yt8521s(hw, 0x3, 0, &phy_id); 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, 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; return NGBE_ERR_DEVICE_NOT_SUPPORTED;
} else {
hw->phy.id = phy_id;
} }
return NGBE_OK; return NGBE_OK;
......
...@@ -751,13 +751,13 @@ static long ngbe_ptp_create_clock(struct ngbe_adapter *adapter) ...@@ -751,13 +751,13 @@ static long ngbe_ptp_create_clock(struct ngbe_adapter *adapter)
adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps, adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps,
pci_dev_to_dev(adapter->pdev)); 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); err = PTR_ERR(adapter->ptp_clock);
adapter->ptp_clock = NULL; adapter->ptp_clock = NULL;
e_dev_err("ptp_clock_register failed\n"); e_dev_err("ptp_clock_register failed\n");
return err; 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 /* Set the default timestamp mode to disabled here. We do this in
......
...@@ -174,9 +174,7 @@ void ngbe_enable_sriov(struct ngbe_adapter *adapter) ...@@ -174,9 +174,7 @@ void ngbe_enable_sriov(struct ngbe_adapter *adapter)
if (pre_existing_vfs) { if (pre_existing_vfs) {
adapter->num_vfs = pre_existing_vfs; adapter->num_vfs = pre_existing_vfs;
dev_warn(&adapter->pdev->dev, dev_warn(&adapter->pdev->dev,
"Virtual Functions already enabled for this device -" "Virtual Functions already enabled for this device -Please reload all VF drivers to avoid spoofed packet errors\n");
"Please reload all VF drivers to avoid spoofed packet "
"errors\n");
} else { } else {
int err; int err;
/* The sapphire supports up to 64 VFs per physical function /* 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) ...@@ -732,8 +730,7 @@ static int ngbe_vf_reset_msg(struct ngbe_adapter *adapter, u16 vf)
} else { } else {
msgbuf[0] |= NGBE_VT_MSGTYPE_NACK; msgbuf[0] |= NGBE_VT_MSGTYPE_NACK;
dev_warn(pci_dev_to_dev(adapter->pdev), dev_warn(pci_dev_to_dev(adapter->pdev),
"VF %d has no MAC address assigned, you may have to " "VF %d has no MAC address assigned, you may have to assign one manually\n", vf);
"assign one manually\n", vf);
} }
/* /*
...@@ -759,15 +756,7 @@ static int ngbe_set_vf_mac_addr(struct ngbe_adapter *adapter, ...@@ -759,15 +756,7 @@ static int ngbe_set_vf_mac_addr(struct ngbe_adapter *adapter,
if (adapter->vfinfo[vf].pf_set_mac && if (adapter->vfinfo[vf].pf_set_mac &&
memcmp(adapter->vfinfo[vf].vf_mac_addresses, new_mac, memcmp(adapter->vfinfo[vf].vf_mac_addresses, new_mac,
ETH_ALEN)) { ETH_ALEN)) {
u8 *pm = adapter->vfinfo[vf].vf_mac_addresses; 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,
"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");
return -1; return -1;
} }
return ngbe_set_vf_mac(adapter, vf, new_mac) < 0; 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, ...@@ -809,11 +798,8 @@ static int ngbe_set_vf_vlan_msg(struct ngbe_adapter *adapter,
u8 tcs = netdev_get_num_tc(adapter->netdev); u8 tcs = netdev_get_num_tc(adapter->netdev);
if (adapter->vfinfo[vf].pf_vlan || tcs) { if (adapter->vfinfo[vf].pf_vlan || tcs) {
e_warn(drv, e_warn(drv, "VF %d attempted to override administratively set VLAN configuration\n", vf);
"VF %d attempted to override administratively set VLAN " e_warn(drv, "Reload the VF driver to resume operations\n");
"configuration\n"
"Reload the VF driver to resume operations\n",
vf);
return -1; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册