|
@@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
32
|
32
|
#include <ipxe/netdevice.h>
|
33
|
33
|
#include <ipxe/ethernet.h>
|
34
|
34
|
#include <ipxe/if_ether.h>
|
|
35
|
+#include <ipxe/vlan.h>
|
35
|
36
|
#include <ipxe/iobuf.h>
|
36
|
37
|
#include <ipxe/malloc.h>
|
37
|
38
|
#include <ipxe/pci.h>
|
|
@@ -1254,6 +1255,7 @@ static void intelxl_poll_rx ( struct net_device *netdev ) {
|
1254
|
1255
|
struct intelxl_rx_writeback_descriptor *rx_wb;
|
1255
|
1256
|
struct io_buffer *iobuf;
|
1256
|
1257
|
unsigned int rx_idx;
|
|
1258
|
+ unsigned int tag;
|
1257
|
1259
|
size_t len;
|
1258
|
1260
|
|
1259
|
1261
|
/* Check for received packets */
|
|
@@ -1273,16 +1275,23 @@ static void intelxl_poll_rx ( struct net_device *netdev ) {
|
1273
|
1275
|
len = INTELXL_RX_WB_LEN ( le32_to_cpu ( rx_wb->len ) );
|
1274
|
1276
|
iob_put ( iobuf, len );
|
1275
|
1277
|
|
|
1278
|
+ /* Find VLAN device, if applicable */
|
|
1279
|
+ if ( rx_wb->flags & cpu_to_le32 ( INTELXL_RX_WB_FL_VLAN ) ) {
|
|
1280
|
+ tag = VLAN_TAG ( le16_to_cpu ( rx_wb->vlan ) );
|
|
1281
|
+ } else {
|
|
1282
|
+ tag = 0;
|
|
1283
|
+ }
|
|
1284
|
+
|
1276
|
1285
|
/* Hand off to network stack */
|
1277
|
1286
|
if ( rx_wb->flags & cpu_to_le32 ( INTELXL_RX_WB_FL_RXE ) ) {
|
1278
|
1287
|
DBGC ( intelxl, "INTELXL %p RX %d error (length %zd, "
|
1279
|
1288
|
"flags %08x)\n", intelxl, rx_idx, len,
|
1280
|
1289
|
le32_to_cpu ( rx_wb->flags ) );
|
1281
|
|
- netdev_rx_err ( netdev, iobuf, -EIO );
|
|
1290
|
+ vlan_netdev_rx_err ( netdev, tag, iobuf, -EIO );
|
1282
|
1291
|
} else {
|
1283
|
1292
|
DBGC2 ( intelxl, "INTELXL %p RX %d complete (length "
|
1284
|
1293
|
"%zd)\n", intelxl, rx_idx, len );
|
1285
|
|
- netdev_rx ( netdev, iobuf );
|
|
1294
|
+ vlan_netdev_rx ( netdev, tag, iobuf );
|
1286
|
1295
|
}
|
1287
|
1296
|
intelxl->rx.cons++;
|
1288
|
1297
|
}
|