Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ndo_change_carrier [2018/08/04 12:17] – [net/sched/sch_generic.c] rpjdayndo_change_carrier [2018/08/04 17:31] (current) – [Overview] rpjday
Line 1: Line 1:
 ===== Overview ===== ===== Overview =====
  
-Setting/detecting carrier, and the subsequent implications of setting ''net_device_ops'' ''ndo_change_carrier'' field.+Setting/detecting carrier, and the subsequent implications of setting ''net_device_ops'' ''ndo_change_carrier'' field (if any implications actually exist):
  
 ===== Normal behaviour ===== ===== Normal behaviour =====
  
-==== include/linux/netdevice.h ====+==== Net device state ==== 
 + 
 +From ''include/linux/netdevice.h'':
  
 Net device state: Net device state:
Line 28: Line 30:
 </code> </code>
  
-Check if carrier is present on device:+==== Checking for state of carrier ==== 
 + 
 +Again from ''netdevice.h'':
  
 <code> <code>
Line 46: Line 50:
 </code> </code>
  
-==== net/sched/sch_generic.c ====+==== Test for interface running ==== 
 + 
 +Still in ''netdevice.h'': 
 + 
 +<code> 
 +/** 
 + * netif_running - test if up 
 + * @dev: network device 
 + * 
 + * Test if the device has been brought up. 
 + */ 
 +static inline bool netif_running(const struct net_device *dev) 
 +
 + return test_bit(__LINK_STATE_START, &dev->state); 
 +
 +</code> 
 +==== Test if carrier on or off ==== 
 + 
 +From ''net/sched/sch_generic.c'':
  
 <code> <code>
  • ndo_change_carrier.1533385059.txt.gz
  • Last modified: 2018/08/04 12:17
  • by rpjday