Jump to content
3411 posts in this topic

Recommended Posts

TNW wanted me to share with everyone some rather big news. He has been hard at work, delving into the innards of the Darwin kernel, finding strange and obscure misfeatures involving, among other things, non-aligned IOMallocContiguous() calls.

 

In addition to fixing the initialization problems, the card now properly starts up, initializes, receives data, and enters ieee80211_rx_irqsafe(). Ladies and gentlemen, I present to you the first packet received by this driver:

 

A80000001B026B87000006000000000001002300000
A830080000000FFFFFFFFFFFF001E4C427849001E4C
427849C04F8691AC642700000064001104000C4C69
7665626F782D44454430010882848B962430486C030
1010504010300002A01002F010032040C121860DD16
0050F20101000050F20201000050F20201000050F20
2DD180050F2020101800003A4000027A4000042435E
0062322F00

 

Which looks an awful lot like an ESSID broadcast. Specifically, of the AP named "Livebox", which I'm told belongs to TNW himself.

 

There is much more work to do, but now the hardware is at least starting to behave.

TNW wanted me to share with everyone some rather big news. He has been hard at work, delving into the innards of the Darwin kernel, finding strange and obscure misfeatures involving, among other things, non-aligned IOMallocContiguous() calls.

 

In addition to fixing the initialization problems, the card now properly starts up, initializes, receives data, and enters ieee80211_rx_irqsafe(). Ladies and gentlemen, I present to you the first packet received by this driver:

 

A80000001B026B87000006000000000001002300000
A830080000000FFFFFFFFFFFF001E4C427849001E4C
427849C04F8691AC642700000064001104000C4C69
7665626F782D44454430010882848B962430486C030
1010504010300002A01002F010032040C121860DD16
0050F20101000050F20201000050F20201000050F20
2DD180050F2020101800003A4000027A4000042435E
0062322F00

 

Which looks an awful lot like an ESSID broadcast. Specifically, of the AP named "Livebox", which I'm told belongs to TNW himself.

 

There is much more work to do, but now the hardware is at least starting to behave.

 

can u explain to me what this is?? and what card it is for??

 

And also i uploaded to logs bu when i try to upload system.txt it tells me that it is too large to upload. What should i do?? or are those 2 enough??

the utility for making logs was wrong

please download getlogs4.command.zip from http://code.google.com/p/iwidarwin/

and post logs again

 

if system.log is large just zip it

 

need logs for iwi3945, iwi2200

 

TNW, Symuc

have you tried the getPhysicalSegmentsWithCoalesce() for the memory problem?

mac os as strange behaviors when dealing with memory allocation...

 

just remebered that the driver is using mac80211 code - can be hard to make it work

the ieee80211 code from iwi2200 is stable but it will probably fail for "a" and "g" mode

at this time i guess the driver need to do this:

 

1) handle beacons, probe responses,etc (ieeerx_mgmt)

2) rx data (ieee_rx)

3) tx data (outputpacket and ieee_xmit)

 

if you're using the mac80211 code try to follow this order - it will help to make things work

the utility for making logs was wrong

please download getlogs4.command.zip from http://code.google.com/p/iwidarwin/

and post logs again

 

if system.log is large just zip it

 

need logs for iwi3945, iwi2200

 

TNW, Symuc

have you tried the getPhysicalSegmentsWithCoalesce() for the memory problem?

mac os as strange behaviors when dealing with memory allocation...

 

jalavoui, i downloaded getlogs4.command.zip but now what do i do with it??

 

i really want to help!

Ok so ive been tweaking alittle bit not knowing what im really doing and after a few kernel panics and so on....here is my latest log, can anyone tell me what some of it means? i can pretty much tell that all the "errors" mean "error, i aint working" lol:

 

Mar 1 09:07:22 M-6816 kernel[0]: iwi3945: Starting

Mar 1 09:07:22 M-6816 kernel[0]: settCurController [OK]

Mar 1 09:07:22 M-6816 kernel[0]: IOPCCard info: iwl3945: Intel® PRO/Wireless 3945ABG/BG Network Connection driver for Linux, 1.2.23

