SlideShare a Scribd company logo
Embedded Linux Network
Device Driver Development
Rights to Copy
 License: Creative Commons Attribution - Share Alike 3.0
 You are free:
 to copy, distribute, display, and perform the work
 to make derivative works
 to make commercial use of the work
 Under the following conditions:
 Attribution – Derived from original work of Free Electrons
 Share Alike
 For any reuse or distribution, you must make clear to others the license terms
of this work.
September 7, 2017
Embedded Linux Network Device Driver
Development
2
References
 www.free-electrons.com
 Essential Linux Device Drivers
 Linux Device Drivers
September 7, 2017
Embedded Linux Network Device Driver
Development
3
Objectives
 Understanding the structure of ethernet and WIFI device drivers
 Developing Linux network device drivers
Embedded Linux Network Device Driver
Development
4 September 7, 2017
Prerequisites
 Solid C programming
 Knowledge of Linux commands is a plus
 Knowledge of networking
 Embedded Linux Kernel and Driver Development training or equivalent
Embedded Linux Network Device Driver
Development
5 September 7, 2017
Notes
 Ask any time.
 Turn your cell silent.
Embedded Linux Network Device Driver
Development
6 September 7, 2017
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
7
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
8
OSI Model and Linux Kernel
September 7, 2017
Embedded Linux Network Device Driver
Development
9
User Space
Kernel Network
Stack
Device Driver
Network Device Model
September 7, 2017
Embedded Linux Network Device Driver
Development
10
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
11
Socket Buffer (sk_buff)
 struct sk_buff (include/linux/sk_buff.h) represents a network packet
 Support data encapsulation/decapsulation through protocol layers
 In addition to data, sk_buff maintains:
 head, the start of the packet
 data, the start of the packet payload
 tail, the end of the packet payload
 end, the end of the packet
 len, the amount of data of the packet
 These fields are updated when the packet goes through the protocol
layers
September 7, 2017
Embedded Linux Network Device Driver
Development
12
SKB Operations
Allocation
 By dev_alloc_skb() function
 Can be done in ISR
 On Ethernet, allocated size = packet
length + 2
 To word align IP header
 IP header = 14 bytes
Reservation
 By skb_reserve() function
 Skipping NET_IP_ALIGN padding
bytes
September 7, 2017
Embedded Linux Network Device Driver
Development
13
SKB Operations cont’d
Data Copying
 From DMA buffer to SKB during
reception for example
 OR SKB to DMA buffer during
transmission (may be)
Pointers Update
 After copying payload
September 7, 2017
Embedded Linux Network Device Driver
Development
14
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
15
Network Device
 struct net_device (include/linux/netdevice.h) represents a network
interface
 Allocation takes place with alloc_netdev() function
 Size of private data is passed as argument
 Pointer to these private data can be read in net_device->priv
 Use alloc_etherdev() for ethernet interfaces
 Use alloc_ieee80211() for WIFI interfaces
September 7, 2017
Embedded Linux Network Device Driver
Development
16
Network Device cont’d
 Registration with register_netdev() function
 Unregistration with unregister_netdev() function
 Liberation with free_netdev() function
September 7, 2017
Embedded Linux Network Device Driver
Development
17
Network Device Operations
 Defined by struct net_device_ops (include/linux/netdevice.h)
 Set the netdev_ops field in the struct net_device structure to point to the
struct net_device_ops structure
September 7, 2017
Embedded Linux Network Device Driver
Development
18
Operation Description
ndo_open() Called when network interface uped
ndo_close() Called when network interface downed
ndo_start_xmit() Start packet transmission
ndo_get_stats() Get statistics
ndo_do_ioctl() Implement device specific operations
ndo_set_rx_mode() Select promiscuous, multicast, etc
ndo_set_mac_address() Set MAC address
ndo_set_multicast_list() Set multicast filters
Network Device Operations cont’d
 Sample operations are:
September 7, 2017
Embedded Linux Network Device Driver
Development
19
Operation Description
ndo_open() Called when network interface uped
ndo_close() Called when network interface downed
ndo_start_xmit() Start packet transmission
ndo_get_stats() Get statistics
ndo_do_ioctl() Implement device specific operations
ndo_set_rx_mode() Select promiscuous, multicast, etc
ndo_set_mac_address() Set MAC address
ndo_set_multicast_list() Set multicast filters
ndo_tx_timeout() Reset unresponsive network interface
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
20
Flow Control Utility Functions
 include/linux/netdevice.h
September 7, 2017
Embedded Linux Network Device Driver
Development
21
Operation Description
netif_start_queue() Tells kernel that driver is ready to send packets
netif_stop_queue() Tells kernel to stop sending packets (@cleanup or congestion)
netif_queue_stopped() Tells whether queue is stopped or not
netif_wake_queue() Wakes up a queue after a netif_stop_queue()
netif_rx() Gives SKB to kernel
Transmission
 Kernel calls ndo_start_xmit() with SKB as argument
 ndo_start_xmit():
1. Sets up DMA buffers and other HW mechanisms
2. Starts transmission
3. Can stop queueing if no more free DMA buffers available using
netif_stop_queue()
4. Returns NETDEV_TX_OK or NETDEV_TX_BUSY
 When N packets have been sent, an interrupt is raised and the driver
should:
1. Acknowledging interrupt
2. Freeing used DMA buffers
3. Freeing SKB with dev_kfree_skb_irq()
4. If the queue was stopped, start it again
September 7, 2017
Embedded Linux Network Device Driver
Development
22
Reception: Non-NAPI
 Reception is via an interrupt that should:
