generic: 6.18: manually rebuild backport patches

Manually rebuild backport patches:
 - 700-01-v7.0-net-sched-Export-mq-functions-for-reuse.patch
 - 700-02-v7.0-net-sched-sch_cake-Factor-out-config-variables-into-.patch
 - 750-v7.0-net-phy-move-mmd_phy_read-and-mmd_phy_write-to-phyli.patch
 - 761-v6.19-net-phy-mxl-gpy-add-support-for-mxl86252-and-mxl86282.patch

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/21078
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Mieczyslaw Nalewaj 2026-01-07 14:27:14 +01:00 committed by Robert Marko
parent 5c73f28bfd
commit 4e16e53913
4 changed files with 63 additions and 102 deletions

View File

@ -27,7 +27,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -22541,6 +22541,7 @@ L: netdev@vger.kernel.org
@@ -25056,6 +25056,7 @@ L: netdev@vger.kernel.org
S: Maintained
F: include/net/pkt_cls.h
F: include/net/pkt_sched.h
@ -99,7 +99,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
qdisc_put(priv->qdiscs[ntx]);
kfree(priv->qdiscs);
}
+EXPORT_SYMBOL_NS_GPL(mq_destroy_common, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_destroy_common, "NET_SCHED_INTERNAL");
-static int mq_init(struct Qdisc *sch, struct nlattr *opt,
- struct netlink_ext_ack *extack)
@ -131,7 +131,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
sch->flags |= TCQ_F_MQROOT;
+ return 0;
+}
+EXPORT_SYMBOL_NS_GPL(mq_init_common, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_init_common, "NET_SCHED_INTERNAL");
+
+static int mq_init(struct Qdisc *sch, struct nlattr *opt,
+ struct netlink_ext_ack *extack)
@ -155,7 +155,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
kfree(priv->qdiscs);
priv->qdiscs = NULL;
}
+EXPORT_SYMBOL_NS_GPL(mq_attach, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_attach, "NET_SCHED_INTERNAL");
-static int mq_dump(struct Qdisc *sch, struct sk_buff *skb)
+void mq_dump_common(struct Qdisc *sch, struct sk_buff *skb)
@ -167,7 +167,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
spin_unlock_bh(qdisc_lock(qdisc));
}
+}
+EXPORT_SYMBOL_NS_GPL(mq_dump_common, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_dump_common, "NET_SCHED_INTERNAL");
+static int mq_dump(struct Qdisc *sch, struct sk_buff *skb)
+{
@ -186,7 +186,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
{
return mq_queue_get(sch, TC_H_MIN(tcm->tcm_parent));
}
+EXPORT_SYMBOL_NS_GPL(mq_select_queue, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_select_queue, "NET_SCHED_INTERNAL");
static int mq_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new,
struct Qdisc **old, struct netlink_ext_ack *extack)
@ -201,7 +201,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return rtnl_dereference(dev_queue->qdisc_sleeping);
}
+EXPORT_SYMBOL_NS_GPL(mq_leaf, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_leaf, "NET_SCHED_INTERNAL");
-static unsigned long mq_find(struct Qdisc *sch, u32 classid)
+unsigned long mq_find(struct Qdisc *sch, u32 classid)
@ -212,7 +212,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return 0;
return ntx;
}
+EXPORT_SYMBOL_NS_GPL(mq_find, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_find, "NET_SCHED_INTERNAL");
-static int mq_dump_class(struct Qdisc *sch, unsigned long cl,
- struct sk_buff *skb, struct tcmsg *tcm)
@ -225,7 +225,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tcm->tcm_info = rtnl_dereference(dev_queue->qdisc_sleeping)->handle;
return 0;
}
+EXPORT_SYMBOL_NS_GPL(mq_dump_class, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_dump_class, "NET_SCHED_INTERNAL");
-static int mq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
- struct gnet_dump *d)
@ -238,7 +238,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return -1;
return 0;
}
+EXPORT_SYMBOL_NS_GPL(mq_dump_class_stats, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_dump_class_stats, "NET_SCHED_INTERNAL");
-static void mq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
+void mq_walk(struct Qdisc *sch, struct qdisc_walker *arg)
@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
break;
}
}
+EXPORT_SYMBOL_NS_GPL(mq_walk, NET_SCHED_INTERNAL);
+EXPORT_SYMBOL_NS_GPL(mq_walk, "NET_SCHED_INTERNAL");
static const struct Qdisc_class_ops mq_class_ops = {
.select_queue = mq_select_queue,

View File

@ -86,7 +86,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* indices for dequeue */
u16 cur_tin;
@@ -1195,7 +1197,7 @@ static bool cake_tcph_may_drop(const str
@@ -1198,7 +1200,7 @@ static bool cake_tcph_may_drop(const str
static struct sk_buff *cake_ack_filter(struct cake_sched_data *q,
struct cake_flow *flow)
{
@ -95,7 +95,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
struct sk_buff *elig_ack = NULL, *elig_ack_prev = NULL;
struct sk_buff *skb_check, *skb_prev = NULL;
const struct ipv6hdr *ipv6h, *ipv6h_check;
@@ -1355,15 +1357,17 @@ static u64 cake_ewma(u64 avg, u64 sample
@@ -1358,15 +1360,17 @@ static u64 cake_ewma(u64 avg, u64 sample
return avg;
}
@ -118,7 +118,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
len += q->rate_overhead;
@@ -1382,10 +1386,10 @@ static u32 cake_calc_overhead(struct cak
@@ -1385,10 +1389,10 @@ static u32 cake_calc_overhead(struct cak
len += (len + 63) / 64;
}
@ -133,16 +133,16 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
return len;
}
@@ -1587,7 +1591,7 @@ static unsigned int cake_drop(struct Qdi
@@ -1592,7 +1596,7 @@ static unsigned int cake_drop(struct Qdi
flow->dropped++;
b->tin_dropped++;
sch->qstats.drops++;
- if (q->rate_flags & CAKE_FLAG_INGRESS)
+ if (q->config->rate_flags & CAKE_FLAG_INGRESS)
cake_advance_shaper(q, b, skb, now, true);
__qdisc_drop(skb, to_free);
@@ -1657,7 +1661,8 @@ static u8 cake_handle_diffserv(struct sk
qdisc_drop_reason(skb, sch, to_free, SKB_DROP_REASON_QDISC_OVERLIMIT);
@@ -1662,7 +1666,8 @@ static u8 cake_handle_diffserv(struct sk
static struct cake_tin_data *cake_select_tin(struct Qdisc *sch,
struct sk_buff *skb)
{
@ -152,7 +152,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 tin, mark;
bool wash;
u8 dscp;
@@ -1674,24 +1679,24 @@ static struct cake_tin_data *cake_select
@@ -1679,24 +1684,24 @@ static struct cake_tin_data *cake_select
if (q->tin_mode == CAKE_DIFFSERV_BESTEFFORT)
tin = 0;
@ -184,7 +184,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
static u32 cake_classify(struct Qdisc *sch, struct cake_tin_data **t,
@@ -1747,7 +1752,7 @@ static s32 cake_enqueue(struct sk_buff *
@@ -1752,7 +1757,7 @@ static s32 cake_enqueue(struct sk_buff *
bool same_flow = false;
/* choose flow to insert into */
@ -193,7 +193,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
if (idx == 0) {
if (ret & __NET_XMIT_BYPASS)
qdisc_qstats_drop(sch);
@@ -1782,7 +1787,7 @@ static s32 cake_enqueue(struct sk_buff *
@@ -1787,7 +1792,7 @@ static s32 cake_enqueue(struct sk_buff *
if (unlikely(len > b->max_skblen))
b->max_skblen = len;
@ -202,7 +202,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
struct sk_buff *segs, *nskb;
netdev_features_t features = netif_skb_features(skb);
unsigned int slen = 0, numsegs = 0;
@@ -1823,7 +1828,7 @@ static s32 cake_enqueue(struct sk_buff *
@@ -1828,7 +1833,7 @@ static s32 cake_enqueue(struct sk_buff *
get_cobalt_cb(skb)->adjusted_len = cake_overhead(q, skb);
flow_queue_add(flow, skb);
@ -211,7 +211,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
ack = cake_ack_filter(q, flow);
if (ack) {
@@ -1832,7 +1837,7 @@ static s32 cake_enqueue(struct sk_buff *
@@ -1837,7 +1842,7 @@ static s32 cake_enqueue(struct sk_buff *
ack_pkt_len = qdisc_pkt_len(ack);
b->bytes += ack_pkt_len;
q->buffer_used += skb->truesize - ack->truesize;
@ -220,7 +220,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
cake_advance_shaper(q, b, ack, now, true);
qdisc_tree_reduce_backlog(sch, 1, ack_pkt_len);
@@ -1855,7 +1860,7 @@ static s32 cake_enqueue(struct sk_buff *
@@ -1860,7 +1865,7 @@ static s32 cake_enqueue(struct sk_buff *
cake_heapify_up(q, b->overflow_idx[idx]);
/* incoming bandwidth capacity estimate */
@ -229,7 +229,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u64 packet_interval = \
ktime_to_ns(ktime_sub(now, q->last_packet_time));
@@ -1887,7 +1892,7 @@ static s32 cake_enqueue(struct sk_buff *
@@ -1892,7 +1897,7 @@ static s32 cake_enqueue(struct sk_buff *
if (ktime_after(now,
ktime_add_ms(q->last_reconfig_time,
250))) {
@ -238,7 +238,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
cake_reconfigure(sch);
}
}
@@ -1907,7 +1912,7 @@ static s32 cake_enqueue(struct sk_buff *
@@ -1912,7 +1917,7 @@ static s32 cake_enqueue(struct sk_buff *
flow->set = CAKE_SET_SPARSE;
b->sparse_flow_count++;
@ -247,7 +247,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
} else if (flow->set == CAKE_SET_SPARSE_WAIT) {
/* this flow was empty, accounted as a sparse flow, but actually
* in the bulk rotation.
@@ -1916,8 +1921,8 @@ static s32 cake_enqueue(struct sk_buff *
@@ -1921,8 +1926,8 @@ static s32 cake_enqueue(struct sk_buff *
b->sparse_flow_count--;
b->bulk_flow_count++;
@ -258,7 +258,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
if (q->buffer_used > q->buffer_max_used)
@@ -2103,8 +2108,8 @@ retry:
@@ -2109,8 +2114,8 @@ retry:
b->sparse_flow_count--;
b->bulk_flow_count++;
@ -269,7 +269,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
flow->set = CAKE_SET_BULK;
} else {
@@ -2116,7 +2121,7 @@ retry:
@@ -2122,7 +2127,7 @@ retry:
}
}
@ -278,7 +278,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
list_move_tail(&flow->flowchain, &b->old_flows);
goto retry;
@@ -2140,8 +2145,8 @@ retry:
@@ -2146,8 +2151,8 @@ retry:
if (flow->set == CAKE_SET_BULK) {
b->bulk_flow_count--;
@ -289,7 +289,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
b->decaying_flow_count++;
} else if (flow->set == CAKE_SET_SPARSE ||
@@ -2159,8 +2164,8 @@ retry:
@@ -2165,8 +2170,8 @@ retry:
else if (flow->set == CAKE_SET_BULK) {
b->bulk_flow_count--;
@ -300,14 +300,15 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
} else
b->decaying_flow_count--;
@@ -2172,13 +2177,13 @@ retry:
@@ -2177,14 +2182,14 @@ retry:
reason = cobalt_should_drop(&flow->cvars, &b->cparams, now, skb,
(b->bulk_flow_count *
- !!(q->rate_flags &
+ !!(q->config->rate_flags &
CAKE_FLAG_INGRESS)));
/* Last packet in queue may be marked, shouldn't be dropped */
if (!cobalt_should_drop(&flow->cvars, &b->cparams, now, skb,
(b->bulk_flow_count *
- !!(q->rate_flags &
+ !!(q->config->rate_flags &
CAKE_FLAG_INGRESS))) ||
!flow->head)
if (reason == SKB_NOT_DROPPED_YET || !flow->head)
break;
/* drop this packet, get another one */
@ -316,16 +317,16 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
len = cake_advance_shaper(q, b, skb,
now, true);
flow->deficit -= len;
@@ -2189,7 +2194,7 @@ retry:
@@ -2195,7 +2200,7 @@ retry:
qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
qdisc_qstats_drop(sch);
kfree_skb(skb);
kfree_skb_reason(skb, reason);
- if (q->rate_flags & CAKE_FLAG_INGRESS)
+ if (q->config->rate_flags & CAKE_FLAG_INGRESS)
goto retry;
}
@@ -2311,7 +2316,7 @@ static int cake_config_besteffort(struct
@@ -2317,7 +2322,7 @@ static int cake_config_besteffort(struct
struct cake_sched_data *q = qdisc_priv(sch);
struct cake_tin_data *b = &q->tins[0];
u32 mtu = psched_mtu(qdisc_dev(sch));
@ -334,7 +335,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
q->tin_cnt = 1;
@@ -2319,7 +2324,7 @@ static int cake_config_besteffort(struct
@@ -2325,7 +2330,7 @@ static int cake_config_besteffort(struct
q->tin_order = normal_order;
cake_set_rate(b, rate, mtu,
@ -343,7 +344,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
b->tin_quantum = 65535;
return 0;
@@ -2330,7 +2335,7 @@ static int cake_config_precedence(struct
@@ -2336,7 +2341,7 @@ static int cake_config_precedence(struct
/* convert high-level (user visible) parameters into internal format */
struct cake_sched_data *q = qdisc_priv(sch);
u32 mtu = psched_mtu(qdisc_dev(sch));
@ -352,7 +353,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 quantum = 256;
u32 i;
@@ -2341,8 +2346,8 @@ static int cake_config_precedence(struct
@@ -2347,8 +2352,8 @@ static int cake_config_precedence(struct
for (i = 0; i < q->tin_cnt; i++) {
struct cake_tin_data *b = &q->tins[i];
@ -363,7 +364,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
b->tin_quantum = max_t(u16, 1U, quantum);
@@ -2419,7 +2424,7 @@ static int cake_config_diffserv8(struct
@@ -2425,7 +2430,7 @@ static int cake_config_diffserv8(struct
struct cake_sched_data *q = qdisc_priv(sch);
u32 mtu = psched_mtu(qdisc_dev(sch));
@ -372,7 +373,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 quantum = 256;
u32 i;
@@ -2433,8 +2438,8 @@ static int cake_config_diffserv8(struct
@@ -2439,8 +2444,8 @@ static int cake_config_diffserv8(struct
for (i = 0; i < q->tin_cnt; i++) {
struct cake_tin_data *b = &q->tins[i];
@ -383,7 +384,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
b->tin_quantum = max_t(u16, 1U, quantum);
@@ -2463,7 +2468,7 @@ static int cake_config_diffserv4(struct
@@ -2469,7 +2474,7 @@ static int cake_config_diffserv4(struct
struct cake_sched_data *q = qdisc_priv(sch);
u32 mtu = psched_mtu(qdisc_dev(sch));
@ -392,7 +393,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 quantum = 1024;
q->tin_cnt = 4;
@@ -2474,13 +2479,13 @@ static int cake_config_diffserv4(struct
@@ -2480,13 +2485,13 @@ static int cake_config_diffserv4(struct
/* class characteristics */
cake_set_rate(&q->tins[0], rate, mtu,
@ -410,7 +411,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* bandwidth-sharing weights */
q->tins[0].tin_quantum = quantum;
@@ -2500,7 +2505,7 @@ static int cake_config_diffserv3(struct
@@ -2506,7 +2511,7 @@ static int cake_config_diffserv3(struct
*/
struct cake_sched_data *q = qdisc_priv(sch);
u32 mtu = psched_mtu(qdisc_dev(sch));
@ -419,7 +420,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
u32 quantum = 1024;
q->tin_cnt = 3;
@@ -2511,11 +2516,11 @@ static int cake_config_diffserv3(struct
@@ -2517,11 +2522,11 @@ static int cake_config_diffserv3(struct
/* class characteristics */
cake_set_rate(&q->tins[0], rate, mtu,
@ -434,7 +435,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
/* bandwidth-sharing weights */
q->tins[0].tin_quantum = quantum;
@@ -2527,7 +2532,8 @@ static int cake_config_diffserv3(struct
@@ -2533,7 +2538,8 @@ static int cake_config_diffserv3(struct
static void cake_reconfigure(struct Qdisc *sch)
{
@ -444,7 +445,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
int c, ft;
switch (q->tin_mode) {
@@ -2553,36 +2559,37 @@ static void cake_reconfigure(struct Qdis
@@ -2559,36 +2565,37 @@ static void cake_reconfigure(struct Qdis
break;
}
@ -493,7 +494,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
struct nlattr *tb[TCA_CAKE_MAX + 1];
u16 rate_flags;
u8 flow_mode;
@@ -2636,19 +2643,19 @@ static int cake_change(struct Qdisc *sch
@@ -2642,19 +2649,19 @@ static int cake_change(struct Qdisc *sch
nla_get_s32(tb[TCA_CAKE_OVERHEAD]));
rate_flags |= CAKE_FLAG_OVERHEAD;
@ -521,7 +522,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
}
if (tb[TCA_CAKE_MPU])
@@ -2704,7 +2711,7 @@ static int cake_change(struct Qdisc *sch
@@ -2710,7 +2717,7 @@ static int cake_change(struct Qdisc *sch
WRITE_ONCE(q->rate_flags, rate_flags);
WRITE_ONCE(q->flow_mode, flow_mode);
@ -530,7 +531,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
sch_tree_lock(sch);
cake_reconfigure(sch);
sch_tree_unlock(sch);
@@ -2720,14 +2727,20 @@ static void cake_destroy(struct Qdisc *s
@@ -2726,14 +2733,20 @@ static void cake_destroy(struct Qdisc *s
qdisc_watchdog_cancel(&q->watchdog);
tcf_block_put(q->block);
kvfree(q->tins);
@ -552,7 +553,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
sch->limit = 10240;
q->tin_mode = CAKE_DIFFSERV_DIFFSERV3;
q->flow_mode = CAKE_FLOW_TRIPLE;
@@ -2739,33 +2752,36 @@ static int cake_init(struct Qdisc *sch,
@@ -2745,33 +2758,36 @@ static int cake_init(struct Qdisc *sch,
* for 5 to 10% of interval
*/
q->rate_flags |= CAKE_FLAG_SPLIT_GSO;
@ -600,7 +601,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
INIT_LIST_HEAD(&b->new_flows);
INIT_LIST_HEAD(&b->old_flows);
@@ -2781,22 +2797,27 @@ static int cake_init(struct Qdisc *sch,
@@ -2787,22 +2803,27 @@ static int cake_init(struct Qdisc *sch,
INIT_LIST_HEAD(&flow->flowchain);
cobalt_vars_init(&flow->cvars);

View File

@ -15,43 +15,9 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Note that this patch replaces the commit above as neither phylink.h nor
phylink-internal.h exist in Linux 6.12.
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -542,8 +542,8 @@ static void mmd_phy_indirect(struct mii_
devad | MII_MMD_CTRL_NOINCR);
}
-static int mmd_phy_read(struct mii_bus *bus, int phy_addr, bool is_c45,
- int devad, u32 regnum)
+int mmd_phy_read(struct mii_bus *bus, int phy_addr, bool is_c45,
+ int devad, u32 regnum)
{
if (is_c45)
return __mdiobus_c45_read(bus, phy_addr, devad, regnum);
@@ -552,9 +552,10 @@ static int mmd_phy_read(struct mii_bus *
/* Read the content of the MMD's selected register */
return __mdiobus_read(bus, phy_addr, MII_MMD_DATA);
}
+EXPORT_SYMBOL_GPL(mmd_phy_read);
-static int mmd_phy_write(struct mii_bus *bus, int phy_addr, bool is_c45,
- int devad, u32 regnum, u16 val)
+int mmd_phy_write(struct mii_bus *bus, int phy_addr, bool is_c45,
+ int devad, u32 regnum, u16 val)
{
if (is_c45)
return __mdiobus_c45_write(bus, phy_addr, devad, regnum, val);
@@ -563,6 +564,7 @@ static int mmd_phy_write(struct mii_bus
/* Write the data into MMD's selected register */
return __mdiobus_write(bus, phy_addr, MII_MMD_DATA, val);
}
+EXPORT_SYMBOL_GPL(mmd_phy_write);
/**
* __phy_read_mmd - Convenience function for reading a register
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -2032,6 +2032,11 @@ extern struct phy_driver genphy_c45_driv
@@ -2022,6 +2022,11 @@ int genphy_c45_an_config_eee_aneg(struct
/* The gen10g_* functions are the old Clause 45 stub */
int gen10g_config_aneg(struct phy_device *phydev);

View File

@ -57,7 +57,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
static umode_t gpy_hwmon_is_visible(const void *data,
enum hwmon_sensor_types type,
u32 attr, int channel)
@@ -217,14 +242,25 @@ static const struct hwmon_ops gpy_hwmon_
@@ -217,19 +242,35 @@ static const struct hwmon_ops gpy_hwmon_
.read = gpy_hwmon_read,
};
@ -81,11 +81,6 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
struct device *dev = &phydev->mdio.dev;
+ const struct hwmon_chip_info *info;
struct device *hwmon_dev;
char *hwmon_name;
@@ -232,10 +268,15 @@ static int gpy_hwmon_register(struct phy
if (IS_ERR(hwmon_name))
return PTR_ERR(hwmon_name);
+ if (phy_id_compare_model(phydev->phy_id, PHY_ID_MXL86252) ||
+ phy_id_compare_model(phydev->phy_id, PHY_ID_MXL86282))
@ -93,15 +88,14 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+ else
+ info = &gpy_hwmon_chip_info;
+
hwmon_dev = devm_hwmon_device_register_with_info(dev, hwmon_name,
phydev,
hwmon_dev = devm_hwmon_device_register_with_info(dev, NULL, phydev,
- &gpy_hwmon_chip_info,
- NULL);
+ info, NULL);
return PTR_ERR_OR_ZERO(hwmon_dev);
}
@@ -1331,6 +1372,50 @@ static struct phy_driver gpy_drivers[] =
@@ -1328,6 +1369,50 @@ static struct phy_driver gpy_drivers[] =
.led_hw_control_set = gpy_led_hw_control_set,
.led_polarity_set = gpy_led_polarity_set,
},
@ -152,7 +146,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
};
module_phy_driver(gpy_drivers);
@@ -1348,6 +1433,8 @@ static const struct mdio_device_id __may
@@ -1345,6 +1430,8 @@ static const struct mdio_device_id __may
{PHY_ID_MATCH_MODEL(PHY_ID_GPY241BM)},
{PHY_ID_MATCH_MODEL(PHY_ID_GPY245B)},
{PHY_ID_MATCH_MODEL(PHY_ID_MXL86211C)},