@@ -5301,10 +5301,10 @@ static void rtl_set_rx_tx_config_registers(struct rtl8169_private *tp)
5301
5301
(InterFrameGap << TxInterFrameGapShift ));
5302
5302
}
5303
5303
5304
- static void rtl_hw_start (struct rtl8169_private * tp )
5304
+ static void rtl_set_rx_max_size (struct rtl8169_private * tp )
5305
5305
{
5306
- tp -> hw_start ( tp );
5307
- rtl_irq_enable_all (tp );
5306
+ /* Low hurts. Let's disable the filtering. */
5307
+ RTL_W16 (tp , RxMaxSize , R8169_RX_BUF_SIZE + 1 );
5308
5308
}
5309
5309
5310
5310
static void rtl_set_rx_tx_desc_registers (struct rtl8169_private * tp )
@@ -5320,10 +5320,23 @@ static void rtl_set_rx_tx_desc_registers(struct rtl8169_private *tp)
5320
5320
RTL_W32 (tp , RxDescAddrLow , ((u64 ) tp -> RxPhyAddr ) & DMA_BIT_MASK (32 ));
5321
5321
}
5322
5322
5323
- static void rtl_set_rx_max_size (struct rtl8169_private * tp )
5323
+ static void rtl_hw_start (struct rtl8169_private * tp )
5324
5324
{
5325
- /* Low hurts. Let's disable the filtering. */
5326
- RTL_W16 (tp , RxMaxSize , R8169_RX_BUF_SIZE + 1 );
5325
+ RTL_W8 (tp , Cfg9346 , Cfg9346_Unlock );
5326
+
5327
+ tp -> hw_start (tp );
5328
+
5329
+ rtl_set_rx_max_size (tp );
5330
+ rtl_set_rx_tx_desc_registers (tp );
5331
+ rtl_set_rx_tx_config_registers (tp );
5332
+ RTL_W8 (tp , Cfg9346 , Cfg9346_Lock );
5333
+
5334
+ /* Initially a 10 us delay. Turned it into a PCI commit. - FR */
5335
+ RTL_R8 (tp , IntrMask );
5336
+ RTL_W8 (tp , ChipCmd , CmdTxEnb | CmdRxEnb );
5337
+ /* no early-rx interrupts */
5338
+ RTL_W16 (tp , MultiIntr , RTL_R16 (tp , MultiIntr ) & 0xf000 );
5339
+ rtl_irq_enable_all (tp );
5327
5340
}
5328
5341
5329
5342
static void rtl8169_set_magic_reg (struct rtl8169_private * tp , unsigned mac_version )
@@ -5408,12 +5421,8 @@ static void rtl_hw_start_8169(struct rtl8169_private *tp)
5408
5421
if (tp -> mac_version == RTL_GIGA_MAC_VER_05 )
5409
5422
pci_write_config_byte (tp -> pci_dev , PCI_CACHE_LINE_SIZE , 0x08 );
5410
5423
5411
- RTL_W8 (tp , Cfg9346 , Cfg9346_Unlock );
5412
-
5413
5424
RTL_W8 (tp , EarlyTxThres , NoEarlyTx );
5414
5425
5415
- rtl_set_rx_max_size (tp );
5416
-
5417
5426
tp -> cp_cmd |= PCIMulRW ;
5418
5427
5419
5428
if (tp -> mac_version == RTL_GIGA_MAC_VER_02 ||
@@ -5433,20 +5442,7 @@ static void rtl_hw_start_8169(struct rtl8169_private *tp)
5433
5442
*/
5434
5443
RTL_W16 (tp , IntrMitigate , 0x0000 );
5435
5444
5436
- rtl_set_rx_tx_desc_registers (tp );
5437
- rtl_set_rx_tx_config_registers (tp );
5438
-
5439
- RTL_W8 (tp , ChipCmd , CmdTxEnb | CmdRxEnb );
5440
-
5441
- RTL_W8 (tp , Cfg9346 , Cfg9346_Lock );
5442
-
5443
- /* Initially a 10 us delay. Turned it into a PCI commit. - FR */
5444
- RTL_R8 (tp , IntrMask );
5445
-
5446
5445
RTL_W32 (tp , RxMissed , 0 );
5447
-
5448
- /* no early-rx interrupts */
5449
- RTL_W16 (tp , MultiIntr , RTL_R16 (tp , MultiIntr ) & 0xf000 );
5450
5446
}
5451
5447
5452
5448
static void rtl_csi_write (struct rtl8169_private * tp , int addr , int value )
@@ -6227,12 +6223,8 @@ static void rtl_hw_start_8168ep_3(struct rtl8169_private *tp)
6227
6223
6228
6224
static void rtl_hw_start_8168 (struct rtl8169_private * tp )
6229
6225
{
6230
- RTL_W8 (tp , Cfg9346 , Cfg9346_Unlock );
6231
-
6232
6226
RTL_W8 (tp , MaxTxPacketSize , TxPacketMax );
6233
6227
6234
- rtl_set_rx_max_size (tp );
6235
-
6236
6228
tp -> cp_cmd &= ~INTT_MASK ;
6237
6229
tp -> cp_cmd |= PktCntrDisable | INTT_1 ;
6238
6230
RTL_W16 (tp , CPlusCmd , tp -> cp_cmd );
@@ -6245,12 +6237,6 @@ static void rtl_hw_start_8168(struct rtl8169_private *tp)
6245
6237
tp -> event_slow &= ~RxOverflow ;
6246
6238
}
6247
6239
6248
- rtl_set_rx_tx_desc_registers (tp );
6249
-
6250
- rtl_set_rx_tx_config_registers (tp );
6251
-
6252
- RTL_R8 (tp , IntrMask );
6253
-
6254
6240
switch (tp -> mac_version ) {
6255
6241
case RTL_GIGA_MAC_VER_11 :
6256
6242
rtl_hw_start_8168bb (tp );
@@ -6354,12 +6340,6 @@ static void rtl_hw_start_8168(struct rtl8169_private *tp)
6354
6340
tp -> dev -> name , tp -> mac_version );
6355
6341
break ;
6356
6342
}
6357
-
6358
- RTL_W8 (tp , Cfg9346 , Cfg9346_Lock );
6359
-
6360
- RTL_W8 (tp , ChipCmd , CmdTxEnb | CmdRxEnb );
6361
-
6362
- RTL_W16 (tp , MultiIntr , RTL_R16 (tp , MultiIntr ) & 0xf000 );
6363
6343
}
6364
6344
6365
6345
static void rtl_hw_start_8102e_1 (struct rtl8169_private * tp )
@@ -6495,19 +6475,11 @@ static void rtl_hw_start_8101(struct rtl8169_private *tp)
6495
6475
pcie_capability_set_word (tp -> pci_dev , PCI_EXP_DEVCTL ,
6496
6476
PCI_EXP_DEVCTL_NOSNOOP_EN );
6497
6477
6498
- RTL_W8 (tp , Cfg9346 , Cfg9346_Unlock );
6499
-
6500
6478
RTL_W8 (tp , MaxTxPacketSize , TxPacketMax );
6501
6479
6502
- rtl_set_rx_max_size (tp );
6503
-
6504
6480
tp -> cp_cmd &= CPCMD_QUIRK_MASK ;
6505
6481
RTL_W16 (tp , CPlusCmd , tp -> cp_cmd );
6506
6482
6507
- rtl_set_rx_tx_desc_registers (tp );
6508
-
6509
- rtl_set_rx_tx_config_registers (tp );
6510
-
6511
6483
switch (tp -> mac_version ) {
6512
6484
case RTL_GIGA_MAC_VER_07 :
6513
6485
rtl_hw_start_8102e_1 (tp );
@@ -6544,15 +6516,7 @@ static void rtl_hw_start_8101(struct rtl8169_private *tp)
6544
6516
break ;
6545
6517
}
6546
6518
6547
- RTL_W8 (tp , Cfg9346 , Cfg9346_Lock );
6548
-
6549
6519
RTL_W16 (tp , IntrMitigate , 0x0000 );
6550
-
6551
- RTL_W8 (tp , ChipCmd , CmdTxEnb | CmdRxEnb );
6552
-
6553
- RTL_R8 (tp , IntrMask );
6554
-
6555
- RTL_W16 (tp , MultiIntr , RTL_R16 (tp , MultiIntr ) & 0xf000 );
6556
6520
}
6557
6521
6558
6522
static int rtl8169_change_mtu (struct net_device * dev , int new_mtu )
0 commit comments