1. Allocate an SKB
2. Reserve NET_IP_ALIGN padding bytes
3. Copy packet from DMA buffers to SKB
4. Update SKB pointers
5. Update the skb->protocol field with eth_type_trans(skb, netdevice)
6. Give SKB to kernel by netif_rx()
 netif_rx() use NET_RX_SOFTIRQ to offload the work of posting received data
packets to protocol layers
 Nice and simple
 @high traffic, interrupt rate is high
 Solution: switch to polled mode when interrupt rate is too high (NAPI)
September 7, 2017
Embedded Linux Network Device Driver
Development
23
Reception: NAPI
 In network interface private structure, add a struct napi_struct
(include/linux/netdevice.h)
 @ driver initialization, register the NAPI poll operation
 dev: network interface
 &lp->napi: struct napi_struct
 r6040_poll: NAPI poll operation
 64: weight that represents the importance of network interface
September 7, 2017
Embedded Linux Network Device Driver
Development
24
Reception: NAPI cont’d
Rx ISR
 Disables Rx interrupt and switch to
polled mode
if (napi_schedule_prep(&lp->napi)) {
/* Disable reception interrupts */
__napi_schedule(&lp->napi);
}
 Kernel calls our poll() operation
regularly
Poll Function
 static int r6040_poll(struct
napi_struct *napi, int budget)
 Receives at most budget packets and
pushes them to the network stack
using netif_receive_skb()
 If less than budget packets have been
received, switch back to interrupt
mode using napi_complete(&lp-
>napi) and reenable interrupts
 Must return the number of packets
received
September 7, 2017
Embedded Linux Network Device Driver
Development
25
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
26
Connection with PHY
 MAC and PHY are connected using a MII or RMII interface
 This interface contains two wires used for the MDIO bus
 Driver needs to communicate with the PHY to get link information (up,
down, speed, full or half duplex) and configure the MAC accordingly
September 7, 2017
Embedded Linux Network Device Driver
Development
27
PHY in Kernel
 Kernel has a framework (drivers/net/phy/) that
 Exposes an API to communicate with PHY
 Allows to implement PHY drivers
 Implements a basic generic PHY driver that works with all PHY
 See Documentation/networking/phy.txt
September 7, 2017
Embedded Linux Network Device Driver
Development
28
MDIO Bus Initialization
 Driver creates a MDIO bus struct mii_bus (include/linux/mii.h) to tells PHY
infrastructure how to communicate with the PHY
 mdio_read() and mdio_write are HW specific and must be implemented
by the driver
September 7, 2017
Embedded Linux Network Device Driver
Development
29
MDIO Bus Initialization cont’d
 The ->irq[] array must be allocated and initialized
 To use polling, set the values to PHY_POLL
Lp->mii_if->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
for (i = 0; i < PHY_MAX_ADDR; i++)
lp->mii_if>irq[i] = PHY_POLL;
 Finally, register the MDIO bus
 This will scan the bus for PHYs and fill the mii_if->phy_map[] array with the
result
mdiobus_register(bp->mii_if);
September 7, 2017
Embedded Linux Network Device Driver
Development
30
Connecting with PHY
 mdiobus_register() function filled the mii_if->phy_map[] array with struct
phy_device * pointers
 Appropriate PHY (usually, only one is detected) must be selected
 Connecting to the PHY allows to register a callback that will be called
when the link changes :
 interface is usually PHY_INTERFACE_MODE_MII or
PHY_INTERFACE_MODE_RMII
September 7, 2017
Embedded Linux Network Device Driver
Development
31
Updating MAC Capabilities
 MAC and PHY might have different capabilities
 PHY handling Gigabit speed, but not MAC
 Driver is responsible for updating phydev->advertise and phydev-
>supported to remove any PHY capability that the MAC doesn't support
September 7, 2017
Embedded Linux Network Device Driver
Development
32
Handling Link Changes
 The callback that handle link changes should have the following prototype:
void foo_handle_link_change(struct net_device *dev)
 It must check the duplex, speed and link fields of the struct phy_device
structure, and update Ethernet controller configuration accordingly
 duplex is either DUPLEX_HALF or DUPLEX_FULL
 speed is either SPEED_10, SPEED_100, SPEED_1000, SPEED_2500 or
SPEED_10000
 link is a Boolean
September 7, 2017
Embedded Linux Network Device Driver
Development
33
Starting and stopping the PHY
 After set up, to make the PHY driver poll regularly the PHY hardware, one
must start it with phy_start() functions
 And stop it using phy_stop(), when no longer needed
September 7, 2017
Embedded Linux Network Device Driver
Development
34
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
35
Buffers Management
 During open(), driver pre-allocates needed DMA descriptos needed for
transmission and reception
 When totally utilized, the driver tells the kernel to stop sending packets to
the driver
 SKB are allocated and freed as per need
September 7, 2017
Embedded Linux Network Device Driver
Development
36
Concurrency
 Access protection needed in the face of multiple execution threads:
 Transmit thread
 Receive thread
 Transmit-complete interrupt
 Receive interrupt
 NAPI polling
September 7, 2017
Embedded Linux Network Device Driver
Development
37
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
38
Network Benchmarking
 Netperf (free from www.netperf.org ) can set up complex TCP/UDP
connection scenarios to control C/C’s such as protocol parameters,
number of simultaneous sessions, and size of data blocks.
 Benchmarking = Comparing resulting throughput with maximum practical
bandwidth
 Factors affecting throughput:
 Driver implementation
 Protocol used
