Rev 2981 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2981 | Rev 3155 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;; DEC 21x4x driver for KolibriOS ;; |
6 | ;; DEC 21x4x driver for KolibriOS ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; Based on dec21140.Asm from Solar OS by ;; |
8 | ;; Based on dec21140.Asm from Solar OS by ;; |
Line 349... | Line 349... | ||
349 | 349 | ||
350 | cmp eax, 0 ;SRV_GETVERSION |
350 | cmp eax, 0 ;SRV_GETVERSION |
Line 351... | Line 351... | ||
351 | jne @F |
351 | jne @F |
352 | 352 | ||
353 | cmp [IOCTL.out_size], 4 |
353 | cmp [IOCTL.out_size], 4 |
354 | jl .fail |
354 | jb .fail |
Line 355... | Line 355... | ||
355 | mov eax, [IOCTL.output] |
355 | mov eax, [IOCTL.output] |
356 | mov [eax], dword API_VERSION |
356 | mov [eax], dword API_VERSION |
Line 362... | Line 362... | ||
362 | @@: |
362 | @@: |
363 | cmp eax, 1 ;SRV_HOOK |
363 | cmp eax, 1 ;SRV_HOOK |
364 | jne .fail |
364 | jne .fail |
Line 365... | Line 365... | ||
365 | 365 | ||
366 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
366 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
Line 367... | Line 367... | ||
367 | jl .fail |
367 | jb .fail |
368 | 368 | ||
369 | mov eax, [IOCTL.input] |
369 | mov eax, [IOCTL.input] |
Line 388... | Line 388... | ||
388 | 388 | ||
389 | 389 | ||
390 | ; This device doesnt have its own eth_device structure yet, lets create one |
390 | ; This device doesnt have its own eth_device structure yet, lets create one |
391 | .firstdevice: |
391 | .firstdevice: |
Line 392... | Line 392... | ||
392 | cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card |
392 | cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card |
393 | jge .fail |
393 | jae .fail |
394 | 394 | ||
395 | push edx |
395 | push edx |
Line 1083... | Line 1083... | ||
1083 | and [device.tx_rd_des], TX_DES_COUNT-1 |
1083 | and [device.tx_rd_des], TX_DES_COUNT-1 |
Line 1084... | Line 1084... | ||
1084 | 1084 | ||
1085 | ; inc free desc |
1085 | ; inc free desc |
1086 | inc [device.tx_free_des] |
1086 | inc [device.tx_free_des] |
1087 | cmp [device.tx_free_des], TX_DES_COUNT |
1087 | cmp [device.tx_free_des], TX_DES_COUNT |
1088 | jle @f |
1088 | jbe @f |
1089 | mov [device.tx_free_des], TX_DES_COUNT |
1089 | mov [device.tx_free_des], TX_DES_COUNT |
Line 1090... | Line 1090... | ||
1090 | @@: |
1090 | @@: |
1091 | 1091 | ||
Line 1237... | Line 1237... | ||
1237 | call SROM_Read_Word |
1237 | call SROM_Read_Word |
1238 | pop edi esi |
1238 | pop edi esi |
1239 | stosw |
1239 | stosw |
1240 | inc esi |
1240 | inc esi |
1241 | cmp esi, 26/2 |
1241 | cmp esi, 26/2 |
1242 | jl .loop |
1242 | jb .loop |
Line 1243... | Line 1243... | ||
1243 | 1243 | ||
Line 1244... | Line 1244... | ||
1244 | DEBUGF 2,"%x-%x-%x-%x-%x-%x\n",[edi-6]:2,[edi-5]:2,[edi-4]:2,[edi-3]:2,[edi-2]:2,[edi-1]:2 |
1244 | DEBUGF 2,"%x-%x-%x-%x-%x-%x\n",[edi-6]:2,[edi-5]:2,[edi-4]:2,[edi-3]:2,[edi-2]:2,[edi-1]:2 |
Line 1295... | Line 1295... | ||
1295 | Bit_Clear CSR9_SROM_CK |
1295 | Bit_Clear CSR9_SROM_CK |
1296 | SROM_Delay |
1296 | SROM_Delay |
Line 1297... | Line 1297... | ||
1297 | 1297 | ||
1298 | inc ecx |
1298 | inc ecx |
1299 | cmp ecx, 12 |
1299 | cmp ecx, 12 |
1300 | jle .loop2 |
1300 | jbe .loop2 |
Line 1301... | Line 1301... | ||
1301 | .end_loop2: |
1301 | .end_loop2: |
Line 1302... | Line 1302... | ||
1302 | 1302 |