| 1 |
// SPDX-License-Identifier: GPL-2.0+ |
| 2 |
/* |
| 3 |
* net/dsa/tag_ksz.c - Microchip KSZ Switch tag format handling |
| 4 |
* Copyright (c) 2017 Microchip Technology |
| 5 |
*/ |
| 6 |
|
| 7 |
#include <linux/dsa/ksz_common.h> |
| 8 |
#include <linux/etherdevice.h> |
| 9 |
#include <linux/list.h> |
| 10 |
#include <linux/ptp_classify.h> |
| 11 |
#include <net/dsa.h> |
| 12 |
|
| 13 |
#include "tag.h" |
| 14 |
|
| 15 |
#define KSZ8795_NAME "ksz8795" |
| 16 |
#define KSZ9477_NAME "ksz9477" |
| 17 |
#define KSZ9893_NAME "ksz9893" |
| 18 |
#define LAN937X_NAME "lan937x" |
| 19 |
|
| 20 |
/* Typically only one byte is used for tail tag. */ |
| 21 |
#define KSZ_PTP_TAG_LEN 4 |
| 22 |
#define KSZ_EGRESS_TAG_LEN 1 |
| 23 |
#define KSZ_INGRESS_TAG_LEN 1 |
| 24 |
|
| 25 |
#define KSZ_HWTS_EN 0 |
| 26 |
|
| 27 |
struct ksz_tagger_private { |
| 28 |
struct ksz_tagger_data data; /* Must be first */ |
| 29 |
unsigned long state; |
| 30 |
struct kthread_worker *xmit_worker; |
| 31 |
}; |
| 32 |
|
| 33 |
static struct ksz_tagger_private * |
| 34 |
ksz_tagger_private(struct dsa_switch *ds) |
| 35 |
{ |
| 36 |
return ds->tagger_data; |
| 37 |
} |
| 38 |
|
| 39 |
static void ksz_hwtstamp_set_state(struct dsa_switch *ds, bool on) |
| 40 |
{ |
| 41 |
struct ksz_tagger_private *priv = ksz_tagger_private(ds); |
| 42 |
|
| 43 |
if (on) |
| 44 |
set_bit(KSZ_HWTS_EN, &priv->state); |
| 45 |
else |
| 46 |
clear_bit(KSZ_HWTS_EN, &priv->state); |
| 47 |
} |
| 48 |
|
| 49 |
static void ksz_disconnect(struct dsa_switch *ds) |
| 50 |
{ |
| 51 |
struct ksz_tagger_private *priv = ds->tagger_data; |
| 52 |
|
| 53 |
kthread_destroy_worker(priv->xmit_worker); |
| 54 |
kfree(priv); |
| 55 |
ds->tagger_data = NULL; |
| 56 |
} |
| 57 |
|
| 58 |
static int ksz_connect(struct dsa_switch *ds) |
| 59 |
{ |
| 60 |
struct ksz_tagger_data *tagger_data; |
| 61 |
struct kthread_worker *xmit_worker; |
| 62 |
struct ksz_tagger_private *priv; |
| 63 |
int ret; |
| 64 |
|
| 65 |
priv = kzalloc_obj(*priv); |
| 66 |
if (!priv) |
| 67 |
return -ENOMEM; |
| 68 |
|
| 69 |
xmit_worker = kthread_run_worker(0, "dsa%d:%d_xmit", |
| 70 |
ds->dst->index, ds->index); |
| 71 |
if (IS_ERR(xmit_worker)) { |
| 72 |
ret = PTR_ERR(xmit_worker); |
| 73 |
kfree(priv); |
| 74 |
return ret; |
| 75 |
} |
| 76 |
|
| 77 |
priv->xmit_worker = xmit_worker; |
| 78 |
/* Export functions for switch driver use */ |
| 79 |
tagger_data = &priv->data; |
| 80 |
tagger_data->hwtstamp_set_state = ksz_hwtstamp_set_state; |
| 81 |
ds->tagger_data = priv; |
| 82 |
|
| 83 |
return 0; |
| 84 |
} |
| 85 |
|
| 86 |
static struct sk_buff *ksz_common_rcv(struct sk_buff *skb, |
| 87 |
struct net_device *dev, |
| 88 |
unsigned int port, unsigned int len) |
| 89 |
{ |
| 90 |
skb->dev = dsa_conduit_find_user(dev, 0, port); |
| 91 |
if (!skb->dev) |
| 92 |
return NULL; |
| 93 |
|
| 94 |
if (pskb_trim_rcsum(skb, skb->len - len)) |
| 95 |
return NULL; |
| 96 |
|
| 97 |
dsa_default_offload_fwd_mark(skb); |
| 98 |
|
| 99 |
return skb; |
| 100 |
} |
| 101 |
|
| 102 |
/* |
| 103 |
* For Ingress (Host -> KSZ8795), 1 byte is added before FCS. |
| 104 |
* --------------------------------------------------------------------------- |
| 105 |
* DA(6bytes)|SA(6bytes)|....|Data(nbytes)|tag(1byte)|FCS(4bytes) |
| 106 |
* --------------------------------------------------------------------------- |
| 107 |
* tag : each bit represents port (eg, 0x01=port1, 0x02=port2, 0x10=port5) |
| 108 |
* |
| 109 |
* For Egress (KSZ8795 -> Host), 1 byte is added before FCS. |
| 110 |
* --------------------------------------------------------------------------- |
| 111 |
* DA(6bytes)|SA(6bytes)|....|Data(nbytes)|tag0(1byte)|FCS(4bytes) |
| 112 |
* --------------------------------------------------------------------------- |
| 113 |
* tag0 : zero-based value represents port |
| 114 |
* (eg, 0x0=port1, 0x2=port3, 0x3=port4) |
| 115 |
*/ |
| 116 |
|
| 117 |
#define KSZ8795_TAIL_TAG_EG_PORT_M GENMASK(1, 0) |
| 118 |
#define KSZ8795_TAIL_TAG_OVERRIDE BIT(6) |
| 119 |
#define KSZ8795_TAIL_TAG_LOOKUP BIT(7) |
| 120 |
|
| 121 |
static struct sk_buff *ksz8795_xmit(struct sk_buff *skb, struct net_device *dev) |
| 122 |
{ |
| 123 |
struct ethhdr *hdr; |
| 124 |
u8 *tag; |
| 125 |
|
| 126 |
if (skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_help(skb)) |
| 127 |
return NULL; |
| 128 |
|
| 129 |
/* Tag encoding */ |
| 130 |
tag = skb_put(skb, KSZ_INGRESS_TAG_LEN); |
| 131 |
hdr = skb_eth_hdr(skb); |
| 132 |
|
| 133 |
*tag = dsa_xmit_port_mask(skb, dev); |
| 134 |
if (is_link_local_ether_addr(hdr->h_dest)) |
| 135 |
*tag |= KSZ8795_TAIL_TAG_OVERRIDE; |
| 136 |
|
| 137 |
return skb; |
| 138 |
} |
| 139 |
|
| 140 |
static struct sk_buff *ksz8795_rcv(struct sk_buff *skb, struct net_device *dev) |
| 141 |
{ |
| 142 |
u8 *tag; |
| 143 |
|
| 144 |
if (skb_linearize(skb)) |
| 145 |
return NULL; |
| 146 |
|
| 147 |
tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN; |
| 148 |
|
| 149 |
return ksz_common_rcv(skb, dev, tag[0] & KSZ8795_TAIL_TAG_EG_PORT_M, |
| 150 |
KSZ_EGRESS_TAG_LEN); |
| 151 |
} |
| 152 |
|
| 153 |
static const struct dsa_device_ops ksz8795_netdev_ops = { |
| 154 |
.name = KSZ8795_NAME, |
| 155 |
.proto = DSA_TAG_PROTO_KSZ8795, |
| 156 |
.xmit = ksz8795_xmit, |
| 157 |
.rcv = ksz8795_rcv, |
| 158 |
.needed_tailroom = KSZ_INGRESS_TAG_LEN, |
| 159 |
}; |
| 160 |
|
| 161 |
DSA_TAG_DRIVER(ksz8795_netdev_ops); |
| 162 |
MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_KSZ8795, KSZ8795_NAME); |
| 163 |
|
| 164 |
/* |
| 165 |
* For Ingress (Host -> KSZ9477), 2/6 bytes are added before FCS. |
| 166 |
* --------------------------------------------------------------------------- |
| 167 |
* DA(6bytes)|SA(6bytes)|....|Data(nbytes)|ts(4bytes)|tag0(1byte)|tag1(1byte)| |
| 168 |
* FCS(4bytes) |
| 169 |
* --------------------------------------------------------------------------- |
| 170 |
* ts : time stamp (Present only if PTP is enabled in the Hardware) |
| 171 |
* tag0 : Prioritization (not used now) |
| 172 |
* tag1 : each bit represents port (eg, 0x01=port1, 0x02=port2, 0x10=port5) |
| 173 |
* |
| 174 |
* For Egress (KSZ9477 -> Host), 1/5 bytes is added before FCS. |
| 175 |
* --------------------------------------------------------------------------- |
| 176 |
* DA(6bytes)|SA(6bytes)|....|Data(nbytes)|ts(4bytes)|tag0(1byte)|FCS(4bytes) |
| 177 |
* --------------------------------------------------------------------------- |
| 178 |
* ts : time stamp (Present only if bit 7 of tag0 is set) |
| 179 |
* tag0 : zero-based value represents port |
| 180 |
* (eg, 0x00=port1, 0x02=port3, 0x06=port7) |
| 181 |
*/ |
| 182 |
|
| 183 |
#define KSZ9477_INGRESS_TAG_LEN 2 |
| 184 |
#define KSZ9477_PTP_TAG_LEN 4 |
| 185 |
#define KSZ9477_PTP_TAG_INDICATION BIT(7) |
| 186 |
|
| 187 |
#define KSZ9477_TAIL_TAG_EG_PORT_M GENMASK(2, 0) |
| 188 |
#define KSZ9477_TAIL_TAG_PRIO GENMASK(8, 7) |
| 189 |
#define KSZ9477_TAIL_TAG_OVERRIDE BIT(9) |
| 190 |
#define KSZ9477_TAIL_TAG_LOOKUP BIT(10) |
| 191 |
|
| 192 |
static void ksz_rcv_timestamp(struct sk_buff *skb, u8 *tag) |
| 193 |
{ |
| 194 |
u8 *tstamp_raw = tag - KSZ_PTP_TAG_LEN; |
| 195 |
ktime_t tstamp; |
| 196 |
|
| 197 |
tstamp = ksz_decode_tstamp(get_unaligned_be32(tstamp_raw)); |
| 198 |
KSZ_SKB_CB(skb)->tstamp = tstamp; |
| 199 |
} |
| 200 |
|
| 201 |
/* Time stamp tag *needs* to be inserted if PTP is enabled in hardware. |
| 202 |
* Regardless of Whether it is a PTP frame or not. |
| 203 |
*/ |
| 204 |
static void ksz_xmit_timestamp(struct dsa_port *dp, struct sk_buff *skb) |
| 205 |
{ |
| 206 |
struct ksz_tagger_private *priv; |
| 207 |
struct ptp_header *ptp_hdr; |
| 208 |
unsigned int ptp_type; |
| 209 |
u32 tstamp_raw = 0; |
| 210 |
s64 correction; |
| 211 |
|
| 212 |
priv = ksz_tagger_private(dp->ds); |
| 213 |
|
| 214 |
if (!test_bit(KSZ_HWTS_EN, &priv->state)) |
| 215 |
return; |
| 216 |
|
| 217 |
if (!KSZ_SKB_CB(skb)->update_correction) |
| 218 |
goto output_tag; |
| 219 |
|
| 220 |
ptp_type = KSZ_SKB_CB(skb)->ptp_type; |
| 221 |
|
| 222 |
ptp_hdr = ptp_parse_header(skb, ptp_type); |
| 223 |
if (!ptp_hdr) |
| 224 |
goto output_tag; |
| 225 |
|
| 226 |
correction = (s64)get_unaligned_be64(&ptp_hdr->correction); |
| 227 |
|
| 228 |
if (correction < 0) { |
| 229 |
struct timespec64 ts; |
| 230 |
|
| 231 |
ts = ns_to_timespec64(-correction >> 16); |
| 232 |
tstamp_raw = ((ts.tv_sec & 3) << 30) | ts.tv_nsec; |
| 233 |
|
| 234 |
/* Set correction field to 0 and update UDP checksum */ |
| 235 |
ptp_header_update_correction(skb, ptp_type, ptp_hdr, 0); |
| 236 |
} |
| 237 |
|
| 238 |
output_tag: |
| 239 |
put_unaligned_be32(tstamp_raw, skb_put(skb, KSZ_PTP_TAG_LEN)); |
| 240 |
} |
| 241 |
|
| 242 |
/* Defer transmit if waiting for egress time stamp is required. */ |
| 243 |
static struct sk_buff *ksz_defer_xmit(struct dsa_port *dp, struct sk_buff *skb) |
| 244 |
{ |
| 245 |
struct ksz_tagger_data *tagger_data = ksz_tagger_data(dp->ds); |
| 246 |
struct ksz_tagger_private *priv = ksz_tagger_private(dp->ds); |
| 247 |
void (*xmit_work_fn)(struct kthread_work *work); |
| 248 |
struct sk_buff *clone = KSZ_SKB_CB(skb)->clone; |
| 249 |
struct ksz_deferred_xmit_work *xmit_work; |
| 250 |
struct kthread_worker *xmit_worker; |
| 251 |
|
| 252 |
if (!clone) |
| 253 |
return skb; /* no deferred xmit for this packet */ |
| 254 |
|
| 255 |
xmit_work_fn = tagger_data->xmit_work_fn; |
| 256 |
xmit_worker = priv->xmit_worker; |
| 257 |
|
| 258 |
if (!xmit_work_fn || !xmit_worker) |
| 259 |
return NULL; |
| 260 |
|
| 261 |
xmit_work = kzalloc_obj(*xmit_work, GFP_ATOMIC); |
| 262 |
if (!xmit_work) |
| 263 |
return NULL; |
| 264 |
|
| 265 |
kthread_init_work(&xmit_work->work, xmit_work_fn); |
| 266 |
/* Increase refcount so the kfree_skb in dsa_user_xmit |
| 267 |
* won't really free the packet. |
| 268 |
*/ |
| 269 |
xmit_work->dp = dp; |
| 270 |
xmit_work->skb = skb_get(skb); |
| 271 |
|
| 272 |
kthread_queue_work(xmit_worker, &xmit_work->work); |
| 273 |
|
| 274 |
return NULL; |
| 275 |
} |
| 276 |
|
| 277 |
static struct sk_buff *ksz9477_xmit(struct sk_buff *skb, |
| 278 |
struct net_device *dev) |
| 279 |
{ |
| 280 |
u16 queue_mapping = skb_get_queue_mapping(skb); |
| 281 |
u8 prio = netdev_txq_to_tc(dev, queue_mapping); |
| 282 |
struct dsa_port *dp = dsa_user_to_port(dev); |
| 283 |
struct ethhdr *hdr; |
| 284 |
__be16 *tag; |
| 285 |
u16 val; |
| 286 |
|
| 287 |
if (skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_help(skb)) |
| 288 |
return NULL; |
| 289 |
|
| 290 |
/* Tag encoding */ |
| 291 |
ksz_xmit_timestamp(dp, skb); |
| 292 |
|
| 293 |
tag = skb_put(skb, KSZ9477_INGRESS_TAG_LEN); |
| 294 |
hdr = skb_eth_hdr(skb); |
| 295 |
|
| 296 |
val = dsa_xmit_port_mask(skb, dev); |
| 297 |
val |= FIELD_PREP(KSZ9477_TAIL_TAG_PRIO, prio); |
| 298 |
|
| 299 |
if (is_link_local_ether_addr(hdr->h_dest)) |
| 300 |
val |= KSZ9477_TAIL_TAG_OVERRIDE; |
| 301 |
|
| 302 |
*tag = cpu_to_be16(val); |
| 303 |
|
| 304 |
return ksz_defer_xmit(dp, skb); |
| 305 |
} |
| 306 |
|
| 307 |
static struct sk_buff *ksz9477_rcv(struct sk_buff *skb, struct net_device *dev) |
| 308 |
{ |
| 309 |
unsigned int len = KSZ_EGRESS_TAG_LEN; |
| 310 |
unsigned int port; |
| 311 |
u8 *tag; |
| 312 |
|
| 313 |
if (skb_linearize(skb)) |
| 314 |
return NULL; |
| 315 |
|
| 316 |
/* Tag decoding */ |
| 317 |
tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN; |
| 318 |
port = tag[0] & KSZ9477_TAIL_TAG_EG_PORT_M; |
| 319 |
|
| 320 |
/* Extra 4-bytes PTP timestamp */ |
| 321 |
if (tag[0] & KSZ9477_PTP_TAG_INDICATION) { |
| 322 |
ksz_rcv_timestamp(skb, tag); |
| 323 |
len += KSZ_PTP_TAG_LEN; |
| 324 |
} |
| 325 |
|
| 326 |
return ksz_common_rcv(skb, dev, port, len); |
| 327 |
} |
| 328 |
|
| 329 |
static const struct dsa_device_ops ksz9477_netdev_ops = { |
| 330 |
.name = KSZ9477_NAME, |
| 331 |
.proto = DSA_TAG_PROTO_KSZ9477, |
| 332 |
.xmit = ksz9477_xmit, |
| 333 |
.rcv = ksz9477_rcv, |
| 334 |
.connect = ksz_connect, |
| 335 |
.disconnect = ksz_disconnect, |
| 336 |
.needed_tailroom = KSZ9477_INGRESS_TAG_LEN + KSZ_PTP_TAG_LEN, |
| 337 |
}; |
| 338 |
|
| 339 |
DSA_TAG_DRIVER(ksz9477_netdev_ops); |
| 340 |
MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_KSZ9477, KSZ9477_NAME); |
| 341 |
|
| 342 |
#define KSZ9893_TAIL_TAG_PRIO GENMASK(4, 3) |
| 343 |
#define KSZ9893_TAIL_TAG_OVERRIDE BIT(5) |
| 344 |
#define KSZ9893_TAIL_TAG_LOOKUP BIT(6) |
| 345 |
|
| 346 |
static struct sk_buff *ksz9893_xmit(struct sk_buff *skb, |
| 347 |
struct net_device *dev) |
| 348 |
{ |
| 349 |
u16 queue_mapping = skb_get_queue_mapping(skb); |
| 350 |
u8 prio = netdev_txq_to_tc(dev, queue_mapping); |
| 351 |
struct dsa_port *dp = dsa_user_to_port(dev); |
| 352 |
struct ethhdr *hdr; |
| 353 |
u8 *tag; |
| 354 |
|
| 355 |
if (skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_help(skb)) |
| 356 |
return NULL; |
| 357 |
|
| 358 |
/* Tag encoding */ |
| 359 |
ksz_xmit_timestamp(dp, skb); |
| 360 |
|
| 361 |
tag = skb_put(skb, KSZ_INGRESS_TAG_LEN); |
| 362 |
hdr = skb_eth_hdr(skb); |
| 363 |
|
| 364 |
*tag = dsa_xmit_port_mask(skb, dev); |
| 365 |
*tag |= FIELD_PREP(KSZ9893_TAIL_TAG_PRIO, prio); |
| 366 |
|
| 367 |
if (is_link_local_ether_addr(hdr->h_dest)) |
| 368 |
*tag |= KSZ9893_TAIL_TAG_OVERRIDE; |
| 369 |
|
| 370 |
return ksz_defer_xmit(dp, skb); |
| 371 |
} |
| 372 |
|
| 373 |
static const struct dsa_device_ops ksz9893_netdev_ops = { |
| 374 |
.name = KSZ9893_NAME, |
| 375 |
.proto = DSA_TAG_PROTO_KSZ9893, |
| 376 |
.xmit = ksz9893_xmit, |
| 377 |
.rcv = ksz9477_rcv, |
| 378 |
.connect = ksz_connect, |
| 379 |
.disconnect = ksz_disconnect, |
| 380 |
.needed_tailroom = KSZ_INGRESS_TAG_LEN + KSZ_PTP_TAG_LEN, |
| 381 |
}; |
| 382 |
|
| 383 |
DSA_TAG_DRIVER(ksz9893_netdev_ops); |
| 384 |
MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_KSZ9893, KSZ9893_NAME); |
| 385 |
|
| 386 |
/* For xmit, 2/6 bytes are added before FCS. |
| 387 |
* --------------------------------------------------------------------------- |
| 388 |
* DA(6bytes)|SA(6bytes)|....|Data(nbytes)|ts(4bytes)|tag0(1byte)|tag1(1byte)| |
| 389 |
* FCS(4bytes) |
| 390 |
* --------------------------------------------------------------------------- |
| 391 |
* ts : time stamp (Present only if PTP is enabled in the Hardware) |
| 392 |
* tag0 : represents tag override, lookup and valid |
| 393 |
* tag1 : each bit represents port (eg, 0x01=port1, 0x02=port2, 0x80=port8) |
| 394 |
* |
| 395 |
* For rcv, 1/5 bytes is added before FCS. |
| 396 |
* --------------------------------------------------------------------------- |
| 397 |
* DA(6bytes)|SA(6bytes)|....|Data(nbytes)|ts(4bytes)|tag0(1byte)|FCS(4bytes) |
| 398 |
* --------------------------------------------------------------------------- |
| 399 |
* ts : time stamp (Present only if bit 7 of tag0 is set) |
| 400 |
* tag0 : zero-based value represents port |
| 401 |
* (eg, 0x00=port1, 0x02=port3, 0x07=port8) |
| 402 |
*/ |
| 403 |
#define LAN937X_EGRESS_TAG_LEN 2 |
| 404 |
|
| 405 |
#define LAN937X_TAIL_TAG_BLOCKING_OVERRIDE BIT(11) |
| 406 |
#define LAN937X_TAIL_TAG_LOOKUP BIT(12) |
| 407 |
#define LAN937X_TAIL_TAG_VALID BIT(13) |
| 408 |
#define LAN937X_TAIL_TAG_PRIO GENMASK(10, 8) |
| 409 |
#define LAN937X_TAIL_TAG_PORT_MASK 7 |
| 410 |
|
| 411 |
static struct sk_buff *lan937x_xmit(struct sk_buff *skb, |
| 412 |
struct net_device *dev) |
| 413 |
{ |
| 414 |
u16 queue_mapping = skb_get_queue_mapping(skb); |
| 415 |
u8 prio = netdev_txq_to_tc(dev, queue_mapping); |
| 416 |
struct dsa_port *dp = dsa_user_to_port(dev); |
| 417 |
const struct ethhdr *hdr = eth_hdr(skb); |
| 418 |
__be16 *tag; |
| 419 |
u16 val; |
| 420 |
|
| 421 |
if (skb->ip_summed == CHECKSUM_PARTIAL && skb_checksum_help(skb)) |
| 422 |
return NULL; |
| 423 |
|
| 424 |
ksz_xmit_timestamp(dp, skb); |
| 425 |
|
| 426 |
tag = skb_put(skb, LAN937X_EGRESS_TAG_LEN); |
| 427 |
|
| 428 |
val = dsa_xmit_port_mask(skb, dev); |
| 429 |
val |= FIELD_PREP(LAN937X_TAIL_TAG_PRIO, prio); |
| 430 |
|
| 431 |
if (is_link_local_ether_addr(hdr->h_dest)) |
| 432 |
val |= LAN937X_TAIL_TAG_BLOCKING_OVERRIDE; |
| 433 |
|
| 434 |
/* Tail tag valid bit - This bit should always be set by the CPU */ |
| 435 |
val |= LAN937X_TAIL_TAG_VALID; |
| 436 |
|
| 437 |
put_unaligned_be16(val, tag); |
| 438 |
|
| 439 |
return ksz_defer_xmit(dp, skb); |
| 440 |
} |
| 441 |
|
| 442 |
static const struct dsa_device_ops lan937x_netdev_ops = { |
| 443 |
.name = LAN937X_NAME, |
| 444 |
.proto = DSA_TAG_PROTO_LAN937X, |
| 445 |
.xmit = lan937x_xmit, |
| 446 |
.rcv = ksz9477_rcv, |
| 447 |
.connect = ksz_connect, |
| 448 |
.disconnect = ksz_disconnect, |
| 449 |
.needed_tailroom = LAN937X_EGRESS_TAG_LEN + KSZ_PTP_TAG_LEN, |
| 450 |
}; |
| 451 |
|
| 452 |
DSA_TAG_DRIVER(lan937x_netdev_ops); |
| 453 |
MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_LAN937X, LAN937X_NAME); |
| 454 |
|
| 455 |
static struct dsa_tag_driver *dsa_tag_driver_array[] = { |
| 456 |
&DSA_TAG_DRIVER_NAME(ksz8795_netdev_ops), |
| 457 |
&DSA_TAG_DRIVER_NAME(ksz9477_netdev_ops), |
| 458 |
&DSA_TAG_DRIVER_NAME(ksz9893_netdev_ops), |
| 459 |
&DSA_TAG_DRIVER_NAME(lan937x_netdev_ops), |
| 460 |
}; |
| 461 |
|
| 462 |
module_dsa_tag_drivers(dsa_tag_driver_array); |
| 463 |
|
| 464 |
MODULE_DESCRIPTION("DSA tag driver for Microchip 8795/937x/9477/9893 families of switches"); |
| 465 |
MODULE_LICENSE("GPL"); |