File tree Expand file tree Collapse file tree 4 files changed +36
-4
lines changed
drivers/net/ethernet/emulex/benet Expand file tree Collapse file tree 4 files changed +36
-4
lines changed Original file line number Diff line number Diff line change 105
105
106
106
#define MAX_VFS 30 /* Max VFs supported by BE3 FW */
107
107
#define FW_VER_LEN 32
108
+ #define CNTL_SERIAL_NUM_WORDS 8 /* Controller serial number words */
109
+ #define CNTL_SERIAL_NUM_WORD_SZ (sizeof(u16)) /* Byte-sz of serial num word */
108
110
109
111
#define RSS_INDIR_TABLE_LEN 128
110
112
#define RSS_HASH_KEY_LEN 40
@@ -590,6 +592,7 @@ struct be_adapter {
590
592
struct rss_info rss_info ;
591
593
/* Filters for packets that need to be sent to BMC */
592
594
u32 bmc_filt_mask ;
595
+ u16 serial_num [CNTL_SERIAL_NUM_WORDS ];
593
596
};
594
597
595
598
#define be_physfn (adapter ) (!adapter->virtfn)
Original file line number Diff line number Diff line change @@ -2852,10 +2852,11 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter)
2852
2852
struct be_mcc_wrb * wrb ;
2853
2853
struct be_cmd_req_cntl_attribs * req ;
2854
2854
struct be_cmd_resp_cntl_attribs * resp ;
2855
- int status ;
2855
+ int status , i ;
2856
2856
int payload_len = max (sizeof (* req ), sizeof (* resp ));
2857
2857
struct mgmt_controller_attrib * attribs ;
2858
2858
struct be_dma_mem attribs_cmd ;
2859
+ u32 * serial_num ;
2859
2860
2860
2861
if (mutex_lock_interruptible (& adapter -> mbox_lock ))
2861
2862
return -1 ;
@@ -2886,6 +2887,10 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter)
2886
2887
if (!status ) {
2887
2888
attribs = attribs_cmd .va + sizeof (struct be_cmd_resp_hdr );
2888
2889
adapter -> hba_port_num = attribs -> hba_attribs .phy_port ;
2890
+ serial_num = attribs -> hba_attribs .controller_serial_number ;
2891
+ for (i = 0 ; i < CNTL_SERIAL_NUM_WORDS ; i ++ )
2892
+ adapter -> serial_num [i ] = le32_to_cpu (serial_num [i ]) &
2893
+ (BIT_MASK (16 ) - 1 );
2889
2894
}
2890
2895
2891
2896
err :
Original file line number Diff line number Diff line change @@ -1637,10 +1637,12 @@ struct be_cmd_req_set_qos {
1637
1637
struct mgmt_hba_attribs {
1638
1638
u32 rsvd0 [24 ];
1639
1639
u8 controller_model_number [32 ];
1640
- u32 rsvd1 [79 ];
1641
- u8 rsvd2 [3 ];
1640
+ u32 rsvd1 [16 ];
1641
+ u32 controller_serial_number [8 ];
1642
+ u32 rsvd2 [55 ];
1643
+ u8 rsvd3 [3 ];
1642
1644
u8 phy_port ;
1643
- u32 rsvd3 [13 ];
1645
+ u32 rsvd4 [13 ];
1644
1646
} __packed ;
1645
1647
1646
1648
struct mgmt_controller_attrib {
Original file line number Diff line number Diff line change @@ -5219,6 +5219,27 @@ static netdev_features_t be_features_check(struct sk_buff *skb,
5219
5219
}
5220
5220
#endif
5221
5221
5222
+ static int be_get_phys_port_id (struct net_device * dev ,
5223
+ struct netdev_phys_item_id * ppid )
5224
+ {
5225
+ int i , id_len = CNTL_SERIAL_NUM_WORDS * CNTL_SERIAL_NUM_WORD_SZ + 1 ;
5226
+ struct be_adapter * adapter = netdev_priv (dev );
5227
+ u8 * id ;
5228
+
5229
+ if (MAX_PHYS_ITEM_ID_LEN < id_len )
5230
+ return - ENOSPC ;
5231
+
5232
+ ppid -> id [0 ] = adapter -> hba_port_num + 1 ;
5233
+ id = & ppid -> id [1 ];
5234
+ for (i = CNTL_SERIAL_NUM_WORDS - 1 ; i >= 0 ;
5235
+ i -- , id += CNTL_SERIAL_NUM_WORD_SZ )
5236
+ memcpy (id , & adapter -> serial_num [i ], CNTL_SERIAL_NUM_WORD_SZ );
5237
+
5238
+ ppid -> id_len = id_len ;
5239
+
5240
+ return 0 ;
5241
+ }
5242
+
5222
5243
static const struct net_device_ops be_netdev_ops = {
5223
5244
.ndo_open = be_open ,
5224
5245
.ndo_stop = be_close ,
@@ -5249,6 +5270,7 @@ static const struct net_device_ops be_netdev_ops = {
5249
5270
.ndo_del_vxlan_port = be_del_vxlan_port ,
5250
5271
.ndo_features_check = be_features_check ,
5251
5272
#endif
5273
+ .ndo_get_phys_port_id = be_get_phys_port_id ,
5252
5274
};
5253
5275
5254
5276
static void be_netdev_init (struct net_device * netdev )
You can’t perform that action at this time.
0 commit comments