Skip to content

Commit 29a097b

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: remove the struct packet_type argument from dsa_device_ops::rcv()
No tagging driver uses this. Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 35d7a6f commit 29a097b

File tree

17 files changed

+25
-49
lines changed

17 files changed

+25
-49
lines changed

include/net/dsa.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@ enum dsa_tag_protocol {
7979
DSA_TAG_PROTO_SJA1110 = DSA_TAG_PROTO_SJA1110_VALUE,
8080
};
8181

82-
struct packet_type;
8382
struct dsa_switch;
8483

8584
struct dsa_device_ops {
8685
struct sk_buff *(*xmit)(struct sk_buff *skb, struct net_device *dev);
87-
struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev,
88-
struct packet_type *pt);
86+
struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev);
8987
void (*flow_dissect)(const struct sk_buff *skb, __be16 *proto,
9088
int *offset);
9189
unsigned int needed_headroom;
@@ -239,8 +237,7 @@ struct dsa_port {
239237

240238
/* Copies for faster access in master receive hot path */
241239
struct dsa_switch_tree *dst;
242-
struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev,
243-
struct packet_type *pt);
240+
struct sk_buff *(*rcv)(struct sk_buff *skb, struct net_device *dev);
244241

245242
enum {
246243
DSA_PORT_TYPE_UNUSED = 0,

net/dsa/dsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
238238
if (!skb)
239239
return 0;
240240

241-
nskb = cpu_dp->rcv(skb, dev, pt);
241+
nskb = cpu_dp->rcv(skb, dev);
242242
if (!nskb) {
243243
kfree_skb(skb);
244244
return 0;

net/dsa/tag_ar9331.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ static struct sk_buff *ar9331_tag_xmit(struct sk_buff *skb,
4444
}
4545

4646
static struct sk_buff *ar9331_tag_rcv(struct sk_buff *skb,
47-
struct net_device *ndev,
48-
struct packet_type *pt)
47+
struct net_device *ndev)
4948
{
5049
u8 ver, port;
5150
u16 hdr;

net/dsa/tag_brcm.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ static struct sk_buff *brcm_tag_xmit_ll(struct sk_buff *skb,
136136
*/
137137
static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb,
138138
struct net_device *dev,
139-
struct packet_type *pt,
140139
unsigned int offset)
141140
{
142141
int source_port;
@@ -182,13 +181,12 @@ static struct sk_buff *brcm_tag_xmit(struct sk_buff *skb,
182181
}
183182

184183

185-
static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
186-
struct packet_type *pt)
184+
static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev)
187185
{
188186
struct sk_buff *nskb;
189187

190188
/* skb->data points to the EtherType, the tag is right before it */
191-
nskb = brcm_tag_rcv_ll(skb, dev, pt, 2);
189+
nskb = brcm_tag_rcv_ll(skb, dev, 2);
192190
if (!nskb)
193191
return nskb;
194192

@@ -251,8 +249,7 @@ static struct sk_buff *brcm_leg_tag_xmit(struct sk_buff *skb,
251249
}
252250

253251
static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,
254-
struct net_device *dev,
255-
struct packet_type *pt)
252+
struct net_device *dev)
256253
{
257254
int source_port;
258255
u8 *brcm_tag;
@@ -302,11 +299,10 @@ static struct sk_buff *brcm_tag_xmit_prepend(struct sk_buff *skb,
302299
}
303300

304301
static struct sk_buff *brcm_tag_rcv_prepend(struct sk_buff *skb,
305-
struct net_device *dev,
306-
struct packet_type *pt)
302+
struct net_device *dev)
307303
{
308304
/* tag is prepended to the packet */
309-
return brcm_tag_rcv_ll(skb, dev, pt, ETH_HLEN);
305+
return brcm_tag_rcv_ll(skb, dev, ETH_HLEN);
310306
}
311307

312308
static const struct dsa_device_ops brcm_prepend_netdev_ops = {

net/dsa/tag_dsa.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ static struct sk_buff *dsa_xmit(struct sk_buff *skb, struct net_device *dev)
332332
return dsa_xmit_ll(skb, dev, 0);
333333
}
334334

335-
static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev,
336-
struct packet_type *pt)
335+
static struct sk_buff *dsa_rcv(struct sk_buff *skb, struct net_device *dev)
337336
{
338337
if (unlikely(!pskb_may_pull(skb, DSA_HLEN)))
339338
return NULL;
@@ -373,8 +372,7 @@ static struct sk_buff *edsa_xmit(struct sk_buff *skb, struct net_device *dev)
373372
return skb;
374373
}
375374

376-
static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev,
377-
struct packet_type *pt)
375+
static struct sk_buff *edsa_rcv(struct sk_buff *skb, struct net_device *dev)
378376
{
379377
if (unlikely(!pskb_may_pull(skb, EDSA_HLEN)))
380378
return NULL;

net/dsa/tag_gswip.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ static struct sk_buff *gswip_tag_xmit(struct sk_buff *skb,
7575
}
7676

7777
static struct sk_buff *gswip_tag_rcv(struct sk_buff *skb,
78-
struct net_device *dev,
79-
struct packet_type *pt)
78+
struct net_device *dev)
8079
{
8180
int port;
8281
u8 *gswip_tag;

net/dsa/tag_hellcreek.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ static struct sk_buff *hellcreek_xmit(struct sk_buff *skb,
2929
}
3030

3131
static struct sk_buff *hellcreek_rcv(struct sk_buff *skb,
32-
struct net_device *dev,
33-
struct packet_type *pt)
32+
struct net_device *dev)
3433
{
3534
/* Tag decoding */
3635
u8 *tag = skb_tail_pointer(skb) - HELLCREEK_TAG_LEN;

net/dsa/tag_ksz.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ static struct sk_buff *ksz8795_xmit(struct sk_buff *skb, struct net_device *dev)
6767
return skb;
6868
}
6969

70-
static struct sk_buff *ksz8795_rcv(struct sk_buff *skb, struct net_device *dev,
71-
struct packet_type *pt)
70+
static struct sk_buff *ksz8795_rcv(struct sk_buff *skb, struct net_device *dev)
7271
{
7372
u8 *tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;
7473

@@ -134,8 +133,7 @@ static struct sk_buff *ksz9477_xmit(struct sk_buff *skb,
134133
return skb;
135134
}
136135

137-
static struct sk_buff *ksz9477_rcv(struct sk_buff *skb, struct net_device *dev,
138-
struct packet_type *pt)
136+
static struct sk_buff *ksz9477_rcv(struct sk_buff *skb, struct net_device *dev)
139137
{
140138
/* Tag decoding */
141139
u8 *tag = skb_tail_pointer(skb) - KSZ_EGRESS_TAG_LEN;

net/dsa/tag_lan9303.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ static struct sk_buff *lan9303_xmit(struct sk_buff *skb, struct net_device *dev)
7474
return skb;
7575
}
7676

77-
static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
78-
struct packet_type *pt)
77+
static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev)
7978
{
8079
__be16 *lan9303_tag;
8180
u16 lan9303_tag1;

net/dsa/tag_mtk.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
6161
return skb;
6262
}
6363

64-
static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
65-
struct packet_type *pt)
64+
static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev)
6665
{
6766
u16 hdr;
6867
int port;

0 commit comments

Comments
 (0)