September 7, 2017
Embedded Linux Network Device Driver
Development
39
Driver Performance
 Execution time
 Considering usage of DMA for large packets
 Offloading CPU by moving functionalities to hardware (TCP checksum)
 Taking into consideration upper layers behavior
September 7, 2017
Embedded Linux Network Device Driver
Development
40
Protocol Performance
 TCP window size = data that can be transmitted before receiving ACK
 Fast network interfaces + small window size = TCP sitting idle waiting for ACK
 In UDP, the window size is not relevant as there is no ACK
 Packet loss in TCP and UDP
 Mapping protocol block sizes to MTU sizes
September 7, 2017
Embedded Linux Network Device Driver
Development
41
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
42
Ethtool (include/linux/ethtool.h)
 ethtool is a user space tool that query low-level information from an
Ethernet interface and to modify its configuration
 @ driver, a struct ethtool_ops structure can be declared and connected to
the struct net_device using the ethtool_ops field
 List of operations: get_settings(), set_settings(), get_drvinfo(), get_wol(),
set_wol(), get_link(), get_eeprom(), set_eeprom(), get_tso(), set_tso(),
get_flags(), set_flags(), etc.
 Some of these operations can be implemented using the PHY interface
(phy_ethtool_gset(), phy_ethtool_sset()) or using generic
operations(ethtool_op_get_link() for example)
September 7, 2017
Embedded Linux Network Device Driver
Development
43
Statistics
 The driver is responsible for keeping statistics up to date about the
number of packets/bytes received/transmitted, the number of errors, of
collisions, etc.
 To expose these information, the driver must implement a get_stats()
operation, with the following prototype struct net_device_stats
*foo_get_stats(struct net_device *dev);
 The net_device_stats structure must be filled by the driver
 It contains fields such as rx_packets, tx_packets, rx_bytes, tx_bytes, rx_errors,
tx_errors, rx_dropped, tx_dropped, multicast, collisions, etc
September 7, 2017
Embedded Linux Network Device Driver
Development
44
Power Management
 suspend() function should:
 Call netif_device_detach()
 Do the hardware dependent operations to suspend the devices (like disable
the clocks)
 The resume() function should:
 Do the hardware dependent operations (like enable the clocks)
 Call netif_device_attach()
September 7, 2017
Embedded Linux Network Device Driver
Development
45
Lab: Training Setup
September 7, 2017
Embedded Linux Network Device Driver
Development
46
Outline
 Introduction
 Socket Buffers
 Network Devices
 Communication with Network Protocol
 Communication with PHY
 Buffer Management and Concurrency Issues
 Network Throughput
 Other Network Driver Considerations
 Ethernet Driver vs WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
47
Ethernet vs. WIFI
Ethernet
 CSMA/CD
 Frames are not acknowledged
WIFI
 CSMA/CA
 Frames are acknowledged
 Uses WEP for enhanced security
 2 modes of operation:
 Ad-hoc
 Infrastructure
September 7, 2017
Embedded Linux Network Device Driver
Development
48
Configuring WIFI Drivers
 The Wireless Extensions project defines a generic Linux API to configure
WLAN device drivers in a device independent manner
 It also provides a set of common tools to set and access information from
WLAN drivers
 Individual drivers must implement support for Wireless Extensions to
connect themselves with the common interface and, hence, with the tools
September 7, 2017
Embedded Linux Network Device Driver
Development
49
Talking to WIFI Drivers
 Using iwconfig utility
 To glue your driver to iwconfig, you need to implement prescribed functions
corresponding to commands that set parameters such as ESSID and WEP keys
 Using iwpriv utility
 To use iwpriv over your driver, define private ioctls relevant to your hardware
and implement the corresponding handler functions
 Using /proc/net/wireless to get driver statistics
 For this, implement the get_wireless_stats() function in your driver, in addition
to the get_stats() function
 WLAN drivers tie these three pieces of information inside a structure
called iw_handler_def, defined in include/net/iw_handler.h
September 7, 2017
Embedded Linux Network Device Driver
Development
50
Ethernet/WIFI Famous Device Drivers
September 7, 2017
Embedded Linux Network Device Driver
Development
51
Device(s) Driver Location in Kernel Tree
Intersil Prism2 WLAN Compact Flash Card /drivers/net/wireless/intersil/orinoco
Intel Pro/Wireless Mini PCI (and PCIe Mini) /drivers/net/wireless/intel/ipw2x00
Atmel WLAN USB /drivers/net/wireless/atmel
Intel PRO/1000 /drivers/net/ethernet/intel/e1000
Ethernet Driver Example
September 7, 2017
Embedded Linux Network Device Driver
Development
52
Lab: Ethernet Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
53
WIFI Driver Example
September 7, 2017
Embedded Linux Network Device Driver
Development
54
Lab: WIFI Driver
September 7, 2017
Embedded Linux Network Device Driver
Development
55
 To contact us:
 https://www.facebook.com/groups/EmbeddedSystemsTraining/
 www.swift-act.com
 training@swift-act.com
 (+2)0122-3600-207
September 7, 2017
Embedded Linux Network Device Driver
Development
56

More Related Content

What's hot

Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
RajKumar Rampelli
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
linuxlab_conf
 
Hands-on ethernet driver
Hands-on ethernet driverHands-on ethernet driver
Hands-on ethernet driver
SUSE Labs Taipei
 
Linux dma engine
Linux dma engineLinux dma engine
Linux dma engine
pradeep_tewani
 
linux device driver
linux device driverlinux device driver
linux device driver
Rahul Batra
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
Emertxe Information Technologies Pvt Ltd
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driver
Vandana Salve
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
Satpal Parmar
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
Adrien Mahieux
 
