2005-05-14 23:26:11

by Green Brain

[permalink] [raw]
Subject: ICH5 MODEM in NASM - pci_dev

I would like to write a kernel module (driver) to the ICH5 SmartLink
SoftModem. The project is on my assembly.uw.hu website. If you can write PCI
driver please help me!

What is wrong with this offset array? (This is a NASM implementation of the
pci_dev structude from pci.h file.



;The pci_dev structure is used to describe both PCI and ISAPnP devices.

; NAME OFFSET SIZE

%assign pci_dev.global_list 0 ;8 node in list of all PCI devices

%assign pci_dev.bus_list 8 ;8 node in per-bus list

%assign pci_dev.bus 16 ;4 pci_bus bus this device is on

%assign pci_dev.subordinate 20 ;4 pci_bus bus this device bridges to

%assign pci_dev.sysdata 24 ;4 void hook for sys-specific extension

%assign pci_dev.procent 28 ;4 struct proc_dir_entry device entry in
/proc/bus/pci

%assign pci_dev.devfn 32 ;4 encoded device & function index

%assign pci_dev.vendor 36 ;2

%assign pci_dev.device 38 ;2

%assign pci_dev.subsystem_vendor 40 ;2

%assign pci_dev.subsystem_device 42 ;2

%assign pci_dev.class 44 ;4 3 bytes: (base,sub,prog-if)

%assign pci_dev.hdr_type 48 ;1 PCI header type (`multi' flag masked out)

%assign pci_dev.rom_base_reg 49 ;1 which config register controls the ROM

%assign pci_dev.driver 50 ;4 pci_driver which driver has allocated this
device

%assign pci_dev.driver_data 54 ;4 void data private to the driver

%assign pci_dev.dma_mask 58 ;4 Mask of the bits of bus aequress this

;HERE IS AN ERROR! DMA_MASK<>FFFFFFFF! FIX ME! ; device implements. Normally
this is

; 0xffffffff. You only need to change

; this if your device has broken DMA

; or supports 64-bit transfers.

%assign pci_dev.current_state 62 ;4 ;Current operating state. In ACPI-speak,

; this is D0-D3, D0 being fully functional,

; and D3 being off.

;device is compatible with these IDs

%assign pci_dev.vendor_compatible 66 ;8 [DEVICE_COUNT_COMPATIBLE]=4;

%assign pci_dev.device_compatible 74 ;8 [DEVICE_COUNT_COMPATIBLE]=4;

;Instead of touching interrupt line and base aequress registers

;directly, use the values stored here. They might be different!

%assign pci_dev.irq 82 ;4

;==========================

%assign pci_dev.resource 86 ;12 resource*12 [DEVICE_COUNT_RESOURCE]=12 I/O
and memory regions + expansion ROMs

%assign pci_dev.dma_resource 98 ;2 resource*2 [DEVICE_COUNT_DMA]=2

%assign pci_dev.irq_resource 100 ;2 resource*2 [DEVICE_COUNT_IRQ]=2

%assign pci_dev.name 102 ;80 [80] device name

%assign pci_dev.slot_name 182 ;8 [8] slot name

%assign pci_dev.active 190 ;4 ISAPnP: device is active

%assign pci_dev.ro 194 ;4 ISAPnP: read only

%assign pci_dev.regs 198 ;2 ISAPnP: supported registers

%assign pci_dev.prepare 200 ;4 (struct pci_dev *dev) ISAPnP hooks

%assign pci_dev.activate 204 ;4 (struct pci_dev *dev)

%assign pci_dev.deactivate 208 ;4 (struct pci_dev *dev)



Thanks in advance!




____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu


2005-05-15 00:13:48

by Sasha Khapyorsky

[permalink] [raw]
Subject: Re: ICH5 MODEM in NASM - pci_dev

On 01:09 Sun 15 May , Green Brain wrote:
> I would like to write a kernel module (driver) to the ICH5 SmartLink
> SoftModem. The project is on my assembly.uw.hu website. If you can write PCI
> driver please help me!

There is already sound/pci/intel8x0m.c alsa pci driver for such modems.

Sasha.