diff options
-rw-r--r-- | net/dsa/Makefile | 7 | ||||
-rw-r--r-- | net/dsa/mv88e6123_61_65.c | 15 | ||||
-rw-r--r-- | net/dsa/mv88e6131.c | 15 | ||||
-rw-r--r-- | net/dsa/mv88e6xxx.c | 23 | ||||
-rw-r--r-- | net/dsa/mv88e6xxx.h | 3 |
5 files changed, 32 insertions, 31 deletions
diff --git a/net/dsa/Makefile b/net/dsa/Makefile index 5431b4a43c1..5c48ac55699 100644 --- a/net/dsa/Makefile +++ b/net/dsa/Makefile | |||
@@ -8,7 +8,8 @@ dsa_core-$(CONFIG_NET_DSA_TAG_EDSA) += tag_edsa.o | |||
8 | dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o | 8 | dsa_core-$(CONFIG_NET_DSA_TAG_TRAILER) += tag_trailer.o |
9 | 9 | ||
10 | # switch drivers | 10 | # switch drivers |
11 | obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx.o | ||
12 | obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o | 11 | obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o |
13 | obj-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o | 12 | obj-$(CONFIG_NET_DSA_MV88E6XXX) += mv88e6xxx_drv.o |
14 | obj-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.o | 13 | mv88e6xxx_drv-y += mv88e6xxx.o |
14 | mv88e6xxx_drv-$(CONFIG_NET_DSA_MV88E6123_61_65) += mv88e6123_61_65.o | ||
15 | mv88e6xxx_drv-$(CONFIG_NET_DSA_MV88E6131) += mv88e6131.o | ||
diff --git a/net/dsa/mv88e6123_61_65.c b/net/dsa/mv88e6123_61_65.c index 52faaa21a4d..7951a6cc9bd 100644 --- a/net/dsa/mv88e6123_61_65.c +++ b/net/dsa/mv88e6123_61_65.c | |||
@@ -419,7 +419,7 @@ static int mv88e6123_61_65_get_sset_count(struct dsa_switch *ds) | |||
419 | return ARRAY_SIZE(mv88e6123_61_65_hw_stats); | 419 | return ARRAY_SIZE(mv88e6123_61_65_hw_stats); |
420 | } | 420 | } |
421 | 421 | ||
422 | static struct dsa_switch_driver mv88e6123_61_65_switch_driver = { | 422 | struct dsa_switch_driver mv88e6123_61_65_switch_driver = { |
423 | .tag_protocol = cpu_to_be16(ETH_P_EDSA), | 423 | .tag_protocol = cpu_to_be16(ETH_P_EDSA), |
424 | .priv_size = sizeof(struct mv88e6xxx_priv_state), | 424 | .priv_size = sizeof(struct mv88e6xxx_priv_state), |
425 | .probe = mv88e6123_61_65_probe, | 425 | .probe = mv88e6123_61_65_probe, |
@@ -432,16 +432,3 @@ static struct dsa_switch_driver mv88e6123_61_65_switch_driver = { | |||
432 | .get_ethtool_stats = mv88e6123_61_65_get_ethtool_stats, | 432 | .get_ethtool_stats = mv88e6123_61_65_get_ethtool_stats, |
433 | .get_sset_count = mv88e6123_61_65_get_sset_count, | 433 | .get_sset_count = mv88e6123_61_65_get_sset_count, |
434 | }; | 434 | }; |
435 | |||
436 | static int __init mv88e6123_61_65_init(void) | ||
437 | { | ||
438 | register_switch_driver(&mv88e6123_61_65_switch_driver); | ||
439 | return 0; | ||
440 | } | ||
441 | module_init(mv88e6123_61_65_init); | ||
442 | |||
443 | static void __exit mv88e6123_61_65_cleanup(void) | ||
444 | { | ||
445 | unregister_switch_driver(&mv88e6123_61_65_switch_driver); | ||
446 | } | ||
447 | module_exit(mv88e6123_61_65_cleanup); | ||
diff --git a/net/dsa/mv88e6131.c b/net/dsa/mv88e6131.c index 9bd1061fa4e..45f41239381 100644 --- a/net/dsa/mv88e6131.c +++ b/net/dsa/mv88e6131.c | |||
@@ -415,7 +415,7 @@ static int mv88e6131_get_sset_count(struct dsa_switch *ds) | |||
415 | return ARRAY_SIZE(mv88e6131_hw_stats); | 415 | return ARRAY_SIZE(mv88e6131_hw_stats); |
416 | } | 416 | } |
417 | 417 | ||
418 | static struct dsa_switch_driver mv88e6131_switch_driver = { | 418 | struct dsa_switch_driver mv88e6131_switch_driver = { |
419 | .tag_protocol = cpu_to_be16(ETH_P_DSA), | 419 | .tag_protocol = cpu_to_be16(ETH_P_DSA), |
420 | .priv_size = sizeof(struct mv88e6xxx_priv_state), | 420 | .priv_size = sizeof(struct mv88e6xxx_priv_state), |
421 | .probe = mv88e6131_probe, | 421 | .probe = mv88e6131_probe, |
@@ -428,16 +428,3 @@ static struct dsa_switch_driver mv88e6131_switch_driver = { | |||
428 | .get_ethtool_stats = mv88e6131_get_ethtool_stats, | 428 | .get_ethtool_stats = mv88e6131_get_ethtool_stats, |
429 | .get_sset_count = mv88e6131_get_sset_count, | 429 | .get_sset_count = mv88e6131_get_sset_count, |
430 | }; | 430 | }; |
431 | |||
432 | static int __init mv88e6131_init(void) | ||
433 | { | ||
434 | register_switch_driver(&mv88e6131_switch_driver); | ||
435 | return 0; | ||
436 | } | ||
437 | module_init(mv88e6131_init); | ||
438 | |||
439 | static void __exit mv88e6131_cleanup(void) | ||
440 | { | ||
441 | unregister_switch_driver(&mv88e6131_switch_driver); | ||
442 | } | ||
443 | module_exit(mv88e6131_cleanup); | ||
diff --git a/net/dsa/mv88e6xxx.c b/net/dsa/mv88e6xxx.c index efe661a9def..50fd8602796 100644 --- a/net/dsa/mv88e6xxx.c +++ b/net/dsa/mv88e6xxx.c | |||
@@ -520,3 +520,26 @@ void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, | |||
520 | 520 | ||
521 | mutex_unlock(&ps->stats_mutex); | 521 | mutex_unlock(&ps->stats_mutex); |
522 | } | 522 | } |
523 | |||
524 | static int __init mv88e6xxx_init(void) | ||
525 | { | ||
526 | #if IS_ENABLED(CONFIG_NET_DSA_MV88E6131) | ||
527 | register_switch_driver(&mv88e6131_switch_driver); | ||
528 | #endif | ||
529 | #if IS_ENABLED(CONFIG_NET_DSA_MV88E6123_61_65) | ||
530 | register_switch_driver(&mv88e6123_61_65_switch_driver); | ||
531 | #endif | ||
532 | return 0; | ||
533 | } | ||
534 | module_init(mv88e6xxx_init); | ||
535 | |||
536 | static void __exit mv88e6xxx_cleanup(void) | ||
537 | { | ||
538 | #if IS_ENABLED(CONFIG_NET_DSA_MV88E6123_61_65) | ||
539 | unregister_switch_driver(&mv88e6123_61_65_switch_driver); | ||
540 | #endif | ||
541 | #if IS_ENABLED(CONFIG_NET_DSA_MV88E6131) | ||
542 | unregister_switch_driver(&mv88e6131_switch_driver); | ||
543 | #endif | ||
544 | } | ||
545 | module_exit(mv88e6xxx_cleanup); | ||
diff --git a/net/dsa/mv88e6xxx.h b/net/dsa/mv88e6xxx.h index 61156ca26a0..fc2cd7b90e8 100644 --- a/net/dsa/mv88e6xxx.h +++ b/net/dsa/mv88e6xxx.h | |||
@@ -71,6 +71,9 @@ void mv88e6xxx_get_ethtool_stats(struct dsa_switch *ds, | |||
71 | int nr_stats, struct mv88e6xxx_hw_stat *stats, | 71 | int nr_stats, struct mv88e6xxx_hw_stat *stats, |
72 | int port, uint64_t *data); | 72 | int port, uint64_t *data); |
73 | 73 | ||
74 | extern struct dsa_switch_driver mv88e6131_switch_driver; | ||
75 | extern struct dsa_switch_driver mv88e6123_61_65_switch_driver; | ||
76 | |||
74 | #define REG_READ(addr, reg) \ | 77 | #define REG_READ(addr, reg) \ |
75 | ({ \ | 78 | ({ \ |
76 | int __ret; \ | 79 | int __ret; \ |