Linux device drivers
Linux device drivers Linux device drivers
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
Anil Kumar Pugalia
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
Wave Digitech
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
Anil Kumar Pugalia
 
Linux DMA Engine
Linux DMA EngineLinux DMA Engine
C Programming - Refresher - Part III
C Programming - Refresher - Part IIIC Programming - Refresher - Part III
C Programming - Refresher - Part III
Emertxe Information Technologies Pvt Ltd
 
Pcie drivers basics
Pcie drivers basicsPcie drivers basics
Pcie drivers basics
Venkatesh Malla
 
Linux device drivers
Linux device driversLinux device drivers
Linux device drivers
Abhishek Sagar
 

What's hot (20)

Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Hands-on ethernet driver
Hands-on ethernet driverHands-on ethernet driver
Hands-on ethernet driver
 
Linux dma engine
Linux dma engineLinux dma engine
Linux dma engine
 
linux device driver
linux device driverlinux device driver
linux device driver
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driver
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
The TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux KernelThe TCP/IP Stack in the Linux Kernel
The TCP/IP Stack in the Linux Kernel
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 
U-Boot presentation 2013
U-Boot presentation  2013U-Boot presentation  2013
U-Boot presentation 2013
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
Linux DMA Engine
Linux DMA EngineLinux DMA Engine
Linux DMA Engine
 
C Programming - Refresher - Part III
C Programming - Refresher - Part IIIC Programming - Refresher - Part III
C Programming - Refresher - Part III
 
Pcie drivers basics
Pcie drivers basicsPcie drivers basics
Pcie drivers basics
 
Linux device drivers
Linux device driversLinux device drivers
Linux device drivers
 

Similar to Embedded linux network device driver development

OpenStack Tokyo 2015: Connecting the Dots with Neutron
OpenStack Tokyo 2015: Connecting the Dots with NeutronOpenStack Tokyo 2015: Connecting the Dots with Neutron
OpenStack Tokyo 2015: Connecting the Dots with Neutron
Phil Estes
 
Microservices and containers networking: Contiv, an industry leading open sou...
Microservices and containers networking: Contiv, an industry leading open sou...Microservices and containers networking: Contiv, an industry leading open sou...
Microservices and containers networking: Contiv, an industry leading open sou...
Codemotion
 
The Network Ip Address Scheme
The Network Ip Address SchemeThe Network Ip Address Scheme
The Network Ip Address Scheme
Erin Rivera
 
Significance
SignificanceSignificance
Significance
Julie May
 
Building Linux IPv6 DNS Server (Complete Soft Copy)
Building Linux IPv6 DNS Server (Complete Soft Copy)Building Linux IPv6 DNS Server (Complete Soft Copy)
Building Linux IPv6 DNS Server (Complete Soft Copy)
Hari
 
Nfv compute domain
Nfv compute domainNfv compute domain
Nfv compute domain
sidneel
 
4 implementation
4 implementation4 implementation
4 implementation
hanmya
 
Building a Linux IPv6 DNS Server Project review PPT v3.0 First review
Building a Linux IPv6 DNS Server Project review PPT v3.0 First reviewBuilding a Linux IPv6 DNS Server Project review PPT v3.0 First review
Building a Linux IPv6 DNS Server Project review PPT v3.0 First review
Hari
 
Virtual Networking (1) (1).pptx
Virtual Networking (1) (1).pptxVirtual Networking (1) (1).pptx
Virtual Networking (1) (1).pptx
KrishnaMishra386849
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Etsuji Nakai
 
Advances in computer networks, computer architecture
Advances in computer networks, computer architectureAdvances in computer networks, computer architecture
Advances in computer networks, computer architecture
sandhyagowdah
 
Linux hpc-cluster-setup-guide
Linux hpc-cluster-setup-guideLinux hpc-cluster-setup-guide
Linux hpc-cluster-setup-guide
jasembo
 
Yusuf Haruna Docker internship slides
Yusuf Haruna Docker internship slidesYusuf Haruna Docker internship slides
Yusuf Haruna Docker internship slides
Yusuf Haruna
 
Ip Subnet Design
Ip Subnet DesignIp Subnet Design
Ip Subnet Design
Heather Dionne
 
Bcs 052 solved assignment
Bcs 052 solved assignmentBcs 052 solved assignment
Presentation on mcts & ccna
Presentation on mcts & ccnaPresentation on mcts & ccna
Presentation on mcts & ccna
Arpit Prajapat
 
Sockets
SocketsSockets
An Introduce of OPNFV (Open Platform for NFV)
An Introduce of OPNFV (Open Platform for NFV)An Introduce of OPNFV (Open Platform for NFV)
An Introduce of OPNFV (Open Platform for NFV)
Mario Cho
 
COC to-manage-and-monitor-the-network.pdf
COC to-manage-and-monitor-the-network.pdfCOC to-manage-and-monitor-the-network.pdf
COC to-manage-and-monitor-the-network.pdf
habtex1230
 
Private Network Project for Colleges
Private Network Project for CollegesPrivate Network Project for Colleges
Private Network Project for Colleges
Aditya Jain
 

Similar to Embedded linux network device driver development (20)

OpenStack Tokyo 2015: Connecting the Dots with Neutron
OpenStack Tokyo 2015: Connecting the Dots with NeutronOpenStack Tokyo 2015: Connecting the Dots with Neutron
OpenStack Tokyo 2015: Connecting the Dots with Neutron
 
