62
62
63
63
/* Module parameters */
64
64
#define TX_TIMEO 5000
65
- static int watchdog = TX_TIMEO ;
66
- module_param (watchdog , int , 0644 );
65
+ int stmmac_watchdog = TX_TIMEO ;
66
+ module_param_named (watchdog , stmmac_watchdog , int , 0644 );
67
67
MODULE_PARM_DESC (watchdog , "Transmit timeout in milliseconds (default 5s)" );
68
68
69
- static int debug = -1 ;
70
- module_param (debug , int , 0644 );
69
+ int stmmac_debug = -1 ;
70
+ module_param_named (debug , stmmac_debug , int , 0644 );
71
71
MODULE_PARM_DESC (debug , "Message Level (-1: default, 0: no output, 16: all)" );
72
72
73
- static int phyaddr = -1 ;
74
- module_param (phyaddr , int , 0444 );
73
+ int stmmac_phyaddr = -1 ;
74
+ module_param_named (phyaddr , stmmac_phyaddr , int , 0444 );
75
75
MODULE_PARM_DESC (phyaddr , "Physical device address" );
76
76
77
77
#define STMMAC_TX_THRESH (x ) ((x)->dma_conf.dma_tx_size / 4)
@@ -87,22 +87,22 @@ MODULE_PARM_DESC(phyaddr, "Physical device address");
87
87
#define STMMAC_XDP_TX BIT(1)
88
88
#define STMMAC_XDP_REDIRECT BIT(2)
89
89
90
- static int flow_ctrl = FLOW_AUTO ;
91
- module_param (flow_ctrl , int , 0644 );
90
+ int stmmac_flow_ctrl = FLOW_AUTO ;
91
+ module_param_named (flow_ctrl , stmmac_flow_ctrl , int , 0644 );
92
92
MODULE_PARM_DESC (flow_ctrl , "Flow control ability [on/off]" );
93
93
94
- static int pause = PAUSE_TIME ;
95
- module_param (pause , int , 0644 );
94
+ int stmmac_pause = PAUSE_TIME ;
95
+ module_param_named (pause , stmmac_pause , int , 0644 );
96
96
MODULE_PARM_DESC (pause , "Flow Control Pause Time" );
97
97
98
98
#define TC_DEFAULT 64
99
- static int tc = TC_DEFAULT ;
100
- module_param (tc , int , 0644 );
99
+ int stmmac_tc = TC_DEFAULT ;
100
+ module_param_named (tc , stmmac_tc , int , 0644 );
101
101
MODULE_PARM_DESC (tc , "DMA threshold control value" );
102
102
103
103
#define DEFAULT_BUFSIZE 1536
104
- static int buf_sz = DEFAULT_BUFSIZE ;
105
- module_param (buf_sz , int , 0644 );
104
+ int stmmac_buf_sz = DEFAULT_BUFSIZE ;
105
+ module_param_named (buf_sz , stmmac_buf_sz , int , 0644 );
106
106
MODULE_PARM_DESC (buf_sz , "DMA buffer size" );
107
107
108
108
#define STMMAC_RX_COPYBREAK 256
@@ -112,16 +112,16 @@ static const u32 default_msg_level = (NETIF_MSG_DRV | NETIF_MSG_PROBE |
112
112
NETIF_MSG_IFDOWN | NETIF_MSG_TIMER );
113
113
114
114
#define STMMAC_DEFAULT_LPI_TIMER 1000
115
- static int eee_timer = STMMAC_DEFAULT_LPI_TIMER ;
116
- module_param (eee_timer , int , 0644 );
115
+ int stmmac_eee_timer = STMMAC_DEFAULT_LPI_TIMER ;
116
+ module_param_named (eee_timer , stmmac_eee_timer , int , 0644 );
117
117
MODULE_PARM_DESC (eee_timer , "LPI tx expiration time in msec" );
118
118
#define STMMAC_LPI_T (x ) (jiffies + usecs_to_jiffies(x))
119
119
120
120
/* By default the driver will use the ring mode to manage tx and rx descriptors,
121
121
* but allow user to force to use the chain instead of the ring
122
122
*/
123
- static unsigned int chain_mode ;
124
- module_param (chain_mode , int , 0444 );
123
+ unsigned int stmmac_chain_mode ;
124
+ module_param_named (chain_mode , stmmac_chain_mode , int , 0444 );
125
125
MODULE_PARM_DESC (chain_mode , "To use chain instead of ring mode" );
126
126
127
127
static irqreturn_t stmmac_interrupt (int irq , void * dev_id );
@@ -185,18 +185,19 @@ EXPORT_SYMBOL_GPL(stmmac_bus_clks_config);
185
185
*/
186
186
static void stmmac_verify_args (void )
187
187
{
188
- if (unlikely (watchdog < 0 ))
189
- watchdog = TX_TIMEO ;
190
- if (unlikely ((buf_sz < DEFAULT_BUFSIZE ) || (buf_sz > BUF_SIZE_16KiB )))
191
- buf_sz = DEFAULT_BUFSIZE ;
192
- if (unlikely (flow_ctrl > 1 ))
193
- flow_ctrl = FLOW_AUTO ;
194
- else if (likely (flow_ctrl < 0 ))
195
- flow_ctrl = FLOW_OFF ;
196
- if (unlikely ((pause < 0 ) || (pause > 0xffff )))
197
- pause = PAUSE_TIME ;
198
- if (eee_timer < 0 )
199
- eee_timer = STMMAC_DEFAULT_LPI_TIMER ;
188
+ if (unlikely (stmmac_watchdog < 0 ))
189
+ stmmac_watchdog = TX_TIMEO ;
190
+ if (unlikely ((stmmac_buf_sz < DEFAULT_BUFSIZE ) ||
191
+ (stmmac_buf_sz > BUF_SIZE_16KiB )))
192
+ stmmac_buf_sz = DEFAULT_BUFSIZE ;
193
+ if (unlikely (stmmac_flow_ctrl > 1 ))
194
+ stmmac_flow_ctrl = FLOW_AUTO ;
195
+ else if (likely (stmmac_flow_ctrl < 0 ))
196
+ stmmac_flow_ctrl = FLOW_OFF ;
197
+ if (unlikely ((stmmac_pause < 0 ) || (stmmac_pause > 0xffff )))
198
+ stmmac_pause = PAUSE_TIME ;
199
+ if (stmmac_eee_timer < 0 )
200
+ stmmac_eee_timer = STMMAC_DEFAULT_LPI_TIMER ;
200
201
}
201
202
202
203
static void __stmmac_disable_all_queues (struct stmmac_priv * priv )
@@ -2375,8 +2376,8 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
2375
2376
txfifosz /= tx_channels_count ;
2376
2377
2377
2378
if (priv -> plat -> force_thresh_dma_mode ) {
2378
- txmode = tc ;
2379
- rxmode = tc ;
2379
+ txmode = stmmac_tc ;
2380
+ rxmode = stmmac_tc ;
2380
2381
} else if (priv -> plat -> force_sf_dma_mode || priv -> plat -> tx_coe ) {
2381
2382
/*
2382
2383
* In case of GMAC, SF mode can be enabled
@@ -2389,7 +2390,7 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
2389
2390
rxmode = SF_DMA_MODE ;
2390
2391
priv -> xstats .threshold = SF_DMA_MODE ;
2391
2392
} else {
2392
- txmode = tc ;
2393
+ txmode = stmmac_tc ;
2393
2394
rxmode = SF_DMA_MODE ;
2394
2395
}
2395
2396
@@ -2520,16 +2521,16 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
2520
2521
2521
2522
static void stmmac_bump_dma_threshold (struct stmmac_priv * priv , u32 chan )
2522
2523
{
2523
- if (unlikely (priv -> xstats .threshold != SF_DMA_MODE ) && tc <= 256 ) {
2524
- tc += 64 ;
2524
+ if (unlikely (priv -> xstats .threshold != SF_DMA_MODE ) && stmmac_tc <= 256 ) {
2525
+ stmmac_tc += 64 ;
2525
2526
2526
2527
if (priv -> plat -> force_thresh_dma_mode )
2527
- stmmac_set_dma_operation_mode (priv , tc , tc , chan );
2528
+ stmmac_set_dma_operation_mode (priv , stmmac_tc , stmmac_tc , chan );
2528
2529
else
2529
- stmmac_set_dma_operation_mode (priv , tc , SF_DMA_MODE ,
2530
+ stmmac_set_dma_operation_mode (priv , stmmac_tc , SF_DMA_MODE ,
2530
2531
chan );
2531
2532
2532
- priv -> xstats .threshold = tc ;
2533
+ priv -> xstats .threshold = stmmac_tc ;
2533
2534
}
2534
2535
}
2535
2536
@@ -3374,7 +3375,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
3374
3375
3375
3376
/* Convert the timer from msec to usec */
3376
3377
if (!priv -> tx_lpi_timer )
3377
- priv -> tx_lpi_timer = eee_timer * 1000 ;
3378
+ priv -> tx_lpi_timer = stmmac_eee_timer * 1000 ;
3378
3379
3379
3380
if (priv -> use_riwt ) {
3380
3381
u32 queue ;
@@ -3829,11 +3830,11 @@ static int __stmmac_open(struct net_device *dev,
3829
3830
3830
3831
/* Extra statistics */
3831
3832
memset (& priv -> xstats , 0 , sizeof (struct stmmac_extra_stats ));
3832
- priv -> xstats .threshold = tc ;
3833
+ priv -> xstats .threshold = stmmac_tc ;
3833
3834
3834
3835
priv -> rx_copybreak = STMMAC_RX_COPYBREAK ;
3835
3836
3836
- buf_sz = dma_conf -> dma_buf_sz ;
3837
+ stmmac_buf_sz = dma_conf -> dma_buf_sz ;
3837
3838
memcpy (& priv -> dma_conf , dma_conf , sizeof (* dma_conf ));
3838
3839
3839
3840
stmmac_reset_queues_param (priv );
@@ -6856,8 +6857,8 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
6856
6857
6857
6858
/* dwmac-sun8i only work in chain mode */
6858
6859
if (priv -> plat -> has_sun8i )
6859
- chain_mode = 1 ;
6860
- priv -> chain_mode = chain_mode ;
6860
+ stmmac_chain_mode = 1 ;
6861
+ priv -> chain_mode = stmmac_chain_mode ;
6861
6862
6862
6863
/* Initialize HW Interface */
6863
6864
ret = stmmac_hwif_init (priv );
@@ -7161,7 +7162,7 @@ int stmmac_dvr_probe(struct device *device,
7161
7162
priv -> dev = ndev ;
7162
7163
7163
7164
stmmac_set_ethtool_ops (ndev );
7164
- priv -> pause = pause ;
7165
+ priv -> pause = stmmac_pause ;
7165
7166
priv -> plat = plat_dat ;
7166
7167
priv -> ioaddr = res -> addr ;
7167
7168
priv -> dev -> base_addr = (unsigned long )res -> addr ;
@@ -7205,8 +7206,8 @@ int stmmac_dvr_probe(struct device *device,
7205
7206
/* Override with kernel parameters if supplied XXX CRS XXX
7206
7207
* this needs to have multiple instances
7207
7208
*/
7208
- if ((phyaddr >= 0 ) && (phyaddr <= 31 ))
7209
- priv -> plat -> phy_addr = phyaddr ;
7209
+ if ((stmmac_phyaddr >= 0 ) && (stmmac_phyaddr <= 31 ))
7210
+ priv -> plat -> phy_addr = stmmac_phyaddr ;
7210
7211
7211
7212
if (priv -> plat -> stmmac_rst ) {
7212
7213
ret = reset_control_assert (priv -> plat -> stmmac_rst );
@@ -7299,7 +7300,7 @@ int stmmac_dvr_probe(struct device *device,
7299
7300
}
7300
7301
7301
7302
ndev -> features |= ndev -> hw_features | NETIF_F_HIGHDMA ;
7302
- ndev -> watchdog_timeo = msecs_to_jiffies (watchdog );
7303
+ ndev -> watchdog_timeo = msecs_to_jiffies (stmmac_watchdog );
7303
7304
#ifdef STMMAC_VLAN_TAG_USED
7304
7305
/* Both mac100 and gmac support receive VLAN tag detection */
7305
7306
ndev -> features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX ;
@@ -7313,7 +7314,7 @@ int stmmac_dvr_probe(struct device *device,
7313
7314
ndev -> features |= NETIF_F_HW_VLAN_STAG_TX ;
7314
7315
}
7315
7316
#endif
7316
- priv -> msg_enable = netif_msg_init (debug , default_msg_level );
7317
+ priv -> msg_enable = netif_msg_init (stmmac_debug , default_msg_level );
7317
7318
7318
7319
/* Initialize RSS */
7319
7320
rxq = priv -> plat -> rx_queues_to_use ;
@@ -7347,7 +7348,7 @@ int stmmac_dvr_probe(struct device *device,
7347
7348
"%s: warning: maxmtu having invalid value (%d)\n" ,
7348
7349
__func__ , priv -> plat -> maxmtu );
7349
7350
7350
- if (flow_ctrl )
7351
+ if (stmmac_flow_ctrl )
7351
7352
priv -> flow_ctrl = FLOW_AUTO ; /* RX/TX pause on */
7352
7353
7353
7354
ndev -> priv_flags |= IFF_LIVE_ADDR_CHANGE ;
@@ -7674,31 +7675,31 @@ static int __init stmmac_cmdline_opt(char *str)
7674
7675
return 1 ;
7675
7676
while ((opt = strsep (& str , "," )) != NULL ) {
7676
7677
if (!strncmp (opt , "debug:" , 6 )) {
7677
- if (kstrtoint (opt + 6 , 0 , & debug ))
7678
+ if (kstrtoint (opt + 6 , 0 , & stmmac_debug ))
7678
7679
goto err ;
7679
7680
} else if (!strncmp (opt , "phyaddr:" , 8 )) {
7680
- if (kstrtoint (opt + 8 , 0 , & phyaddr ))
7681
+ if (kstrtoint (opt + 8 , 0 , & stmmac_phyaddr ))
7681
7682
goto err ;
7682
7683
} else if (!strncmp (opt , "buf_sz:" , 7 )) {
7683
- if (kstrtoint (opt + 7 , 0 , & buf_sz ))
7684
+ if (kstrtoint (opt + 7 , 0 , & stmmac_buf_sz ))
7684
7685
goto err ;
7685
7686
} else if (!strncmp (opt , "tc:" , 3 )) {
7686
- if (kstrtoint (opt + 3 , 0 , & tc ))
7687
+ if (kstrtoint (opt + 3 , 0 , & stmmac_tc ))
7687
7688
goto err ;
7688
7689
} else if (!strncmp (opt , "watchdog:" , 9 )) {
7689
- if (kstrtoint (opt + 9 , 0 , & watchdog ))
7690
+ if (kstrtoint (opt + 9 , 0 , & stmmac_watchdog ))
7690
7691
goto err ;
7691
7692
} else if (!strncmp (opt , "flow_ctrl:" , 10 )) {
7692
- if (kstrtoint (opt + 10 , 0 , & flow_ctrl ))
7693
+ if (kstrtoint (opt + 10 , 0 , & stmmac_flow_ctrl ))
7693
7694
goto err ;
7694
7695
} else if (!strncmp (opt , "pause:" , 6 )) {
7695
- if (kstrtoint (opt + 6 , 0 , & pause ))
7696
+ if (kstrtoint (opt + 6 , 0 , & stmmac_pause ))
7696
7697
goto err ;
7697
7698
} else if (!strncmp (opt , "eee_timer:" , 10 )) {
7698
- if (kstrtoint (opt + 10 , 0 , & eee_timer ))
7699
+ if (kstrtoint (opt + 10 , 0 , & stmmac_eee_timer ))
7699
7700
goto err ;
7700
7701
} else if (!strncmp (opt , "chain_mode:" , 11 )) {
7701
- if (kstrtoint (opt + 11 , 0 , & chain_mode ))
7702
+ if (kstrtoint (opt + 11 , 0 , & stmmac_chain_mode ))
7702
7703
goto err ;
7703
7704
}
7704
7705
}
0 commit comments