History

Merge branch 'net-dsa-microchip-make-ksz8795-driver-more-versatile'

Michael Grzeschik says: ==================== net: dsa: microchip: make ksz8795 driver more versatile This series changes the ksz8795 driver to use more dynamic variables instead of static defines. The purpose is to prepare the driver to be used with other microchip switches with a similar layout. ====================

Jakub Kicinski committed 5 years ago

Commit 6ec1dfb2 parents 9693e08 02ffbb05 files · +40 −61Browse files

Unified · Split

5 files
  1. drivers/net/dsa/microchip/ksz8795.c +33 −38
  2. drivers/net/dsa/microchip/ksz8795_reg.h +0 −10
  3. drivers/net/dsa/microchip/ksz9477.c +5 −9
  4. drivers/net/dsa/microchip/ksz_common.c +2 −2
  5. drivers/net/dsa/microchip/ksz_common.h +0 −2
drivers/net/dsa/microchip/ksz8795.c+33−38
@@ -23,7 +23,7 @@ · 22 unmodified lines
23 23
24static const struct {24static const struct {
25 char string[ETH_GSTRING_LEN];25 char string[ETH_GSTRING_LEN];
26} mib_names[TOTAL_SWITCH_COUNTER_NUM] = {26} mib_names[] = {
27 { "rx_hi" },27 { "rx_hi" },
28 { "rx_undersize" },28 { "rx_undersize" },
29 { "rx_fragments" },29 { "rx_fragments" },
@@ -125,7 +125,7 @@ static void ksz8795_r_mib_cnt(struct ksz_device *dev, int port, u16 addr, · 95 unmodified lines
125 u8 check;125 u8 check;
126 int loop;126 int loop;
127 127
128 ctrl_addr = addr + SWITCH_COUNTER_NUM * port;128 ctrl_addr = addr + dev->reg_mib_cnt * port;
129 ctrl_addr |= IND_ACC_TABLE(TABLE_MIB | TABLE_READ);129 ctrl_addr |= IND_ACC_TABLE(TABLE_MIB | TABLE_READ);
130 130
131 mutex_lock(&dev->alu_mutex);131 mutex_lock(&dev->alu_mutex);
@@ -156,7 +156,7 @@ static void ksz8795_r_mib_pkt(struct ksz_device *dev, int port, u16 addr, · 24 unmodified lines
156 u8 check;156 u8 check;
157 int loop;157 int loop;
158 158
159 addr -= SWITCH_COUNTER_NUM;159 addr -= dev->reg_mib_cnt;
160 ctrl_addr = (KS_MIB_TOTAL_RX_1 - KS_MIB_TOTAL_RX_0) * port;160 ctrl_addr = (KS_MIB_TOTAL_RX_1 - KS_MIB_TOTAL_RX_0) * port;
161 ctrl_addr += addr + KS_MIB_TOTAL_RX_0;161 ctrl_addr += addr + KS_MIB_TOTAL_RX_0;
162 ctrl_addr |= IND_ACC_TABLE(TABLE_MIB | TABLE_READ);162 ctrl_addr |= IND_ACC_TABLE(TABLE_MIB | TABLE_READ);
@@ -418,8 +418,8 @@ static void ksz8795_r_vlan_entries(struct ksz_device *dev, u16 addr) · 255 unmodified lines
418 int i;418 int i;
419 419
420 ksz8795_r_table(dev, TABLE_VLAN, addr, &data);420 ksz8795_r_table(dev, TABLE_VLAN, addr, &data);
421 addr *= 4;421 addr *= dev->phy_port_cnt;
422 for (i = 0; i < 4; i++) {422 for (i = 0; i < dev->phy_port_cnt; i++) {
423 dev->vlan_cache[addr + i].table[0] = (u16)data;423 dev->vlan_cache[addr + i].table[0] = (u16)data;
424 data >>= VLAN_TABLE_S;424 data >>= VLAN_TABLE_S;
425 }425 }
@@ -433,7 +433,7 @@ static void ksz8795_r_vlan_table(struct ksz_device *dev, u16 vid, u16 *vlan) · 7 unmodified lines
433 u64 buf;433 u64 buf;
434 434
435 data = (u16 *)&buf;435 data = (u16 *)&buf;
436 addr = vid / 4;436 addr = vid / dev->phy_port_cnt;
437 index = vid & 3;437 index = vid & 3;
438 ksz8795_r_table(dev, TABLE_VLAN, addr, &buf);438 ksz8795_r_table(dev, TABLE_VLAN, addr, &buf);
439 *vlan = data[index];439 *vlan = data[index];
@@ -447,7 +447,7 @@ static void ksz8795_w_vlan_table(struct ksz_device *dev, u16 vid, u16 vlan) · 7 unmodified lines
447 u64 buf;447 u64 buf;
448 448
449 data = (u16 *)&buf;449 data = (u16 *)&buf;
450 addr = vid / 4;450 addr = vid / dev->phy_port_cnt;
451 index = vid & 3;451 index = vid & 3;
452 ksz8795_r_table(dev, TABLE_VLAN, addr, &buf);452 ksz8795_r_table(dev, TABLE_VLAN, addr, &buf);
453 data[index] = vlan;453 data[index] = vlan;
@@ -654,9 +654,10 @@ static enum dsa_tag_protocol ksz8795_get_tag_protocol(struct dsa_switch *ds, · 200 unmodified lines
654static void ksz8795_get_strings(struct dsa_switch *ds, int port,654static void ksz8795_get_strings(struct dsa_switch *ds, int port,
655 u32 stringset, uint8_t *buf)655 u32 stringset, uint8_t *buf)
656{656{
657 struct ksz_device *dev = ds->priv;
657 int i;658 int i;
658 659
659 for (i = 0; i < TOTAL_SWITCH_COUNTER_NUM; i++) {660 for (i = 0; i < dev->mib_cnt; i++) {
660 memcpy(buf + i * ETH_GSTRING_LEN, mib_names[i].string,661 memcpy(buf + i * ETH_GSTRING_LEN, mib_names[i].string,
661 ETH_GSTRING_LEN);662 ETH_GSTRING_LEN);
662 }663 }
@@ -691,12 +692,12 @@ static void ksz8795_port_stp_state_set(struct dsa_switch *ds, int port, · 28 unmodified lines
691 switch (state) {692 switch (state) {
692 case BR_STATE_DISABLED:693 case BR_STATE_DISABLED:
693 data |= PORT_LEARN_DISABLE;694 data |= PORT_LEARN_DISABLE;
694 if (port < SWITCH_PORT_NUM)695 if (port < dev->phy_port_cnt)
695 member = 0;696 member = 0;
696 break;697 break;
697 case BR_STATE_LISTENING:698 case BR_STATE_LISTENING:
698 data |= (PORT_RX_ENABLE | PORT_LEARN_DISABLE);699 data |= (PORT_RX_ENABLE | PORT_LEARN_DISABLE);
699 if (port < SWITCH_PORT_NUM &&700 if (port < dev->phy_port_cnt &&
700 p->stp_state == BR_STATE_DISABLED)701 p->stp_state == BR_STATE_DISABLED)
701 member = dev->host_mask | p->vid_member;702 member = dev->host_mask | p->vid_member;
702 break;703 break;
@@ -720,7 +721,7 @@ static void ksz8795_port_stp_state_set(struct dsa_switch *ds, int port, · 17 unmodified lines
720 break;721 break;
721 case BR_STATE_BLOCKING:722 case BR_STATE_BLOCKING:
722 data |= PORT_LEARN_DISABLE;723 data |= PORT_LEARN_DISABLE;
723 if (port < SWITCH_PORT_NUM &&724 if (port < dev->phy_port_cnt &&
724 p->stp_state == BR_STATE_DISABLED)725 p->stp_state == BR_STATE_DISABLED)
725 member = dev->host_mask | p->vid_member;726 member = dev->host_mask | p->vid_member;
726 break;727 break;
@@ -750,17 +751,17 @@ static void ksz8795_port_stp_state_set(struct dsa_switch *ds, int port, · 23 unmodified lines
750 751
751static void ksz8795_flush_dyn_mac_table(struct ksz_device *dev, int port)752static void ksz8795_flush_dyn_mac_table(struct ksz_device *dev, int port)
752{753{
753 u8 learn[TOTAL_PORT_NUM];754 u8 learn[DSA_MAX_PORTS];
754 int first, index, cnt;755 int first, index, cnt;
755 struct ksz_port *p;756 struct ksz_port *p;
756 757
757 if ((uint)port < TOTAL_PORT_NUM) {758 if ((uint)port < dev->port_cnt) {
758 first = port;759 first = port;
759 cnt = port + 1;760 cnt = port + 1;
760 } else {761 } else {
761 /* Flush all ports. */762 /* Flush all ports. */
762 first = 0;763 first = 0;
763 cnt = dev->mib_port_cnt;764 cnt = dev->port_cnt;
764 }765 }
765 for (index = first; index < cnt; index++) {766 for (index = first; index < cnt; index++) {
766 p = &dev->ports[index];767 p = &dev->ports[index];
@@ -992,8 +993,6 @@ static void ksz8795_config_cpu_port(struct dsa_switch *ds) · 225 unmodified lines
992 u8 remote;993 u8 remote;
993 int i;994 int i;
994 995
995 ds->num_ports = dev->port_cnt + 1;
996
997 /* Switch marks the maximum frame with extra byte as oversize. */996 /* Switch marks the maximum frame with extra byte as oversize. */
998 ksz_cfg(dev, REG_SW_CTRL_2, SW_LEGAL_PACKET_DISABLE, true);997 ksz_cfg(dev, REG_SW_CTRL_2, SW_LEGAL_PACKET_DISABLE, true);
999 ksz_cfg(dev, S_TAIL_TAG_CTRL, SW_TAIL_TAG_ENABLE, true);998 ksz_cfg(dev, S_TAIL_TAG_CTRL, SW_TAIL_TAG_ENABLE, true);
@@ -1005,7 +1004,7 @@ static void ksz8795_config_cpu_port(struct dsa_switch *ds) · 5 unmodified lines
1005 ksz8795_port_setup(dev, dev->cpu_port, true);1004 ksz8795_port_setup(dev, dev->cpu_port, true);
1006 dev->member = dev->host_mask;1005 dev->member = dev->host_mask;
1007 1006
1008 for (i = 0; i < SWITCH_PORT_NUM; i++) {1007 for (i = 0; i < dev->phy_port_cnt; i++) {
1009 p = &dev->ports[i];1008 p = &dev->ports[i];
1010 1009
1011 /* Initialize to non-zero so that ksz_cfg_port_member() will1010 /* Initialize to non-zero so that ksz_cfg_port_member() will
@@ -1016,7 +1015,7 @@ static void ksz8795_config_cpu_port(struct dsa_switch *ds) · 4 unmodified lines
1016 ksz8795_port_stp_state_set(ds, i, BR_STATE_DISABLED);1015 ksz8795_port_stp_state_set(ds, i, BR_STATE_DISABLED);
1017 1016
1018 /* Last port may be disabled. */1017 /* Last port may be disabled. */
1019 if (i == dev->port_cnt)1018 if (i == dev->phy_port_cnt)
1020 break;1019 break;
1021 p->on = 1;1020 p->on = 1;
1022 p->phy = 1;1021 p->phy = 1;
@@ -1085,7 +1084,7 @@ static int ksz8795_setup(struct dsa_switch *ds) · 62 unmodified lines
1085 (BROADCAST_STORM_VALUE *1084 (BROADCAST_STORM_VALUE *
1086 BROADCAST_STORM_PROT_RATE) / 100);1085 BROADCAST_STORM_PROT_RATE) / 100);
1087 1086
1088 for (i = 0; i < VLAN_TABLE_ENTRIES; i++)1087 for (i = 0; i < (dev->num_vlans / 4); i++)
1089 ksz8795_r_vlan_entries(dev, i);1088 ksz8795_r_vlan_entries(dev, i);
1090 1089
1091 /* Setup STP address for STP operation. */1090 /* Setup STP address for STP operation. */
@@ -1150,10 +1149,6 @@ static int ksz8795_switch_detect(struct ksz_device *dev) · 58 unmodified lines
1150 (id2 != CHIP_ID_94 && id2 != CHIP_ID_95))1149 (id2 != CHIP_ID_94 && id2 != CHIP_ID_95))
1151 return -ENODEV;1150 return -ENODEV;
1152 1151
1153 dev->mib_port_cnt = TOTAL_PORT_NUM;
1154 dev->phy_port_cnt = SWITCH_PORT_NUM;
1155 dev->port_cnt = SWITCH_PORT_NUM;
1156
1157 if (id2 == CHIP_ID_95) {1152 if (id2 == CHIP_ID_95) {
1158 u8 val;1153 u8 val;
1159 1154
@@ -1162,17 +1157,12 @@ static int ksz8795_switch_detect(struct ksz_device *dev) · 2 unmodified lines
1162 if (val & PORT_FIBER_MODE)1157 if (val & PORT_FIBER_MODE)
1163 id2 = 0x65;1158 id2 = 0x65;
1164 } else if (id2 == CHIP_ID_94) {1159 } else if (id2 == CHIP_ID_94) {
1165 dev->port_cnt--;
1166 dev->last_port = dev->port_cnt;
1167 id2 = 0x94;1160 id2 = 0x94;
1168 }1161 }
1169 id16 &= ~0xff;1162 id16 &= ~0xff;
1170 id16 |= id2;1163 id16 |= id2;
1171 dev->chip_id = id16;1164 dev->chip_id = id16;
1172 1165
1173 dev->cpu_port = dev->mib_port_cnt - 1;
1174 dev->host_mask = BIT(dev->cpu_port);
1175
1176 return 0;1166 return 0;
1177}1167}
1178 1168
@@ -1194,7 +1184,7 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { · 15 unmodified lines
1194 .num_alus = 0,1184 .num_alus = 0,
1195 .num_statics = 8,1185 .num_statics = 8,
1196 .cpu_ports = 0x10, /* can be configured as cpu port */1186 .cpu_ports = 0x10, /* can be configured as cpu port */
1197 .port_cnt = 4, /* total physical port count */1187 .port_cnt = 5, /* total cpu and user ports */
1198 },1188 },
1199 {1189 {
1200 .chip_id = 0x8794,1190 .chip_id = 0x8794,
@@ -1203,7 +1193,7 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { · 2 unmodified lines
1203 .num_alus = 0,1193 .num_alus = 0,
1204 .num_statics = 8,1194 .num_statics = 8,
1205 .cpu_ports = 0x10, /* can be configured as cpu port */1195 .cpu_ports = 0x10, /* can be configured as cpu port */
1206 .port_cnt = 3, /* total physical port count */1196 .port_cnt = 4, /* total cpu and user ports */
1207 },1197 },
1208 {1198 {
1209 .chip_id = 0x8765,1199 .chip_id = 0x8765,
@@ -1212,7 +1202,7 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = { · 2 unmodified lines
1212 .num_alus = 0,1202 .num_alus = 0,
1213 .num_statics = 8,1203 .num_statics = 8,
1214 .cpu_ports = 0x10, /* can be configured as cpu port */1204 .cpu_ports = 0x10, /* can be configured as cpu port */
1215 .port_cnt = 4, /* total physical port count */1205 .port_cnt = 5, /* total cpu and user ports */
1216 },1206 },
1217};1207};
1218 1208
@@ -1244,27 +1234,32 @@ static int ksz8795_switch_init(struct ksz_device *dev) · 25 unmodified lines
1244 dev->port_mask = BIT(dev->port_cnt) - 1;1234 dev->port_mask = BIT(dev->port_cnt) - 1;
1245 dev->port_mask |= dev->host_mask;1235 dev->port_mask |= dev->host_mask;
1246 1236
1247 dev->reg_mib_cnt = SWITCH_COUNTER_NUM;1237 dev->reg_mib_cnt = KSZ8795_COUNTER_NUM;
1248 dev->mib_cnt = TOTAL_SWITCH_COUNTER_NUM;1238 dev->mib_cnt = ARRAY_SIZE(mib_names);
1239
1240 dev->phy_port_cnt = dev->port_cnt - 1;
1241
1242 dev->cpu_port = dev->port_cnt - 1;
1243 dev->host_mask = BIT(dev->cpu_port);
1249 1244
1250 i = dev->mib_port_cnt;1245 dev->ports = devm_kzalloc(dev->dev,
1251 dev->ports = devm_kzalloc(dev->dev, sizeof(struct ksz_port) * i,1246 dev->port_cnt * sizeof(struct ksz_port),
1252 GFP_KERNEL);1247 GFP_KERNEL);
1253 if (!dev->ports)1248 if (!dev->ports)
1254 return -ENOMEM;1249 return -ENOMEM;
1255 for (i = 0; i < dev->mib_port_cnt; i++) {1250 for (i = 0; i < dev->port_cnt; i++) {
1256 mutex_init(&dev->ports[i].mib.cnt_mutex);1251 mutex_init(&dev->ports[i].mib.cnt_mutex);
1257 dev->ports[i].mib.counters =1252 dev->ports[i].mib.counters =
1258 devm_kzalloc(dev->dev,1253 devm_kzalloc(dev->dev,
1259 sizeof(u64) *1254 sizeof(u64) *
1260 (TOTAL_SWITCH_COUNTER_NUM + 1),1255 (dev->mib_cnt + 1),
1261 GFP_KERNEL);1256 GFP_KERNEL);
1262 if (!dev->ports[i].mib.counters)1257 if (!dev->ports[i].mib.counters)
1263 return -ENOMEM;1258 return -ENOMEM;
1264 }1259 }
1265 1260
1266 /* set the real number of ports */1261 /* set the real number of ports */
1267 dev->ds->num_ports = dev->port_cnt + 1;1262 dev->ds->num_ports = dev->port_cnt;
1268 1263
1269 return 0;1264 return 0;
1270}1265}
drivers/net/dsa/microchip/ksz8795_reg.h+0−10
@@ -846,16 +846,7 @@ · 845 unmodified lines
846 846
847#define KS_PRIO_IN_REG 4847#define KS_PRIO_IN_REG 4
848 848
849#define TOTAL_PORT_NUM 5
850
851/* Host port can only be last of them. */
852#define SWITCH_PORT_NUM (TOTAL_PORT_NUM - 1)
853
854#define KSZ8795_COUNTER_NUM 0x20849#define KSZ8795_COUNTER_NUM 0x20
855#define TOTAL_KSZ8795_COUNTER_NUM (KSZ8795_COUNTER_NUM + 4)
856
857#define SWITCH_COUNTER_NUM KSZ8795_COUNTER_NUM
858#define TOTAL_SWITCH_COUNTER_NUM TOTAL_KSZ8795_COUNTER_NUM
859 850
860/* Common names used by other drivers */851/* Common names used by other drivers */
861 852
@@ -998,7 +989,6 @@ · 136 unmodified lines
998#define TAIL_TAG_OVERRIDE BIT(6)989#define TAIL_TAG_OVERRIDE BIT(6)
999#define TAIL_TAG_LOOKUP BIT(7)990#define TAIL_TAG_LOOKUP BIT(7)
1000 991
1001#define VLAN_TABLE_ENTRIES (4096 / 4)
1002#define FID_ENTRIES 128992#define FID_ENTRIES 128
1003 993
1004#endif994#endif
drivers/net/dsa/microchip/ksz9477.c+5−9
@@ -478,7 +478,7 @@ static void ksz9477_flush_dyn_mac_table(struct ksz_device *dev, int port) · 477 unmodified lines
478 SW_FLUSH_OPTION_M << SW_FLUSH_OPTION_S,478 SW_FLUSH_OPTION_M << SW_FLUSH_OPTION_S,
479 SW_FLUSH_OPTION_DYN_MAC << SW_FLUSH_OPTION_S);479 SW_FLUSH_OPTION_DYN_MAC << SW_FLUSH_OPTION_S);
480 480
481 if (port < dev->mib_port_cnt) {481 if (port < dev->port_cnt) {
482 /* flush individual port */482 /* flush individual port */
483 ksz_pread8(dev, port, P_STP_CTRL, &data);483 ksz_pread8(dev, port, P_STP_CTRL, &data);
484 if (!(data & PORT_LEARN_DISABLE))484 if (!(data & PORT_LEARN_DISABLE))
@@ -1267,8 +1267,6 @@ static void ksz9477_config_cpu_port(struct dsa_switch *ds) · 782 unmodified lines
1267 struct ksz_port *p;1267 struct ksz_port *p;
1268 int i;1268 int i;
1269 1269
1270 ds->num_ports = dev->port_cnt;
1271
1272 for (i = 0; i < dev->port_cnt; i++) {1270 for (i = 0; i < dev->port_cnt; i++) {
1273 if (dsa_is_cpu_port(ds, i) && (dev->cpu_ports & (1 << i))) {1271 if (dsa_is_cpu_port(ds, i) && (dev->cpu_ports & (1 << i))) {
1274 phy_interface_t interface;1272 phy_interface_t interface;
@@ -1319,7 +1317,7 @@ static void ksz9477_config_cpu_port(struct dsa_switch *ds) · 44 unmodified lines
1319 1317
1320 dev->member = dev->host_mask;1318 dev->member = dev->host_mask;
1321 1319
1322 for (i = 0; i < dev->mib_port_cnt; i++) {1320 for (i = 0; i < dev->port_cnt; i++) {
1323 if (i == dev->cpu_port)1321 if (i == dev->cpu_port)
1324 continue;1322 continue;
1325 p = &dev->ports[i];1323 p = &dev->ports[i];
@@ -1446,7 +1444,6 @@ static int ksz9477_switch_detect(struct ksz_device *dev) · 120 unmodified lines
1446 return ret;1444 return ret;
1447 1445
1448 /* Number of ports can be reduced depending on chip. */1446 /* Number of ports can be reduced depending on chip. */
1449 dev->mib_port_cnt = TOTAL_PORT_NUM;
1450 dev->phy_port_cnt = 5;1447 dev->phy_port_cnt = 5;
1451 1448
1452 /* Default capability is gigabit capable. */1449 /* Default capability is gigabit capable. */
@@ -1463,7 +1460,6 @@ static int ksz9477_switch_detect(struct ksz_device *dev) · 10 unmodified lines
1463 /* Chip does not support gigabit. */1460 /* Chip does not support gigabit. */
1464 if (data8 & SW_QW_ABLE)1461 if (data8 & SW_QW_ABLE)
1465 dev->features &= ~GBIT_SUPPORT;1462 dev->features &= ~GBIT_SUPPORT;
1466 dev->mib_port_cnt = 3;
1467 dev->phy_port_cnt = 2;1463 dev->phy_port_cnt = 2;
1468 } else {1464 } else {
1469 dev_info(dev->dev, "Found KSZ9477 or compatible\n");1465 dev_info(dev->dev, "Found KSZ9477 or compatible\n");
@@ -1566,12 +1562,12 @@ static int ksz9477_switch_init(struct ksz_device *dev) · 96 unmodified lines
1566 dev->reg_mib_cnt = SWITCH_COUNTER_NUM;1562 dev->reg_mib_cnt = SWITCH_COUNTER_NUM;
1567 dev->mib_cnt = TOTAL_SWITCH_COUNTER_NUM;1563 dev->mib_cnt = TOTAL_SWITCH_COUNTER_NUM;
1568 1564
1569 i = dev->mib_port_cnt;1565 dev->ports = devm_kzalloc(dev->dev,
1570 dev->ports = devm_kzalloc(dev->dev, sizeof(struct ksz_port) * i,1566 dev->port_cnt * sizeof(struct ksz_port),
1571 GFP_KERNEL);1567 GFP_KERNEL);
1572 if (!dev->ports)1568 if (!dev->ports)
1573 return -ENOMEM;1569 return -ENOMEM;
1574 for (i = 0; i < dev->mib_port_cnt; i++) {1570 for (i = 0; i < dev->port_cnt; i++) {
1575 mutex_init(&dev->ports[i].mib.cnt_mutex);1571 mutex_init(&dev->ports[i].mib.cnt_mutex);
1576 dev->ports[i].mib.counters =1572 dev->ports[i].mib.counters =
1577 devm_kzalloc(dev->dev,1573 devm_kzalloc(dev->dev,
drivers/net/dsa/microchip/ksz_common.c+2−2
@@ -72,7 +72,7 @@ static void ksz_mib_read_work(struct work_struct *work) · 71 unmodified lines
72 struct ksz_port *p;72 struct ksz_port *p;
73 int i;73 int i;
74 74
75 for (i = 0; i < dev->mib_port_cnt; i++) {75 for (i = 0; i < dev->port_cnt; i++) {
76 if (dsa_is_unused_port(dev->ds, i))76 if (dsa_is_unused_port(dev->ds, i))
77 continue;77 continue;
78 78
@@ -103,7 +103,7 @@ void ksz_init_mib_timer(struct ksz_device *dev) · 24 unmodified lines
103 103
104 INIT_DELAYED_WORK(&dev->mib_read, ksz_mib_read_work);104 INIT_DELAYED_WORK(&dev->mib_read, ksz_mib_read_work);
105 105
106 for (i = 0; i < dev->mib_port_cnt; i++)106 for (i = 0; i < dev->port_cnt; i++)
107 dev->dev_ops->port_init_cnt(dev, i);107 dev->dev_ops->port_init_cnt(dev, i);
108}108}
109EXPORT_SYMBOL_GPL(ksz_init_mib_timer);109EXPORT_SYMBOL_GPL(ksz_init_mib_timer);
drivers/net/dsa/microchip/ksz_common.h+0−2
@@ -71,8 +71,6 @@ struct ksz_device { · 70 unmodified lines
71 int port_cnt;71 int port_cnt;
72 int reg_mib_cnt;72 int reg_mib_cnt;
73 int mib_cnt;73 int mib_cnt;
74 int mib_port_cnt;
75 int last_port; /* ports after that not used */
76 phy_interface_t compat_interface;74 phy_interface_t compat_interface;
77 u32 regs_size;75 u32 regs_size;
78 bool phy_errata_9477;76 bool phy_errata_9477;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t