Mar 1 09:07:22 M-6816 kernel[0]: IOPCCard info: iwl3945: Copyright© 2003-2007 Intel Corporation

Mar 1 09:07:22 M-6816 kernel[0]: error iwl3945: U iwl3945_pci_probe *** LOAD DRIVER ***

Mar 1 09:07:22 M-6816 kernel[0]: error iwl3945: U iwl3945_pci_probe pci_resource_len = 0x00000008

Mar 1 09:07:22 M-6816 kernel[0]: error iwl3945: U iwl3945_pci_probe pci_resource_base = 0x2dfc9000

Mar 1 09:07:22 M-6816 kernel[0]: IOPCCard info: iwl3945: Detected Intel PRO/Wireless 3945ABG Network Connection

Mar 1 09:07:22 M-6816 kernel[0]: error iwl3945: U iwl3945_set_rxon_channel Staging channel set to 6 [3]

Mar 1 09:07:22 M-6816 com.apple.kextd[10]: kld(): Undefined symbols:

Mar 1 09:07:22 M-6816 kernel[0]: init_waitqueue_head stubbed out!

Mar 1 09:07:22 M-6816 kextd[32]: kld_load_from_memory() failed for module /System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/Contents/MacOS/ACPI_SMC_PlatformPlugin

Mar 1 09:07:22 M-6816 com.apple.kextd[10]: __ZN14IOPMrootDomain24systemPowerEventOccurredEPK8OSSymbolP8OSObject

Mar 1 09:07:22 M-6816 kernel[0]: cmd Rx timeout = 0

Mar 1 09:07:22 M-6816 kextd[32]: a link/load error occured for kernel extension /System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext

Mar 1 09:07:22 M-6816 kernel[0]: error iwl3945: U iwl3945_update_power_cmd Sleep interval vector = { 0 , 0 , 0 , 0 , 0 }

