Re: jkh weird problem (reading pci device memory)

2006-08-12 Thread Niki Denev
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Baldwin wrote: On Saturday 05 August 2006 10:06, Niki Denev wrote: for(i=0; i sizeof(config_table_t); i++) { r = bus_space_read_1(sc-bar.tag, sc-bar.hdl, i); *((u_int8_t *)sc-cfg_table + i) = r;

Re: jkh weird problem (reading pci device memory)

2006-08-12 Thread John-Mark Gurney
Niki Denev wrote this message on Sat, Aug 12, 2006 at 11:42 +0300: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John Baldwin wrote: On Saturday 05 August 2006 10:06, Niki Denev wrote: for(i=0; i sizeof(config_table_t); i++) { r = bus_space_read_1(sc-bar.tag, sc-bar.hdl,

Re: jkh weird problem (reading pci device memory) [ Success story ! ]

2006-08-12 Thread Niki Denev
John-Mark Gurney writes: No, read_multi reads from the same location every time.. This is for things like a FIFO where the value can change each time, you want bus_read_region_1... Read the bus_space(9) man page for more info about the differences between the two...

Re: jkh weird problem (reading pci device memory)

2006-08-08 Thread John Baldwin
On Monday 07 August 2006 18:05, John-Mark Gurney wrote: John Baldwin wrote this message on Mon, Aug 07, 2006 at 15:27 -0400: sc-cfg_table.signature = letoh32(bus_read_4(sc-bar.res, 0)); sc-cfg_table.version = letoh16(bus_read_2(sc-bar.res, 4)); sc-cfg_table.dummy =

Re: jkh weird problem (reading pci device memory)

2006-08-08 Thread John-Mark Gurney
John Baldwin wrote this message on Tue, Aug 08, 2006 at 13:42 -0400: On Monday 07 August 2006 18:05, John-Mark Gurney wrote: John Baldwin wrote this message on Mon, Aug 07, 2006 at 15:27 -0400: sc-cfg_table.signature = letoh32(bus_read_4(sc-bar.res, 0)); sc-cfg_table.version =

Re: jkh weird problem (reading pci device memory)

2006-08-07 Thread John Baldwin
On Saturday 05 August 2006 10:06, Niki Denev wrote: for(i=0; i sizeof(config_table_t); i++) { r = bus_space_read_1(sc-bar.tag, sc-bar.hdl, i); *((u_int8_t *)sc-cfg_table + i) = r; } Note that you can replace this with:

Re: jkh weird problem (reading pci device memory)

2006-08-07 Thread Niki Denev
On Monday 07 August 2006 22:27, John Baldwin wrote: On Saturday 05 August 2006 10:06, Niki Denev wrote: for(i=0; i sizeof(config_table_t); i++) { r = bus_space_read_1(sc-bar.tag, sc-bar.hdl, i); *((u_int8_t *)sc-cfg_table + i) = r; } Note that

Re: jkh weird problem (reading pci device memory)

2006-08-07 Thread John-Mark Gurney
John Baldwin wrote this message on Mon, Aug 07, 2006 at 15:27 -0400: sc-cfg_table.signature = letoh32(bus_read_4(sc-bar.res, 0)); sc-cfg_table.version = letoh16(bus_read_2(sc-bar.res, 4)); sc-cfg_table.dummy = bus_read_1(sc-bar.res, 5); Note that this may or may not be

jkh weird problem (reading pci device memory)

2006-08-05 Thread Niki Denev
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I'm trying to port a linux driver to freebsd (hsdpa/umts nozomi card), and i'm experiencing some really weird problem... probably due to my limited kernel knowledge/experience. Here it is the attach routine, which tries to read a portion of the