Microservices and containers networking: Contiv, an industry leading open sou...
Microservices and containers networking: Contiv, an industry leading open sou...Microservices and containers networking: Contiv, an industry leading open sou...
Microservices and containers networking: Contiv, an industry leading open sou...
 
The Network Ip Address Scheme
The Network Ip Address SchemeThe Network Ip Address Scheme
The Network Ip Address Scheme
 
Significance
SignificanceSignificance
Significance
 
Building Linux IPv6 DNS Server (Complete Soft Copy)
Building Linux IPv6 DNS Server (Complete Soft Copy)Building Linux IPv6 DNS Server (Complete Soft Copy)
Building Linux IPv6 DNS Server (Complete Soft Copy)
 
Nfv compute domain
Nfv compute domainNfv compute domain
Nfv compute domain
 
4 implementation
4 implementation4 implementation
4 implementation
 
Building a Linux IPv6 DNS Server Project review PPT v3.0 First review
Building a Linux IPv6 DNS Server Project review PPT v3.0 First reviewBuilding a Linux IPv6 DNS Server Project review PPT v3.0 First review
Building a Linux IPv6 DNS Server Project review PPT v3.0 First review
 
Virtual Networking (1) (1).pptx
Virtual Networking (1) (1).pptxVirtual Networking (1) (1).pptx
Virtual Networking (1) (1).pptx
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 
Advances in computer networks, computer architecture
Advances in computer networks, computer architectureAdvances in computer networks, computer architecture
Advances in computer networks, computer architecture
 
Linux hpc-cluster-setup-guide
Linux hpc-cluster-setup-guideLinux hpc-cluster-setup-guide
Linux hpc-cluster-setup-guide
 
Yusuf Haruna Docker internship slides
Yusuf Haruna Docker internship slidesYusuf Haruna Docker internship slides
Yusuf Haruna Docker internship slides
 
Ip Subnet Design
Ip Subnet DesignIp Subnet Design
Ip Subnet Design
 
Bcs 052 solved assignment
Bcs 052 solved assignmentBcs 052 solved assignment
Bcs 052 solved assignment
 
Presentation on mcts & ccna
Presentation on mcts & ccnaPresentation on mcts & ccna
Presentation on mcts & ccna
 
Sockets
SocketsSockets
Sockets
 
An Introduce of OPNFV (Open Platform for NFV)
An Introduce of OPNFV (Open Platform for NFV)An Introduce of OPNFV (Open Platform for NFV)
An Introduce of OPNFV (Open Platform for NFV)
 
COC to-manage-and-monitor-the-network.pdf
COC to-manage-and-monitor-the-network.pdfCOC to-manage-and-monitor-the-network.pdf
COC to-manage-and-monitor-the-network.pdf
 
Private Network Project for Colleges
Private Network Project for CollegesPrivate Network Project for Colleges
Private Network Project for Colleges
 

More from Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)

Introduction to state machines in Embedded Software Design
Introduction to state machines in Embedded Software DesignIntroduction to state machines in Embedded Software Design
Introduction to state machines in Embedded Software Design
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Embedded SW Testing
Embedded SW TestingEmbedded SW Testing
Cracking the interview
Cracking the interviewCracking the interview
Embedded summer camps 2017
Embedded summer camps 2017Embedded summer camps 2017
Introduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical ApproachIntroduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical Approach
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Advanced Test Manager Training 2012 - Testing Process ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Advanced Test Manager Training 2012 - Testing Process
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
ISTQB Foundation Agile Tester 2014 Training, Agile SW DevelopmentISTQB Foundation Agile Tester 2014 Training, Agile SW Development
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
ISTQB Technical Test Analyst 2012 Training - Structure-Based TestingISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Simulation Using Isim
Simulation Using Isim Simulation Using Isim
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Introduction to stm32-part1
Introduction to stm32-part1Introduction to stm32-part1
Introduction to stm32-part2
Introduction to stm32-part2Introduction to stm32-part2
Fpga programming
Fpga programmingFpga programming
Synthesis Using ISE
Synthesis Using ISESynthesis Using ISE
Simulation using model sim
Simulation using model simSimulation using model sim
FreeRTOS Course - Semaphore/Mutex Management
FreeRTOS Course - Semaphore/Mutex ManagementFreeRTOS Course - Semaphore/Mutex Management
FreeRTOS Course - Semaphore/Mutex Management
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 

More from Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation) (20)

Introduction to state machines in Embedded Software Design
Introduction to state machines in Embedded Software DesignIntroduction to state machines in Embedded Software Design
Introduction to state machines in Embedded Software Design
 
Embedded SW Testing
Embedded SW TestingEmbedded SW Testing
Embedded SW Testing
 
Cracking the interview
Cracking the interviewCracking the interview
Cracking the interview
 
Embedded summer camps 2017
Embedded summer camps 2017Embedded summer camps 2017
Embedded summer camps 2017
 
Introduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical ApproachIntroduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical Approach
 
ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Advanced Test Manager Training 2012 - Testing Process ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Advanced Test Manager Training 2012 - Testing Process
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
 
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
ISTQB Foundation Agile Tester 2014 Training, Agile SW DevelopmentISTQB Foundation Agile Tester 2014 Training, Agile SW Development
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
 
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
ISTQB Technical Test Analyst 2012 Training - Structure-Based TestingISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
 
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Android Booting Scenarios
 
Simulation Using Isim
Simulation Using Isim Simulation Using Isim
Simulation Using Isim
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
Introduction to stm32-part1
Introduction to stm32-part1Introduction to stm32-part1
Introduction to stm32-part1
 
