@@ -1083,7 +1083,7 @@ static int upgrade_fw(struct adapter *adap)
1083
1083
struct device * dev = adap -> pdev_dev ;
1084
1084
char * fw_file_name ;
1085
1085
1086
- switch (CHELSIO_CHIP_VERSION (adap -> chip )) {
1086
+ switch (CHELSIO_CHIP_VERSION (adap -> params . chip )) {
1087
1087
case CHELSIO_T4 :
1088
1088
fw_file_name = FW_FNAME ;
1089
1089
exp_major = FW_VERSION_MAJOR ;
@@ -1093,7 +1093,7 @@ static int upgrade_fw(struct adapter *adap)
1093
1093
exp_major = FW_VERSION_MAJOR_T5 ;
1094
1094
break ;
1095
1095
default :
1096
- dev_err (dev , "Unsupported chip type, %x\n" , adap -> chip );
1096
+ dev_err (dev , "Unsupported chip type, %x\n" , adap -> params . chip );
1097
1097
return - EINVAL ;
1098
1098
}
1099
1099
@@ -1415,7 +1415,7 @@ static int get_sset_count(struct net_device *dev, int sset)
1415
1415
static int get_regs_len (struct net_device * dev )
1416
1416
{
1417
1417
struct adapter * adap = netdev2adap (dev );
1418
- if (is_t4 (adap -> chip ))
1418
+ if (is_t4 (adap -> params . chip ))
1419
1419
return T4_REGMAP_SIZE ;
1420
1420
else
1421
1421
return T5_REGMAP_SIZE ;
@@ -1499,7 +1499,7 @@ static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
1499
1499
data += sizeof (struct port_stats ) / sizeof (u64 );
1500
1500
collect_sge_port_stats (adapter , pi , (struct queue_port_stats * )data );
1501
1501
data += sizeof (struct queue_port_stats ) / sizeof (u64 );
1502
- if (!is_t4 (adapter -> chip )) {
1502
+ if (!is_t4 (adapter -> params . chip )) {
1503
1503
t4_write_reg (adapter , SGE_STAT_CFG , STATSOURCE_T5 (7 ));
1504
1504
val1 = t4_read_reg (adapter , SGE_STAT_TOTAL );
1505
1505
val2 = t4_read_reg (adapter , SGE_STAT_MATCH );
@@ -1521,8 +1521,8 @@ static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
1521
1521
*/
1522
1522
static inline unsigned int mk_adap_vers (const struct adapter * ap )
1523
1523
{
1524
- return CHELSIO_CHIP_VERSION (ap -> chip ) |
1525
- (CHELSIO_CHIP_RELEASE (ap -> chip ) << 10 ) | (1 << 16 );
1524
+ return CHELSIO_CHIP_VERSION (ap -> params . chip ) |
1525
+ (CHELSIO_CHIP_RELEASE (ap -> params . chip ) << 10 ) | (1 << 16 );
1526
1526
}
1527
1527
1528
1528
static void reg_block_dump (struct adapter * ap , void * buf , unsigned int start ,
@@ -2189,7 +2189,7 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
2189
2189
static const unsigned int * reg_ranges ;
2190
2190
int arr_size = 0 , buf_size = 0 ;
2191
2191
2192
- if (is_t4 (ap -> chip )) {
2192
+ if (is_t4 (ap -> params . chip )) {
2193
2193
reg_ranges = & t4_reg_ranges [0 ];
2194
2194
arr_size = ARRAY_SIZE (t4_reg_ranges );
2195
2195
buf_size = T4_REGMAP_SIZE ;
@@ -2967,7 +2967,7 @@ static int setup_debugfs(struct adapter *adap)
2967
2967
size = t4_read_reg (adap , MA_EDRAM1_BAR );
2968
2968
add_debugfs_mem (adap , "edc1" , MEM_EDC1 , EDRAM_SIZE_GET (size ));
2969
2969
}
2970
- if (is_t4 (adap -> chip )) {
2970
+ if (is_t4 (adap -> params . chip )) {
2971
2971
size = t4_read_reg (adap , MA_EXT_MEMORY_BAR );
2972
2972
if (i & EXT_MEM_ENABLE )
2973
2973
add_debugfs_mem (adap , "mc" , MEM_MC ,
@@ -3419,7 +3419,7 @@ unsigned int cxgb4_dbfifo_count(const struct net_device *dev, int lpfifo)
3419
3419
3420
3420
v1 = t4_read_reg (adap , A_SGE_DBFIFO_STATUS );
3421
3421
v2 = t4_read_reg (adap , SGE_DBFIFO_STATUS2 );
3422
- if (is_t4 (adap -> chip )) {
3422
+ if (is_t4 (adap -> params . chip )) {
3423
3423
lp_count = G_LP_COUNT (v1 );
3424
3424
hp_count = G_HP_COUNT (v1 );
3425
3425
} else {
@@ -3588,7 +3588,7 @@ static void drain_db_fifo(struct adapter *adap, int usecs)
3588
3588
do {
3589
3589
v1 = t4_read_reg (adap , A_SGE_DBFIFO_STATUS );
3590
3590
v2 = t4_read_reg (adap , SGE_DBFIFO_STATUS2 );
3591
- if (is_t4 (adap -> chip )) {
3591
+ if (is_t4 (adap -> params . chip )) {
3592
3592
lp_count = G_LP_COUNT (v1 );
3593
3593
hp_count = G_HP_COUNT (v1 );
3594
3594
} else {
@@ -3708,7 +3708,7 @@ static void process_db_drop(struct work_struct *work)
3708
3708
3709
3709
adap = container_of (work , struct adapter , db_drop_task );
3710
3710
3711
- if (is_t4 (adap -> chip )) {
3711
+ if (is_t4 (adap -> params . chip )) {
3712
3712
disable_dbs (adap );
3713
3713
notify_rdma_uld (adap , CXGB4_CONTROL_DB_DROP );
3714
3714
drain_db_fifo (adap , 1 );
@@ -3753,7 +3753,7 @@ static void process_db_drop(struct work_struct *work)
3753
3753
3754
3754
void t4_db_full (struct adapter * adap )
3755
3755
{
3756
- if (is_t4 (adap -> chip )) {
3756
+ if (is_t4 (adap -> params . chip )) {
3757
3757
t4_set_reg_field (adap , SGE_INT_ENABLE3 ,
3758
3758
DBFIFO_HP_INT | DBFIFO_LP_INT , 0 );
3759
3759
queue_work (workq , & adap -> db_full_task );
@@ -3762,7 +3762,7 @@ void t4_db_full(struct adapter *adap)
3762
3762
3763
3763
void t4_db_dropped (struct adapter * adap )
3764
3764
{
3765
- if (is_t4 (adap -> chip ))
3765
+ if (is_t4 (adap -> params . chip ))
3766
3766
queue_work (workq , & adap -> db_drop_task );
3767
3767
}
3768
3768
@@ -3789,7 +3789,7 @@ static void uld_attach(struct adapter *adap, unsigned int uld)
3789
3789
lli .nchan = adap -> params .nports ;
3790
3790
lli .nports = adap -> params .nports ;
3791
3791
lli .wr_cred = adap -> params .ofldq_wr_cred ;
3792
- lli .adapter_type = adap -> params .rev ;
3792
+ lli .adapter_type = adap -> params .chip ;
3793
3793
lli .iscsi_iolen = MAXRXDATA_GET (t4_read_reg (adap , TP_PARA_REG2 ));
3794
3794
lli .udb_density = 1 << QUEUESPERPAGEPF0_GET (
3795
3795
t4_read_reg (adap , SGE_EGRESS_QUEUES_PER_PAGE_PF ) >>
@@ -4483,7 +4483,7 @@ static void setup_memwin(struct adapter *adap)
4483
4483
u32 bar0 , mem_win0_base , mem_win1_base , mem_win2_base ;
4484
4484
4485
4485
bar0 = pci_resource_start (adap -> pdev , 0 ); /* truncation intentional */
4486
- if (is_t4 (adap -> chip )) {
4486
+ if (is_t4 (adap -> params . chip )) {
4487
4487
mem_win0_base = bar0 + MEMWIN0_BASE ;
4488
4488
mem_win1_base = bar0 + MEMWIN1_BASE ;
4489
4489
mem_win2_base = bar0 + MEMWIN2_BASE ;
@@ -4686,7 +4686,7 @@ static int adap_init0_config(struct adapter *adapter, int reset)
4686
4686
* then use that. Otherwise, use the configuration file stored
4687
4687
* in the adapter flash ...
4688
4688
*/
4689
- switch (CHELSIO_CHIP_VERSION (adapter -> chip )) {
4689
+ switch (CHELSIO_CHIP_VERSION (adapter -> params . chip )) {
4690
4690
case CHELSIO_T4 :
4691
4691
fw_config_file = FW_CFNAME ;
4692
4692
break ;
@@ -5787,7 +5787,7 @@ static void print_port_info(const struct net_device *dev)
5787
5787
5788
5788
netdev_info (dev , "Chelsio %s rev %d %s %sNIC PCIe x%d%s%s\n" ,
5789
5789
adap -> params .vpd .id ,
5790
- CHELSIO_CHIP_RELEASE (adap -> params .rev ), buf ,
5790
+ CHELSIO_CHIP_RELEASE (adap -> params .chip ), buf ,
5791
5791
is_offload (adap ) ? "R" : "" , adap -> params .pci .width , spd ,
5792
5792
(adap -> flags & USING_MSIX ) ? " MSI-X" :
5793
5793
(adap -> flags & USING_MSI ) ? " MSI" : "" );
@@ -5910,7 +5910,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
5910
5910
if (err )
5911
5911
goto out_unmap_bar0 ;
5912
5912
5913
- if (!is_t4 (adapter -> chip )) {
5913
+ if (!is_t4 (adapter -> params . chip )) {
5914
5914
s_qpp = QUEUESPERPAGEPF1 * adapter -> fn ;
5915
5915
qpp = 1 << QUEUESPERPAGEPF0_GET (t4_read_reg (adapter ,
5916
5916
SGE_EGRESS_QUEUES_PER_PAGE_PF ) >> s_qpp );
@@ -6064,7 +6064,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
6064
6064
out_free_dev :
6065
6065
free_some_resources (adapter );
6066
6066
out_unmap_bar :
6067
- if (!is_t4 (adapter -> chip ))
6067
+ if (!is_t4 (adapter -> params . chip ))
6068
6068
iounmap (adapter -> bar2 );
6069
6069
out_unmap_bar0 :
6070
6070
iounmap (adapter -> regs );
@@ -6116,7 +6116,7 @@ static void remove_one(struct pci_dev *pdev)
6116
6116
6117
6117
free_some_resources (adapter );
6118
6118
iounmap (adapter -> regs );
6119
- if (!is_t4 (adapter -> chip ))
6119
+ if (!is_t4 (adapter -> params . chip ))
6120
6120
iounmap (adapter -> bar2 );
6121
6121
kfree (adapter );
6122
6122
pci_disable_pcie_error_reporting (pdev );
0 commit comments