@@ -1523,6 +1523,9 @@ int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *);
15231523void qlcnic_add_lb_filter (struct qlcnic_adapter * , struct sk_buff * , int ,
15241524 __le16 );
15251525int qlcnic_83xx_configure_opmode (struct qlcnic_adapter * adapter );
1526+ int qlcnic_read_mac_addr (struct qlcnic_adapter * );
1527+ int qlcnic_setup_netdev (struct qlcnic_adapter * , struct net_device * , int );
1528+
15261529/*
15271530 * QLOGIC Board information
15281531 */
@@ -1647,7 +1650,10 @@ static inline int qlcnic_alloc_mbx_args(struct qlcnic_cmd_args *mbx,
16471650static inline int qlcnic_issue_cmd (struct qlcnic_adapter * adapter ,
16481651 struct qlcnic_cmd_args * cmd )
16491652{
1650- return adapter -> ahw -> hw_ops -> mbx_cmd (adapter , cmd );
1653+ if (adapter -> ahw -> hw_ops -> mbx_cmd )
1654+ return adapter -> ahw -> hw_ops -> mbx_cmd (adapter , cmd );
1655+
1656+ return - EIO ;
16511657}
16521658
16531659static inline void qlcnic_get_func_no (struct qlcnic_adapter * adapter )
@@ -1667,12 +1673,14 @@ static inline void qlcnic_api_unlock(struct qlcnic_adapter *adapter)
16671673
16681674static inline void qlcnic_add_sysfs (struct qlcnic_adapter * adapter )
16691675{
1670- adapter -> ahw -> hw_ops -> add_sysfs (adapter );
1676+ if (adapter -> ahw -> hw_ops -> add_sysfs )
1677+ adapter -> ahw -> hw_ops -> add_sysfs (adapter );
16711678}
16721679
16731680static inline void qlcnic_remove_sysfs (struct qlcnic_adapter * adapter )
16741681{
1675- adapter -> ahw -> hw_ops -> remove_sysfs (adapter );
1682+ if (adapter -> ahw -> hw_ops -> remove_sysfs )
1683+ adapter -> ahw -> hw_ops -> remove_sysfs (adapter );
16761684}
16771685
16781686static inline void
@@ -1790,12 +1798,14 @@ static inline int qlcnic_get_board_info(struct qlcnic_adapter *adapter)
17901798static inline void qlcnic_dev_request_reset (struct qlcnic_adapter * adapter ,
17911799 u32 key )
17921800{
1793- adapter -> nic_ops -> request_reset (adapter , key );
1801+ if (adapter -> nic_ops -> request_reset )
1802+ adapter -> nic_ops -> request_reset (adapter , key );
17941803}
17951804
17961805static inline void qlcnic_cancel_idc_work (struct qlcnic_adapter * adapter )
17971806{
1798- adapter -> nic_ops -> cancel_idc_work (adapter );
1807+ if (adapter -> nic_ops -> cancel_idc_work )
1808+ adapter -> nic_ops -> cancel_idc_work (adapter );
17991809}
18001810
18011811static inline irqreturn_t
@@ -1842,7 +1852,9 @@ extern const struct ethtool_ops qlcnic_ethtool_failed_ops;
18421852 } while (0)
18431853
18441854#define PCI_DEVICE_ID_QLOGIC_QLE834X 0x8030
1855+ #define PCI_DEVICE_ID_QLOGIC_VF_QLE834X 0x8430
18451856#define PCI_DEVICE_ID_QLOGIC_QLE824X 0x8020
1857+
18461858static inline bool qlcnic_82xx_check (struct qlcnic_adapter * adapter )
18471859{
18481860 unsigned short device = adapter -> pdev -> device ;
@@ -1852,12 +1864,23 @@ static inline bool qlcnic_82xx_check(struct qlcnic_adapter *adapter)
18521864static inline bool qlcnic_83xx_check (struct qlcnic_adapter * adapter )
18531865{
18541866 unsigned short device = adapter -> pdev -> device ;
1855- return (device == PCI_DEVICE_ID_QLOGIC_QLE834X ) ? true : false;
1867+ bool status ;
1868+
1869+ status = ((device == PCI_DEVICE_ID_QLOGIC_QLE834X ) ||
1870+ (device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X )) ? true : false;
1871+
1872+ return status ;
18561873}
18571874
18581875static inline bool qlcnic_sriov_pf_check (struct qlcnic_adapter * adapter )
18591876{
18601877 return (adapter -> ahw -> op_mode == QLCNIC_SRIOV_PF_FUNC ) ? true : false;
18611878}
18621879
1880+ static inline bool qlcnic_sriov_vf_check (struct qlcnic_adapter * adapter )
1881+ {
1882+ unsigned short device = adapter -> pdev -> device ;
1883+
1884+ return (device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X ) ? true : false;
1885+ }
18631886#endif /* __QLCNIC_H_ */
0 commit comments