I did some cleanups in the code today. I also implemented tg3_close() and tg3_remove_one(). Those were the last two missing functions and implementing them resulted in a successful first boot of the driver :).
More cleanups. Removed most of the out-commented code that was left in the driver and some other simplifications. While going through the code I also compiled a list of suspicious looking things that I want to revisit the coming days.
Not much coding today, but a lot of testing. Tested the driver with all 4 test cards I have available, testing:
Interrupt support is not fully implemented yet, so UNDI chainloading tests were saved for later. Will see if I can get ahold of a Symantec Ghost DOS disk to stresstest the UNDI/interrupt support.
I was doing all that testing in Vienna and unfortunately forgot one test card there, so I only have 3 cards to test until the next time I get to Vienna(Probably next week).
I moved kicking off autoneg to tg3_init_one() from tg3_open(). This results in the BANNER_TIMEOUT being used for auto negotiation, which should save a few seconds boot time, as autoneg can take up to 6 seconds to complete. struct tg3_napi was also removed and its fields merged into struct tg3.
Moved programming of the MAC address to tg3_open() instead of tg3_init_one(), as dictated by the gPXE API specifications. Also removed was the NIC stats block, which saves some heap memory. I also removed more leftover code.
A little interrupt related work. Completely untested and I still have to clear up some uncertainty on my side about tagged irq status, especially tp→last_tag.