0

I've been tasked with making a custom kernel module that reads the memory of a NIC device, from the family of Broadcom chipsets.

In my case I'm using a BCM4311, have installed the firmware and the kernel driver, but I can't seem to get a grasp on how to access the device object memory. I know the memory I/O char and block devices, etc. But NICs are quite complex...

Does the B43 handle the memory access for me? How can I access the physical memory from the device? Can't get a /dev/<nic>, do I have to use an ioctl? But ioctl does not equal to physical memory, right?

I am somewhat confused by this topic...

3
  • If the driver does not enable in whatever way what you want then I am afraid (really) that /dev/mem together with detailed documentation of your device will be your two unique friends. Commented Nov 20, 2022 at 0:31
  • @MC68020 So, if i were to rea the physical mem of my device. I would have to read the /dev/mem starting at the corresponding address (in my case, using lspci returns a Region 0: Memory at 0x<Address>), am I right? Commented Nov 20, 2022 at 10:54
  • Basically yes. Being said you'll almost certainly need to mmap it. Since, playing with /dev/mem can just break your system (even when you think you know what you are doing), I strongly urge you to consider busybox' devmem utility ( github.com/brgl/busybox/blob/master/miscutils/devmem.c ) It might well in itself just fulfill all your needs or… at least… give you some useful hints. Commented Nov 20, 2022 at 12:15

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.