4646#include <linux/spinlock.h>
4747#include <linux/timer.h>
4848#include <linux/vmalloc.h>
49+ #include <linux/etherdevice.h>
4950#include <asm/io.h>
5051#include "cxgb4_uld.h"
5152
5253#define CH_WARN (adap , fmt , ...) dev_warn(adap->pdev_dev, fmt, ## __VA_ARGS__)
5354
5455enum {
55- MAX_NPORTS = 4 , /* max # of ports */
56- SERNUM_LEN = 24 , /* Serial # length */
57- EC_LEN = 16 , /* E/C length */
58- ID_LEN = 16 , /* ID length */
59- PN_LEN = 16 , /* Part Number length */
56+ MAX_NPORTS = 4 , /* max # of ports */
57+ SERNUM_LEN = 24 , /* Serial # length */
58+ EC_LEN = 16 , /* E/C length */
59+ ID_LEN = 16 , /* ID length */
60+ PN_LEN = 16 , /* Part Number length */
61+ MACADDR_LEN = 12 , /* MAC Address length */
6062};
6163
6264enum {
@@ -280,6 +282,7 @@ struct vpd_params {
280282 u8 sn [SERNUM_LEN + 1 ];
281283 u8 id [ID_LEN + 1 ];
282284 u8 pn [PN_LEN + 1 ];
285+ u8 na [MACADDR_LEN + 1 ];
283286};
284287
285288struct pci_params {
@@ -945,6 +948,22 @@ static inline void t4_write_reg64(struct adapter *adap, u32 reg_addr, u64 val)
945948 writeq (val , adap -> regs + reg_addr );
946949}
947950
951+ /**
952+ * t4_set_hw_addr - store a port's MAC address in SW
953+ * @adapter: the adapter
954+ * @port_idx: the port index
955+ * @hw_addr: the Ethernet address
956+ *
957+ * Store the Ethernet address of the given port in SW. Called by the common
958+ * code when it retrieves a port's Ethernet address from EEPROM.
959+ */
960+ static inline void t4_set_hw_addr (struct adapter * adapter , int port_idx ,
961+ u8 hw_addr [])
962+ {
963+ ether_addr_copy (adapter -> port [port_idx ]-> dev_addr , hw_addr );
964+ ether_addr_copy (adapter -> port [port_idx ]-> perm_addr , hw_addr );
965+ }
966+
948967/**
949968 * netdev2pinfo - return the port_info structure associated with a net_device
950969 * @dev: the netdev
@@ -1229,7 +1248,7 @@ void t4_intr_disable(struct adapter *adapter);
12291248int t4_slow_intr_handler (struct adapter * adapter );
12301249
12311250int t4_wait_dev_ready (void __iomem * regs );
1232- int t4_link_start (struct adapter * adap , unsigned int mbox , unsigned int port ,
1251+ int t4_link_l1cfg (struct adapter * adap , unsigned int mbox , unsigned int port ,
12331252 struct link_config * lc );
12341253int t4_restart_aneg (struct adapter * adap , unsigned int mbox , unsigned int port );
12351254
@@ -1251,7 +1270,8 @@ unsigned int t4_get_regs_len(struct adapter *adapter);
12511270void t4_get_regs (struct adapter * adap , void * buf , size_t buf_size );
12521271
12531272int t4_seeprom_wp (struct adapter * adapter , bool enable );
1254- int get_vpd_params (struct adapter * adapter , struct vpd_params * p );
1273+ int t4_get_raw_vpd_params (struct adapter * adapter , struct vpd_params * p );
1274+ int t4_get_vpd_params (struct adapter * adapter , struct vpd_params * p );
12551275int t4_read_flash (struct adapter * adapter , unsigned int addr ,
12561276 unsigned int nwords , u32 * data , int byte_oriented );
12571277int t4_load_fw (struct adapter * adapter , const u8 * fw_data , unsigned int size );
@@ -1378,6 +1398,9 @@ int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf,
13781398int t4_alloc_vi (struct adapter * adap , unsigned int mbox , unsigned int port ,
13791399 unsigned int pf , unsigned int vf , unsigned int nmac , u8 * mac ,
13801400 unsigned int * rss_size );
1401+ int t4_free_vi (struct adapter * adap , unsigned int mbox ,
1402+ unsigned int pf , unsigned int vf ,
1403+ unsigned int viid );
13811404int t4_set_rxmode (struct adapter * adap , unsigned int mbox , unsigned int viid ,
13821405 int mtu , int promisc , int all_multi , int bcast , int vlanex ,
13831406 bool sleep_ok );
@@ -1407,6 +1430,7 @@ int t4_ctrl_eq_free(struct adapter *adap, unsigned int mbox, unsigned int pf,
14071430 unsigned int vf , unsigned int eqid );
14081431int t4_ofld_eq_free (struct adapter * adap , unsigned int mbox , unsigned int pf ,
14091432 unsigned int vf , unsigned int eqid );
1433+ int t4_sge_ctxt_flush (struct adapter * adap , unsigned int mbox );
14101434int t4_handle_fw_rpl (struct adapter * adap , const __be64 * rpl );
14111435void t4_db_full (struct adapter * adapter );
14121436void t4_db_dropped (struct adapter * adapter );
0 commit comments