Mar 1 09:07:22 M-6816 kernel[0]: error iwl3945: U iwl3945_enqueue_hcmd Sending command POWER_TABLE_CMD (#77), seq: 0x0400, 36 bytes at 0[0]:4

Mar 1 09:07:23 M-6816 kernel[0]: Wait POWER_TABLE_CMD Condition: 0ms left

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: Error sending POWER_TABLE_CMD: time out after 50ms.

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: U iwl3945_enqueue_hcmd Sending command REPLY_BT_CONFIG (#9b), seq: 0x0401, 16 bytes at 1[1]:4

Mar 1 09:07:23 M-6816 kernel[0]: GFX0: family specific matching failsWait START_ALIVE Condition: 0ms left

Mar 1 09:07:23 M-6816 kernel[0]: Wait for START_ALIVE timeout after 200ms.

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: U iwl3945_mac_open leave - failed

Mar 1 09:07:23 M-6816 kernel[0]: Wait REPLY_BT_CONFIG Condition: 0ms left

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: Error sending REPLY_BT_CONFIG: time out after 50ms.

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: U iwl3945_commit_rxon Sending RXON

Mar 1 09:07:23 M-6816 kernel[0]: * without RXON_FILTER_ASSOC_MSK

Mar 1 09:07:23 M-6816 kernel[0]: * channel = 1

Mar 1 09:07:23 M-6816 kernel[0]: * bssid = 00:00:00:00:00:00

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: U iwl3945_enqueue_hcmd Sending command REPLY_RXON (#10), seq: 0x0402, 48 bytes at 2[2]:4

Mar 1 09:07:23 M-6816 kernel[0]: Wait REPLY_RXON Condition: 0ms left

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: Error sending REPLY_RXON: time out after 50ms.

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: Error setting new configuration (-60).

Mar 1 09:07:23 M-6816 kernel[0]: error iwl3945: U iwl3945_alive_start ALIVE processing complete.

Mar 1 09:07:23 M-6816 kernel[0]: __ OUT iwl3945_alive_start __

That would be great to test drivers for 4965 and post results here.

They say both intel 3945 and 4965 are very similar to each other.

If so , is it possible to make , what we have so far for 3945 , for 4965 ?

So as we are Intel 4965 users could join the club and help for building this driver together.

That would be great to test drivers for 4965 and post results here.

They say both intel 3945 and 4965 are very similar to each other.

If so , is it possible to make , what we have so far for 3945 , for 4965 ?

So as we are Intel 4965 users could join the club and help for building this driver together.

 

Oh , yeah that would be nice , if you want you can work with me ,

As Jalavoui said , we can make the two cards working , with one driver , by using preprocessor instructions ,

you can take the 4965 driver from linux , and you have just 2 or 3 lines to change :

 

All function called by a tasklet,

For instance :

 

static void iwl3945_bg_restart(struct work_struct *data)

{

struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, restart);

 

must be replaced by

 

static void iwl3945_bg_restart(struct iwl3945_priv *priv)

{

//struct iwl3945_priv *priv = container_of(data, struct iwl3945_priv, restart);

 

And the INIT_WORK by adding a number for the task(not used at this moment), maybe the pci_alloc_consistent by adding a parameter at the end of the call, but it isn't used ( it is a relica of test )

 

Bye.

Im very thankful for the work that people like TNW, jalavoui, and Symic are doing for the Intel Wireless plattforn, right now Im on INTEL 2200 on Tiger and is working well with free/wep AP.

 

Im have a question. It's possible to use NSGUI or other to SAVE the passwords....? the stable version .2 cannot .. and others SVN neither...

 

 

Thanks for you time.

Hi ,

it seems that our problem of IOMallocContiguous doesn't exist I added Debug to pci_alloc_consistent:

void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,dma_addr_t *dma_handle,int count) {
size = RT_ALIGN_Z(size, PAGE_SIZE);
//return IOMallocContiguous(size,PAGE_SIZE, dma_handle);

	void *pv = IOMallocContiguous(size, PAGE_SIZE, NULL);
	if (pv)
	{
		IOMemoryDescriptor *pMemDesc = IOMemoryDescriptor::withAddress((vm_address_t)pv, size, kIODirectionOutIn, kernel_task);
		if (pMemDesc)
		{
			pMemDesc->prepare( kIODirectionOutIn );
			addr64_t PhysAddr = pMemDesc->getPhysicalSegment64(0, NULL);
			IOByteCount length;
			IOPhysicalAddress pp = pMemDesc->getPhysicalSegment(0,&length);
			//bzero(pv,size);
			memset(pv, 1, size);
			IOLog("CHECK CONTIGUOUS VIRT@: 0x%08x PHYS@: 0x%08x VIRT_SIZE:%d PHYS_SIZE:%d \n",pv,pp,size,length);
			for(int i=0;i<=size-10;i++){
				UInt8 tmp = IOMappedRead8(pp+i);
				if(tmp != 1 ){
					IOLog("NON CONTIGUOUS @ 0x%08x\n",pp+i);
					break;
				}
			}
			//IOSleep(1000);

			if (	PhysAddr > 0 &&  PhysAddr <= _4G &&  PhysAddr + size <= _4G)
			{
				//OK
				//pMemDesc->release();
				*dma_handle = pp;
				bzero(pv,size);
				memset(pv, 0, size);
				return pv;
			}
			else
			{
				IOLog("Phy addr not good\n");
			}
			pMemDesc->release();
		}
		IOFreeContiguous(pv, size);
	}
	IOLog("Error\n");
	*dma_handle = NULL;
	return NULL;

}

 

And my log of the Driver is during the alloc of the Rx,Tx,etc:

 

Bad start :
CHECK CONTIGUOUS VIRT@: 0x1aca9000 PHYS@: 0x10190000 VIRT_SIZE:4096 PHYS_SIZE:4096 
CHECK CONTIGUOUS VIRT@: 0x22031000 PHYS@: 0x02de2000 VIRT_SIZE:98304 PHYS_SIZE:98304 
CHECK CONTIGUOUS VIRT@: 0x1acd9000 PHYS@: 0x020d6000 VIRT_SIZE:16384 PHYS_SIZE:16384 
CHECK CONTIGUOUS VIRT@: 0x22049000 PHYS@: 0x02e14000 VIRT_SIZE:98304 PHYS_SIZE:98304 
CHECK CONTIGUOUS VIRT@: 0x1ae5d000 PHYS@: 0x020e4000 VIRT_SIZE:16384 PHYS_SIZE:16384 
CHECK CONTIGUOUS VIRT@: 0x22061000 PHYS@: 0x02e5f000 VIRT_SIZE:98304 PHYS_SIZE:98304 
CHECK CONTIGUOUS VIRT@: 0x1ae89000 PHYS@: 0x0218b000 VIRT_SIZE:16384 PHYS_SIZE:16384 
CHECK CONTIGUOUS VIRT@: 0x22079000 PHYS@: 0x02e95000 VIRT_SIZE:98304 PHYS_SIZE:98304 
CHECK CONTIGUOUS VIRT@: 0x20bd7000 PHYS@: 0x02190000 VIRT_SIZE:16384 PHYS_SIZE:16384 
CHECK CONTIGUOUS VIRT@: 0x20f9b000 PHYS@: 0x021d9000 VIRT_SIZE:16384 PHYS_SIZE:16384 
CHECK CONTIGUOUS VIRT@: 0x21199000 PHYS@: 0x021e2000 VIRT_SIZE:16384 PHYS_SIZE:16384 
CHECK CONTIGUOUS VIRT@: 0x22091000 PHYS@: 0x032d3000 VIRT_SIZE:98304 PHYS_SIZE:98304 
CHECK CONTIGUOUS VIRT@: 0x21839000 PHYS@: 0x02208000 VIRT_SIZE:16384 PHYS_SIZE:16384

 

Good start :
CHECK CONTIGUOUS VIRT@: 0x1aca5000 PHYS@: 0x1a2ef000 VIRT_SIZE:4096 PHYS_SIZE:4096
CHECK CONTIGUOUS VIRT@: 0x21fbc000 PHYS@: 0x02a5c000 VIRT_SIZE:98304 PHYS_SIZE:98304 
CHECK CONTIGUOUS VIRT@: 0x1ad49000 PHYS@: 0x0214c000 VIRT_SIZE:16384 PHYS_SIZE:16384
CHECK CONTIGUOUS VIRT@: 0x21fd4000 PHYS@: 0x040dd000 VIRT_SIZE:98304 PHYS_SIZE:98304
CHECK CONTIGUOUS VIRT@: 0x20aed000 PHYS@: 0x0218b000 VIRT_SIZE:16384 PHYS_SIZE:16384
CHECK CONTIGUOUS VIRT@: 0x21fec000 PHYS@: 0x04124000 VIRT_SIZE:98304 PHYS_SIZE:98304
CHECK CONTIGUOUS VIRT@: 0x20c52000 PHYS@: 0x02190000 VIRT_SIZE:16384 PHYS_SIZE:16384
CHECK CONTIGUOUS VIRT@: 0x22004000 PHYS@: 0x0429f000 VIRT_SIZE:98304 PHYS_SIZE:98304
CHECK CONTIGUOUS VIRT@: 0x21c76000 PHYS@: 0x0219a000 VIRT_SIZE:16384 PHYS_SIZE:16384
CHECK CONTIGUOUS VIRT@: 0x21c7c000 PHYS@: 0x021cc000 VIRT_SIZE:16384 PHYS_SIZE:16384
CHECK CONTIGUOUS VIRT@: 0x21db3000 PHYS@: 0x021d8000 VIRT_SIZE:16384 PHYS_SIZE:16384
CHECK CONTIGUOUS VIRT@: 0x2201c000 PHYS@: 0x04316000 VIRT_SIZE:98304 PHYS_SIZE:98304
CHECK CONTIGUOUS VIRT@: 0x21dbf000 PHYS@: 0x021ee000 VIRT_SIZE:16384 PHYS_SIZE:16384

It's seems that it isn't a problem of contiguousity(?) of the memory.

 

Maybe a problem of position of the queue in the physical space ?

TNW,

you need to setup fTransmitQueue to work (i think this also afects the iwl3945_send_cmd)

this is related to outputPacket()

you also need to handle the interface up/down see enable()/disable(). this is important after the driver gets associated to a network but it's better to write this code now.

all this code is in iwi2200

for IO80211Controller you can take a look at old iwi2200 IO80211Controller version - the code for enable()/disable() is not the same as for a IOEthernetController

 

if you want to get less bugs you should use IOEthernetController code and when the driver is stable you can move to the IO80211Controller version.

 

check some code in iwi3945 - you might want to try this:

 

desc->v_addr = pci_alloc_consistent(pci_dev, desc->len, &desc->p_addr,desc->len); (last desc->len could be a wrong value - try sizeof(__le32*)

 

priv->hw_setting.shared_virt =

pci_alloc_consistent(priv->pci_dev,

sizeof(struct iwl3945_shared*),

&priv->hw_setting.shared_phys,sizeof(struct iwl3945_shared*)); (just add struct *)

 

txq->bd = pci_alloc_consistent(dev,

sizeof(txq->bd[0]) * TFD_QUEUE_SIZE_MAX,

&txq->q.dma_addr,sizeof(struct iwl3945_tfd_frame*)); (sizeof iwl3945_tfd_frame)

 

txq->cmd = pci_alloc_consistent(dev, len, &txq->dma_addr_cmd, sizeof(struct iwl3945_cmd*)); (just add struct *)

 

rxq->bd = pci_alloc_consistent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr,sizeof(__le32*));

 

and maybe change this function to:

 

void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,dma_addr_t *dma_handle,int count) {

//size = RT_ALIGN_Z(size, PAGE_SIZE);

return IOMallocContiguous(size,count, dma_handle);

 

you might have a problem with getPacketBufferConstraints(). looks like the driver need to have the packects aligned in a certain way- i don't know how to deal with this...

you also need getMaxPacketSize(), getMinPacketSize()

 

check darwin_iwi2200::ipw_link_up(). you'll need this when the driver associates to a network

 

iw iwi3945 you should not use CONFIG_IWL3945_QOS. this is not important to make the driver works i've disabled it in iwi2200

 

you'll need to make iwl3945_xxx_station functions to work (mac80211 code). this code starts at ieee80211_register_hw(). looks like stations are the same as ieee->networks in ieee80211 iwi2200 code.

 

you might have some bugs related with skb functions:

skb_reserve() - copy from iwi2200.h

__alloc_skb() set mbuf_len() and mbuf_pkthdr_len() to zero after allocatePacket()

you need to debug this functions - they're very important

 

let me know if any of this help the driver to be more stable

I've finally got the iwi2200 to work with my 2915 on a Dell Inspiron 600m.

 

I have 10.5.2 kalyway installed (10.5.1 with patch to .2) and everything works as far as I can tell (i haven't tried the NIC).

 

nsGUI doesn't work, I run it but nothing happens. but networkselector works fine.

 

nothing worked automatically: after installing iwi2200 10.5 driver it didn't work. I ran the command 'sudo dmesg' which showed that the driver wasn't even loaded. I ran it manually using 'kextload -t /System/Library/Extensions/iwi2200.kext'.

 

once this was done I went to the network configuration screen in control panel and installed (+) the adapter (it finally showed as an option).

 

lastly, networkselector worked to configure the wireless manually.

 

Awesome job and many thanks to all people involved in getting this to work! greatly appreciated.

 

is there a way I can use 802.11a radio? what about 128-bit key? key id has to be 1 or can i use others (1-4 usually)?

 

thanks

Hi ,

 

I've a mission for you ! XD ( That IS a colaborative project =p )

 

I join with this post a version of the driver to test .

 

Your mission , if you accept it , is to test the driver 3 times ,

and you have to give me the result of those 3 tests( dmesg only the last 10 lines ) in a file .

 

Some times the driver is very long to loads (30 sec)

 

Thank's that will help me.

 

[EDIT]: It's a 3945 version.

START_TEST.zip

Hi ,

 

I've a mission for you ! XD ( That IS a colaborative project =p )

 

I join with this post a version of the driver to test .

 

Your mission , if you accept it , is to test the driver 3 times ,

and you have to give me the result of those 3 tests( dmesg only the last 10 lines ) in a file .

 

Some times the driver is very long to loads (30 sec)

 

Thank's that will help me.

 

is it for 2200/2915 or the other cards?

Guest
This topic is now closed to further replies.
×
×
  • Create New...