TAILIEUCHUNG - Our ‘recv1000.c’ driver

Our ‘’ driver products Similarities, ‘push’ versus ‘pull’, Sleep/wakeup, Driver’s components, NIC’s interrupts work, Interrupt event-types, Interrupt Mask Set/Read, Interrupt Mask Clear, Interrupt Cause Read. | Our ‘’ driver Implementing a ‘packet-receive’ capability with the Intel 82573L network interface controller Similarities • There exist quite a few similarities between implementing the ‘transmit-capability’ and the ‘receive-capability’ in a device-driver for Intel’s 82573L ethernet controller: – – – – Identical device-discovery and ioremap steps Same steps for ‘global reset’ of the hardware Comparable data-structure initializations Parallel setups for the TX and RX registers • But there also are a few fundamental differences (such as ‘active’ versus ‘passive’ roles for driver) ‘push’ versus ‘pull’ Host memory transmit packet buffer Ethernet controller push transmit-FIFO to/from LAN receive packet buffer pull receive-FIFO The ‘write()’ routine in our ‘’ driver could transfer data at any time, but the ‘read()’ routine in our ‘’ driver has to wait for data to arrive. So to avoid doing any wasteful busy-waiting, our ‘’ driver can use the Linux kernel’s sleep/wakeup mechanism – if it enables NIC’s interrupts! Sleep/wakeup • We will need to employ a wait-queue, we will need to enable device-interrupts, and we will need to write and install the code for an interrupt service routine (ISR) • So our ‘’ driver will have a few additional code and data components that were absent in our ‘’ driver Driver’s components my_isr() wait_queue_head This function will awaken any sleeping reader-task my_fops read ‘struct’ holds one function-pointer my_read() This function will program the actual data-transfer my_get_info() This function will allow us to inspect the receive-descriptors module_init() This function will detect and configure the hardware, define page-mappings, allocate and initialize the descriptors, install our ISR and enable interrupts, start the ‘receive’ engine, create the pseudo-file and register ‘my_fops’ module_exit() This function will do needed ‘cleanup’ when it’s time to unload our

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.