|
@@ -343,6 +343,9 @@ struct net_device {
|
343
|
343
|
/** Network device interrupts are enabled */
|
344
|
344
|
#define NETDEV_IRQ_ENABLED 0x0002
|
345
|
345
|
|
|
346
|
+/** Network device receive queue processing is frozen */
|
|
347
|
+#define NETDEV_RX_FROZEN 0x0004
|
|
348
|
+
|
346
|
349
|
/** Link-layer protocol table */
|
347
|
350
|
#define LL_PROTOCOLS __table ( struct ll_protocol, "ll_protocols" )
|
348
|
351
|
|
|
@@ -505,7 +508,7 @@ netdev_link_ok ( struct net_device *netdev ) {
|
505
|
508
|
* Check whether or not network device is open
|
506
|
509
|
*
|
507
|
510
|
* @v netdev Network device
|
508
|
|
- * @v is_open Network device is open
|
|
511
|
+ * @ret is_open Network device is open
|
509
|
512
|
*/
|
510
|
513
|
static inline __attribute__ (( always_inline )) int
|
511
|
514
|
netdev_is_open ( struct net_device *netdev ) {
|
|
@@ -516,13 +519,24 @@ netdev_is_open ( struct net_device *netdev ) {
|
516
|
519
|
* Check whether or not network device interrupts are currently enabled
|
517
|
520
|
*
|
518
|
521
|
* @v netdev Network device
|
519
|
|
- * @v irq_enabled Network device interrupts are enabled
|
|
522
|
+ * @ret irq_enabled Network device interrupts are enabled
|
520
|
523
|
*/
|
521
|
524
|
static inline __attribute__ (( always_inline )) int
|
522
|
525
|
netdev_irq_enabled ( struct net_device *netdev ) {
|
523
|
526
|
return ( netdev->state & NETDEV_IRQ_ENABLED );
|
524
|
527
|
}
|
525
|
528
|
|
|
529
|
+/**
|
|
530
|
+ * Check whether or not network device receive queue processing is frozen
|
|
531
|
+ *
|
|
532
|
+ * @v netdev Network device
|
|
533
|
+ * @ret rx_frozen Network device receive queue processing is frozen
|
|
534
|
+ */
|
|
535
|
+static inline __attribute__ (( always_inline )) int
|
|
536
|
+netdev_rx_frozen ( struct net_device *netdev ) {
|
|
537
|
+ return ( netdev->state & NETDEV_RX_FROZEN );
|
|
538
|
+}
|
|
539
|
+
|
526
|
540
|
extern void netdev_link_err ( struct net_device *netdev, int rc );
|
527
|
541
|
extern void netdev_link_down ( struct net_device *netdev );
|
528
|
542
|
extern int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf );
|
|
@@ -550,6 +564,7 @@ extern int net_tx ( struct io_buffer *iobuf, struct net_device *netdev,
|
550
|
564
|
extern int net_rx ( struct io_buffer *iobuf, struct net_device *netdev,
|
551
|
565
|
uint16_t net_proto, const void *ll_dest,
|
552
|
566
|
const void *ll_source );
|
|
567
|
+extern void net_poll ( void );
|
553
|
568
|
|
554
|
569
|
/**
|
555
|
570
|
* Complete network transmission
|
|
@@ -585,4 +600,24 @@ netdev_link_up ( struct net_device *netdev ) {
|
585
|
600
|
netdev_link_err ( netdev, 0 );
|
586
|
601
|
}
|
587
|
602
|
|
|
603
|
+/**
|
|
604
|
+ * Freeze network device receive queue processing
|
|
605
|
+ *
|
|
606
|
+ * @v netdev Network device
|
|
607
|
+ */
|
|
608
|
+static inline __attribute__ (( always_inline )) void
|
|
609
|
+netdev_rx_freeze ( struct net_device *netdev ) {
|
|
610
|
+ netdev->state |= NETDEV_RX_FROZEN;
|
|
611
|
+}
|
|
612
|
+
|
|
613
|
+/**
|
|
614
|
+ * Unfreeze network device receive queue processing
|
|
615
|
+ *
|
|
616
|
+ * @v netdev Network device
|
|
617
|
+ */
|
|
618
|
+static inline __attribute__ (( always_inline )) void
|
|
619
|
+netdev_rx_unfreeze ( struct net_device *netdev ) {
|
|
620
|
+ netdev->state &= ~NETDEV_RX_FROZEN;
|
|
621
|
+}
|
|
622
|
+
|
588
|
623
|
#endif /* _IPXE_NETDEVICE_H */
|