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 )
@@ -2372,8 +2373,8 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
2372
2373
txfifosz /= tx_channels_count ;
2373
2374
2374
2375
if (priv -> plat -> force_thresh_dma_mode ) {
2375
- txmode = tc ;
2376
- rxmode = tc ;
2376
+ txmode = stmmac_tc ;
2377
+ rxmode = stmmac_tc ;
2377
2378
} else if (priv -> plat -> force_sf_dma_mode || priv -> plat -> tx_coe ) {
2378
2379
/*
2379
2380
* In case of GMAC, SF mode can be enabled
@@ -2386,7 +2387,7 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv)
2386
2387
rxmode = SF_DMA_MODE ;
2387
2388
priv -> xstats .threshold = SF_DMA_MODE ;
2388
2389
} else {
2389
- txmode = tc ;
2390
+ txmode = stmmac_tc ;
2390
2391
rxmode = SF_DMA_MODE ;
2391
2392
}
2392
2393
@@ -2517,16 +2518,16 @@ static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
2517
2518
2518
2519
static void stmmac_bump_dma_threshold (struct stmmac_priv * priv , u32 chan )
2519
2520
{
2520
- if (unlikely (priv -> xstats .threshold != SF_DMA_MODE ) && tc <= 256 ) {
2521
- tc += 64 ;
2521
+ if (unlikely (priv -> xstats .threshold != SF_DMA_MODE ) && stmmac_tc <= 256 ) {
2522
+ stmmac_tc += 64 ;
2522
2523
2523
2524
if (priv -> plat -> force_thresh_dma_mode )
2524
- stmmac_set_dma_operation_mode (priv , tc , tc , chan );
2525
+ stmmac_set_dma_operation_mode (priv , stmmac_tc , stmmac_tc , chan );
2525
2526
else
2526
- stmmac_set_dma_operation_mode (priv , tc , SF_DMA_MODE ,
2527
+ stmmac_set_dma_operation_mode (priv , stmmac_tc , SF_DMA_MODE ,
2527
2528
chan );
2528
2529
2529
- priv -> xstats .threshold = tc ;
2530
+ priv -> xstats .threshold = stmmac_tc ;
2530
2531
}
2531
2532
}
2532
2533
@@ -3371,7 +3372,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
3371
3372
3372
3373
/* Convert the timer from msec to usec */
3373
3374
if (!priv -> tx_lpi_timer )
3374
- priv -> tx_lpi_timer = eee_timer * 1000 ;
3375
+ priv -> tx_lpi_timer = stmmac_eee_timer * 1000 ;
3375
3376
3376
3377
if (priv -> use_riwt ) {
3377
3378
u32 queue ;
@@ -3825,11 +3826,11 @@ static int __stmmac_open(struct net_device *dev,
3825
3826
3826
3827
/* Extra statistics */
3827
3828
memset (& priv -> xstats , 0 , sizeof (struct stmmac_extra_stats ));
3828
- priv -> xstats .threshold = tc ;
3829
+ priv -> xstats .threshold = stmmac_tc ;
3829
3830
3830
3831
priv -> rx_copybreak = STMMAC_RX_COPYBREAK ;
3831
3832
3832
- buf_sz = dma_conf -> dma_buf_sz ;
3833
+ stmmac_buf_sz = dma_conf -> dma_buf_sz ;
3833
3834
memcpy (& priv -> dma_conf , dma_conf , sizeof (* dma_conf ));
3834
3835
3835
3836
stmmac_reset_queues_param (priv );
@@ -6852,8 +6853,8 @@ static int stmmac_hw_init(struct stmmac_priv *priv)
6852
6853
6853
6854
/* dwmac-sun8i only work in chain mode */
6854
6855
if (priv -> plat -> has_sun8i )
6855
- chain_mode = 1 ;
6856
- priv -> chain_mode = chain_mode ;
6856
+ stmmac_chain_mode = 1 ;
6857
+ priv -> chain_mode = stmmac_chain_mode ;
6857
6858
6858
6859
/* Initialize HW Interface */
6859
6860
ret = stmmac_hwif_init (priv );
@@ -7157,7 +7158,7 @@ int stmmac_dvr_probe(struct device *device,
7157
7158
priv -> dev = ndev ;
7158
7159
7159
7160
stmmac_set_ethtool_ops (ndev );
7160
- priv -> pause = pause ;
7161
+ priv -> pause = stmmac_pause ;
7161
7162
priv -> plat = plat_dat ;
7162
7163
priv -> ioaddr = res -> addr ;
7163
7164
priv -> dev -> base_addr = (unsigned long )res -> addr ;
@@ -7201,8 +7202,8 @@ int stmmac_dvr_probe(struct device *device,
7201
7202
/* Override with kernel parameters if supplied XXX CRS XXX
7202
7203
* this needs to have multiple instances
7203
7204
*/
7204
- if ((phyaddr >= 0 ) && (phyaddr <= 31 ))
7205
- priv -> plat -> phy_addr = phyaddr ;
7205
+ if ((stmmac_phyaddr >= 0 ) && (stmmac_phyaddr <= 31 ))
7206
+ priv -> plat -> phy_addr = stmmac_phyaddr ;
7206
7207
7207
7208
if (priv -> plat -> stmmac_rst ) {
7208
7209
ret = reset_control_assert (priv -> plat -> stmmac_rst );
@@ -7295,7 +7296,7 @@ int stmmac_dvr_probe(struct device *device,
7295
7296
}
7296
7297
7297
7298
ndev -> features |= ndev -> hw_features | NETIF_F_HIGHDMA ;
7298
- ndev -> watchdog_timeo = msecs_to_jiffies (watchdog );
7299
+ ndev -> watchdog_timeo = msecs_to_jiffies (stmmac_watchdog );
7299
7300
#ifdef STMMAC_VLAN_TAG_USED
7300
7301
/* Both mac100 and gmac support receive VLAN tag detection */
7301
7302
ndev -> features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX ;
@@ -7309,7 +7310,7 @@ int stmmac_dvr_probe(struct device *device,
7309
7310
ndev -> features |= NETIF_F_HW_VLAN_STAG_TX ;
7310
7311
}
7311
7312
#endif
7312
- priv -> msg_enable = netif_msg_init (debug , default_msg_level );
7313
+ priv -> msg_enable = netif_msg_init (stmmac_debug , default_msg_level );
7313
7314
7314
7315
/* Initialize RSS */
7315
7316
rxq = priv -> plat -> rx_queues_to_use ;
@@ -7343,7 +7344,7 @@ int stmmac_dvr_probe(struct device *device,
7343
7344
"%s: warning: maxmtu having invalid value (%d)\n" ,
7344
7345
__func__ , priv -> plat -> maxmtu );
7345
7346
7346
- if (flow_ctrl )
7347
+ if (stmmac_flow_ctrl )
7347
7348
priv -> flow_ctrl = FLOW_AUTO ; /* RX/TX pause on */
7348
7349
7349
7350
ndev -> priv_flags |= IFF_LIVE_ADDR_CHANGE ;
@@ -7676,31 +7677,31 @@ static int __init stmmac_cmdline_opt(char *str)
7676
7677
return 1 ;
7677
7678
while ((opt = strsep (& str , "," )) != NULL ) {
7678
7679
if (!strncmp (opt , "debug:" , 6 )) {
7679
- if (kstrtoint (opt + 6 , 0 , & debug ))
7680
+ if (kstrtoint (opt + 6 , 0 , & stmmac_debug ))
7680
7681
goto err ;
7681
7682
} else if (!strncmp (opt , "phyaddr:" , 8 )) {
7682
- if (kstrtoint (opt + 8 , 0 , & phyaddr ))
7683
+ if (kstrtoint (opt + 8 , 0 , & stmmac_phyaddr ))
7683
7684
goto err ;
7684
7685
} else if (!strncmp (opt , "buf_sz:" , 7 )) {
7685
- if (kstrtoint (opt + 7 , 0 , & buf_sz ))
7686
+ if (kstrtoint (opt + 7 , 0 , & stmmac_buf_sz ))
7686
7687
goto err ;
7687
7688
} else if (!strncmp (opt , "tc:" , 3 )) {
7688
- if (kstrtoint (opt + 3 , 0 , & tc ))
7689
+ if (kstrtoint (opt + 3 , 0 , & stmmac_tc ))
7689
7690
goto err ;
7690
7691
} else if (!strncmp (opt , "watchdog:" , 9 )) {
7691
- if (kstrtoint (opt + 9 , 0 , & watchdog ))
7692
+ if (kstrtoint (opt + 9 , 0 , & stmmac_watchdog ))
7692
7693
goto err ;
7693
7694
} else if (!strncmp (opt , "flow_ctrl:" , 10 )) {
7694
- if (kstrtoint (opt + 10 , 0 , & flow_ctrl ))
7695
+ if (kstrtoint (opt + 10 , 0 , & stmmac_flow_ctrl ))
7695
7696
goto err ;
7696
7697
} else if (!strncmp (opt , "pause:" , 6 )) {
7697
- if (kstrtoint (opt + 6 , 0 , & pause ))
7698
+ if (kstrtoint (opt + 6 , 0 , & stmmac_pause ))
7698
7699
goto err ;
7699
7700
} else if (!strncmp (opt , "eee_timer:" , 10 )) {
7700
- if (kstrtoint (opt + 10 , 0 , & eee_timer ))
7701
+ if (kstrtoint (opt + 10 , 0 , & stmmac_eee_timer ))
7701
7702
goto err ;
7702
7703
} else if (!strncmp (opt , "chain_mode:" , 11 )) {
7703
- if (kstrtoint (opt + 11 , 0 , & chain_mode ))
7704
+ if (kstrtoint (opt + 11 , 0 , & stmmac_chain_mode ))
7704
7705
goto err ;
7705
7706
}
7706
7707
}
0 commit comments