| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | --- a/drivers/staging/octeon/ethernet.c |
| 2 | +++ b/drivers/staging/octeon/ethernet.c |
| 3 | @@ -683,6 +683,7 @@ static int cvm_oct_probe(struct platform |
| 4 | int interface; |
| 5 | int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE; |
| 6 | int qos; |
| 7 | + int i; |
| 8 | struct device_node *pip; |
| 9 | int mtu_overhead = ETH_HLEN + ETH_FCS_LEN; |
| 10 | |
| 11 | @@ -806,13 +807,19 @@ static int cvm_oct_probe(struct platform |
| 12 | } |
| 13 | |
| 14 | num_interfaces = cvmx_helper_get_number_of_interfaces(); |
| 15 | - for (interface = 0; interface < num_interfaces; interface++) { |
| 16 | - cvmx_helper_interface_mode_t imode = |
| 17 | - cvmx_helper_interface_get_mode(interface); |
| 18 | - int num_ports = cvmx_helper_ports_on_interface(interface); |
| 19 | + for (i = 0; i < num_interfaces; i++) { |
| 20 | + cvmx_helper_interface_mode_t imode; |
| 21 | + int interface; |
| 22 | + int num_ports; |
| 23 | int port; |
| 24 | int port_index; |
| 25 | |
| 26 | + interface = i; |
| 27 | + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_UBNT_E200) |
| 28 | + interface = num_interfaces - (i + 1); |
| 29 | + |
| 30 | + num_ports = cvmx_helper_ports_on_interface(interface); |
| 31 | + imode = cvmx_helper_interface_get_mode(interface); |
| 32 | for (port_index = 0, |
| 33 | port = cvmx_helper_get_ipd_port(interface, 0); |
| 34 | port < cvmx_helper_get_ipd_port(interface, num_ports); |