Introduction to stm32-part2
Introduction to stm32-part2Introduction to stm32-part2
Introduction to stm32-part2
 
Fpga programming
Fpga programmingFpga programming
Fpga programming
 
Synthesis Using ISE
Synthesis Using ISESynthesis Using ISE
Synthesis Using ISE
 
Simulation using model sim
Simulation using model simSimulation using model sim
Simulation using model sim
 
FreeRTOS Course - Semaphore/Mutex Management
FreeRTOS Course - Semaphore/Mutex ManagementFreeRTOS Course - Semaphore/Mutex Management
FreeRTOS Course - Semaphore/Mutex Management
 

Recently uploaded

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 

Recently uploaded (20)

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 

Embedded linux network device driver development

  • 1. Embedded Linux Network Device Driver Development
  • 2. Rights to Copy  License: Creative Commons Attribution - Share Alike 3.0  You are free:  to copy, distribute, display, and perform the work  to make derivative works  to make commercial use of the work  Under the following conditions:  Attribution – Derived from original work of Free Electrons  Share Alike  For any reuse or distribution, you must make clear to others the license terms of this work. September 7, 2017 Embedded Linux Network Device Driver Development 2
  • 3. References  www.free-electrons.com  Essential Linux Device Drivers  Linux Device Drivers September 7, 2017 Embedded Linux Network Device Driver Development 3
  • 4. Objectives  Understanding the structure of ethernet and WIFI device drivers  Developing Linux network device drivers Embedded Linux Network Device Driver Development 4 September 7, 2017
  • 5. Prerequisites  Solid C programming  Knowledge of Linux commands is a plus  Knowledge of networking  Embedded Linux Kernel and Driver Development training or equivalent Embedded Linux Network Device Driver Development 5 September 7, 2017
  • 6. Notes  Ask any time.  Turn your cell silent. Embedded Linux Network Device Driver Development 6 September 7, 2017
  • 7. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 7
  • 8. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 8
  • 9. OSI Model and Linux Kernel September 7, 2017 Embedded Linux Network Device Driver Development 9 User Space Kernel Network Stack Device Driver
  • 10. Network Device Model September 7, 2017 Embedded Linux Network Device Driver Development 10
  • 11. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 11
  • 12. Socket Buffer (sk_buff)  struct sk_buff (include/linux/sk_buff.h) represents a network packet  Support data encapsulation/decapsulation through protocol layers  In addition to data, sk_buff maintains:  head, the start of the packet  data, the start of the packet payload  tail, the end of the packet payload  end, the end of the packet  len, the amount of data of the packet  These fields are updated when the packet goes through the protocol layers September 7, 2017 Embedded Linux Network Device Driver Development 12
  • 13. SKB Operations Allocation  By dev_alloc_skb() function  Can be done in ISR  On Ethernet, allocated size = packet length + 2  To word align IP header  IP header = 14 bytes Reservation  By skb_reserve() function  Skipping NET_IP_ALIGN padding bytes September 7, 2017 Embedded Linux Network Device Driver Development 13
  • 14. SKB Operations cont’d Data Copying  From DMA buffer to SKB during reception for example  OR SKB to DMA buffer during transmission (may be) Pointers Update  After copying payload September 7, 2017 Embedded Linux Network Device Driver Development 14
  • 15. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 15
  • 16. Network Device  struct net_device (include/linux/netdevice.h) represents a network interface  Allocation takes place with alloc_netdev() function  Size of private data is passed as argument  Pointer to these private data can be read in net_device->priv  Use alloc_etherdev() for ethernet interfaces  Use alloc_ieee80211() for WIFI interfaces September 7, 2017 Embedded Linux Network Device Driver Development 16
  • 17. Network Device cont’d  Registration with register_netdev() function  Unregistration with unregister_netdev() function  Liberation with free_netdev() function September 7, 2017 Embedded Linux Network Device Driver Development 17
  • 18. Network Device Operations  Defined by struct net_device_ops (include/linux/netdevice.h)  Set the netdev_ops field in the struct net_device structure to point to the struct net_device_ops structure September 7, 2017 Embedded Linux Network Device Driver Development 18 Operation Description ndo_open() Called when network interface uped ndo_close() Called when network interface downed ndo_start_xmit() Start packet transmission ndo_get_stats() Get statistics ndo_do_ioctl() Implement device specific operations ndo_set_rx_mode() Select promiscuous, multicast, etc ndo_set_mac_address() Set MAC address ndo_set_multicast_list() Set multicast filters
  • 19. Network Device Operations cont’d  Sample operations are: September 7, 2017 Embedded Linux Network Device Driver Development 19 Operation Description ndo_open() Called when network interface uped ndo_close() Called when network interface downed ndo_start_xmit() Start packet transmission ndo_get_stats() Get statistics ndo_do_ioctl() Implement device specific operations ndo_set_rx_mode() Select promiscuous, multicast, etc ndo_set_mac_address() Set MAC address ndo_set_multicast_list() Set multicast filters ndo_tx_timeout() Reset unresponsive network interface
  • 20. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 20
  • 21. Flow Control Utility Functions  include/linux/netdevice.h September 7, 2017 Embedded Linux Network Device Driver Development 21 Operation Description netif_start_queue() Tells kernel that driver is ready to send packets netif_stop_queue() Tells kernel to stop sending packets (@cleanup or congestion) netif_queue_stopped() Tells whether queue is stopped or not netif_wake_queue() Wakes up a queue after a netif_stop_queue() netif_rx() Gives SKB to kernel
  • 22. Transmission  Kernel calls ndo_start_xmit() with SKB as argument  ndo_start_xmit(): 1. Sets up DMA buffers and other HW mechanisms 2. Starts transmission 3. Can stop queueing if no more free DMA buffers available using netif_stop_queue() 4. Returns NETDEV_TX_OK or NETDEV_TX_BUSY  When N packets have been sent, an interrupt is raised and the driver should: 1. Acknowledging interrupt 2. Freeing used DMA buffers 3. Freeing SKB with dev_kfree_skb_irq() 4. If the queue was stopped, start it again September 7, 2017 Embedded Linux Network Device Driver Development 22
  • 23. Reception: Non-NAPI  Reception is via an interrupt that should: 1. Allocate an SKB 2. Reserve NET_IP_ALIGN padding bytes 3. Copy packet from DMA buffers to SKB 4. Update SKB pointers 5. Update the skb->protocol field with eth_type_trans(skb, netdevice) 6. Give SKB to kernel by netif_rx()  netif_rx() use NET_RX_SOFTIRQ to offload the work of posting received data packets to protocol layers  Nice and simple  @high traffic, interrupt rate is high  Solution: switch to polled mode when interrupt rate is too high (NAPI) September 7, 2017 Embedded Linux Network Device Driver Development 23
  • 24. Reception: NAPI  In network interface private structure, add a struct napi_struct (include/linux/netdevice.h)  @ driver initialization, register the NAPI poll operation  dev: network interface  &lp->napi: struct napi_struct  r6040_poll: NAPI poll operation  64: weight that represents the importance of network interface September 7, 2017 Embedded Linux Network Device Driver Development 24
  • 25. Reception: NAPI cont’d Rx ISR  Disables Rx interrupt and switch to polled mode if (napi_schedule_prep(&lp->napi)) { /* Disable reception interrupts */ __napi_schedule(&lp->napi); }  Kernel calls our poll() operation regularly Poll Function  static int r6040_poll(struct napi_struct *napi, int budget)  Receives at most budget packets and pushes them to the network stack using netif_receive_skb()  If less than budget packets have been received, switch back to interrupt mode using napi_complete(&lp- >napi) and reenable interrupts  Must return the number of packets received September 7, 2017 Embedded Linux Network Device Driver Development 25
  • 26. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 26
  • 27. Connection with PHY  MAC and PHY are connected using a MII or RMII interface  This interface contains two wires used for the MDIO bus  Driver needs to communicate with the PHY to get link information (up, down, speed, full or half duplex) and configure the MAC accordingly September 7, 2017 Embedded Linux Network Device Driver Development 27
  • 28. PHY in Kernel  Kernel has a framework (drivers/net/phy/) that  Exposes an API to communicate with PHY  Allows to implement PHY drivers  Implements a basic generic PHY driver that works with all PHY  See Documentation/networking/phy.txt September 7, 2017 Embedded Linux Network Device Driver Development 28
  • 29. MDIO Bus Initialization  Driver creates a MDIO bus struct mii_bus (include/linux/mii.h) to tells PHY infrastructure how to communicate with the PHY  mdio_read() and mdio_write are HW specific and must be implemented by the driver September 7, 2017 Embedded Linux Network Device Driver Development 29
  • 30. MDIO Bus Initialization cont’d  The ->irq[] array must be allocated and initialized  To use polling, set the values to PHY_POLL Lp->mii_if->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); for (i = 0; i < PHY_MAX_ADDR; i++) lp->mii_if>irq[i] = PHY_POLL;  Finally, register the MDIO bus  This will scan the bus for PHYs and fill the mii_if->phy_map[] array with the result mdiobus_register(bp->mii_if); September 7, 2017 Embedded Linux Network Device Driver Development 30
  • 31. Connecting with PHY  mdiobus_register() function filled the mii_if->phy_map[] array with struct phy_device * pointers  Appropriate PHY (usually, only one is detected) must be selected  Connecting to the PHY allows to register a callback that will be called when the link changes :  interface is usually PHY_INTERFACE_MODE_MII or PHY_INTERFACE_MODE_RMII September 7, 2017 Embedded Linux Network Device Driver Development 31
  • 32. Updating MAC Capabilities  MAC and PHY might have different capabilities  PHY handling Gigabit speed, but not MAC  Driver is responsible for updating phydev->advertise and phydev- >supported to remove any PHY capability that the MAC doesn't support September 7, 2017 Embedded Linux Network Device Driver Development 32
  • 33. Handling Link Changes  The callback that handle link changes should have the following prototype: void foo_handle_link_change(struct net_device *dev)  It must check the duplex, speed and link fields of the struct phy_device structure, and update Ethernet controller configuration accordingly  duplex is either DUPLEX_HALF or DUPLEX_FULL  speed is either SPEED_10, SPEED_100, SPEED_1000, SPEED_2500 or SPEED_10000  link is a Boolean September 7, 2017 Embedded Linux Network Device Driver Development 33
  • 34. Starting and stopping the PHY  After set up, to make the PHY driver poll regularly the PHY hardware, one must start it with phy_start() functions  And stop it using phy_stop(), when no longer needed September 7, 2017 Embedded Linux Network Device Driver Development 34
  • 35. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 35
  • 36. Buffers Management  During open(), driver pre-allocates needed DMA descriptos needed for transmission and reception  When totally utilized, the driver tells the kernel to stop sending packets to the driver  SKB are allocated and freed as per need September 7, 2017 Embedded Linux Network Device Driver Development 36
  • 37. Concurrency  Access protection needed in the face of multiple execution threads:  Transmit thread  Receive thread  Transmit-complete interrupt  Receive interrupt  NAPI polling September 7, 2017 Embedded Linux Network Device Driver Development 37
  • 38. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 38
  • 39. Network Benchmarking  Netperf (free from www.netperf.org ) can set up complex TCP/UDP connection scenarios to control C/C’s such as protocol parameters, number of simultaneous sessions, and size of data blocks.  Benchmarking = Comparing resulting throughput with maximum practical bandwidth  Factors affecting throughput:  Driver implementation  Protocol used September 7, 2017 Embedded Linux Network Device Driver Development 39
  • 40. Driver Performance  Execution time  Considering usage of DMA for large packets  Offloading CPU by moving functionalities to hardware (TCP checksum)  Taking into consideration upper layers behavior September 7, 2017 Embedded Linux Network Device Driver Development 40
  • 41. Protocol Performance  TCP window size = data that can be transmitted before receiving ACK  Fast network interfaces + small window size = TCP sitting idle waiting for ACK  In UDP, the window size is not relevant as there is no ACK  Packet loss in TCP and UDP  Mapping protocol block sizes to MTU sizes September 7, 2017 Embedded Linux Network Device Driver Development 41
  • 42. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 42
  • 43. Ethtool (include/linux/ethtool.h)  ethtool is a user space tool that query low-level information from an Ethernet interface and to modify its configuration  @ driver, a struct ethtool_ops structure can be declared and connected to the struct net_device using the ethtool_ops field  List of operations: get_settings(), set_settings(), get_drvinfo(), get_wol(), set_wol(), get_link(), get_eeprom(), set_eeprom(), get_tso(), set_tso(), get_flags(), set_flags(), etc.  Some of these operations can be implemented using the PHY interface (phy_ethtool_gset(), phy_ethtool_sset()) or using generic operations(ethtool_op_get_link() for example) September 7, 2017 Embedded Linux Network Device Driver Development 43
  • 44. Statistics  The driver is responsible for keeping statistics up to date about the number of packets/bytes received/transmitted, the number of errors, of collisions, etc.  To expose these information, the driver must implement a get_stats() operation, with the following prototype struct net_device_stats *foo_get_stats(struct net_device *dev);  The net_device_stats structure must be filled by the driver  It contains fields such as rx_packets, tx_packets, rx_bytes, tx_bytes, rx_errors, tx_errors, rx_dropped, tx_dropped, multicast, collisions, etc September 7, 2017 Embedded Linux Network Device Driver Development 44
  • 45. Power Management  suspend() function should:  Call netif_device_detach()  Do the hardware dependent operations to suspend the devices (like disable the clocks)  The resume() function should:  Do the hardware dependent operations (like enable the clocks)  Call netif_device_attach() September 7, 2017 Embedded Linux Network Device Driver Development 45
  • 46. Lab: Training Setup September 7, 2017 Embedded Linux Network Device Driver Development 46
  • 47. Outline  Introduction  Socket Buffers  Network Devices  Communication with Network Protocol  Communication with PHY  Buffer Management and Concurrency Issues  Network Throughput  Other Network Driver Considerations  Ethernet Driver vs WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 47
  • 48. Ethernet vs. WIFI Ethernet  CSMA/CD  Frames are not acknowledged WIFI  CSMA/CA  Frames are acknowledged  Uses WEP for enhanced security  2 modes of operation:  Ad-hoc  Infrastructure September 7, 2017 Embedded Linux Network Device Driver Development 48
  • 49. Configuring WIFI Drivers  The Wireless Extensions project defines a generic Linux API to configure WLAN device drivers in a device independent manner  It also provides a set of common tools to set and access information from WLAN drivers  Individual drivers must implement support for Wireless Extensions to connect themselves with the common interface and, hence, with the tools September 7, 2017 Embedded Linux Network Device Driver Development 49
  • 50. Talking to WIFI Drivers  Using iwconfig utility  To glue your driver to iwconfig, you need to implement prescribed functions corresponding to commands that set parameters such as ESSID and WEP keys  Using iwpriv utility  To use iwpriv over your driver, define private ioctls relevant to your hardware and implement the corresponding handler functions  Using /proc/net/wireless to get driver statistics  For this, implement the get_wireless_stats() function in your driver, in addition to the get_stats() function  WLAN drivers tie these three pieces of information inside a structure called iw_handler_def, defined in include/net/iw_handler.h September 7, 2017 Embedded Linux Network Device Driver Development 50
  • 51. Ethernet/WIFI Famous Device Drivers September 7, 2017 Embedded Linux Network Device Driver Development 51 Device(s) Driver Location in Kernel Tree Intersil Prism2 WLAN Compact Flash Card /drivers/net/wireless/intersil/orinoco Intel Pro/Wireless Mini PCI (and PCIe Mini) /drivers/net/wireless/intel/ipw2x00 Atmel WLAN USB /drivers/net/wireless/atmel Intel PRO/1000 /drivers/net/ethernet/intel/e1000
  • 52. Ethernet Driver Example September 7, 2017 Embedded Linux Network Device Driver Development 52
  • 53. Lab: Ethernet Driver September 7, 2017 Embedded Linux Network Device Driver Development 53
  • 54. WIFI Driver Example September 7, 2017 Embedded Linux Network Device Driver Development 54
  • 55. Lab: WIFI Driver September 7, 2017 Embedded Linux Network Device Driver Development 55
  • 56.  To contact us:  https://www.facebook.com/groups/EmbeddedSystemsTraining/  www.swift-act.com  training@swift-act.com  (+2)0122-3600-207 September 7, 2017 Embedded Linux Network Device Driver Development 56