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 | ;; PCnet driver for KolibriOS ;; |
6 | ;; PCnet driver for KolibriOS ;; |
7 | ;; ;; |
7 | ;; ;; |
8 | ;; By hidnplayr & clevermouse ;; |
8 | ;; By hidnplayr & clevermouse ;; |
Line 12... | Line 12... | ||
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
12 | ;; GNU GENERAL PUBLIC LICENSE ;; |
13 | ;; Version 2, June 1991 ;; |
13 | ;; Version 2, June 1991 ;; |
14 | ;; ;; |
14 | ;; ;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
15 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 16... | Line 16... | ||
16 | 16 | ||
Line 17... | Line 17... | ||
17 | ; $Revision: 2981 $ |
17 | $Revision: 3155 $ |
Line 18... | Line 18... | ||
18 | 18 | ||
Line 363... | Line 363... | ||
363 | cmp [state], 1 |
363 | cmp [state], 1 |
364 | jne .exit |
364 | jne .exit |
Line 365... | Line 365... | ||
365 | 365 | ||
Line 366... | Line 366... | ||
366 | .entry: |
366 | .entry: |
367 | 367 | ||
368 | DEBUGF 1,"Loading PCnet driver\n" |
368 | DEBUGF 1,"Loading %s driver\n", my_service |
Line 369... | Line 369... | ||
369 | stdcall RegService, my_service, service_proc |
369 | stdcall RegService, my_service, service_proc |
370 | ret |
370 | ret |
Line 394... | Line 394... | ||
394 | 394 | ||
395 | cmp eax, 0 ;SRV_GETVERSION |
395 | cmp eax, 0 ;SRV_GETVERSION |
Line 396... | Line 396... | ||
396 | jne @F |
396 | jne @F |
397 | 397 | ||
398 | cmp [IOCTL.out_size], 4 |
398 | cmp [IOCTL.out_size], 4 |
399 | jl .fail |
399 | jb .fail |
Line 400... | Line 400... | ||
400 | mov eax, [IOCTL.output] |
400 | mov eax, [IOCTL.output] |
401 | mov [eax], dword API_VERSION |
401 | mov [eax], dword API_VERSION |
Line 407... | Line 407... | ||
407 | @@: |
407 | @@: |
408 | cmp eax, 1 ;SRV_HOOK |
408 | cmp eax, 1 ;SRV_HOOK |
409 | jne .fail |
409 | jne .fail |
Line 410... | Line 410... | ||
410 | 410 | ||
411 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
411 | cmp [IOCTL.inp_size], 3 ; Data input must be at least 3 bytes |
Line 412... | Line 412... | ||
412 | jl .fail |
412 | jb .fail |
413 | 413 | ||
414 | mov eax, [IOCTL.input] |
414 | mov eax, [IOCTL.input] |
Line 433... | Line 433... | ||
433 | 433 | ||
Line 434... | Line 434... | ||
434 | ; This device doesnt have its own eth_device structure yet, lets create one |
434 | ; This device doesnt have its own eth_device structure yet, lets create one |
435 | 435 | ||
436 | .firstdevice: |
436 | .firstdevice: |
Line 437... | Line 437... | ||
437 | cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card |
437 | cmp [devices], MAX_DEVICES ; First check if the driver can handle one more card |
Line 438... | Line 438... | ||
438 | jge .fail |
438 | jae .fail |
Line 953... | Line 953... | ||
953 | [eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\ |
953 | [eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\ |
954 | [eax+06]:2,[eax+07]:2,[eax+08]:2,[eax+09]:2,[eax+10]:2,[eax+11]:2,\ |
954 | [eax+06]:2,[eax+07]:2,[eax+08]:2,[eax+09]:2,[eax+10]:2,[eax+11]:2,\ |
955 | [eax+13]:2,[eax+12]:2 |
955 | [eax+13]:2,[eax+12]:2 |
Line 956... | Line 956... | ||
956 | 956 | ||
957 | cmp dword [esp+8], 1514 |
957 | cmp dword [esp+8], 1514 |
958 | jg .nospace ; packet is too long |
958 | ja .nospace ; packet is too long |
959 | cmp dword [esp+8], 60 |
959 | cmp dword [esp+8], 60 |
Line 960... | Line 960... | ||
960 | jl .nospace ; packet is too short |
960 | jb .nospace ; packet is too short |
961 | 961 | ||
962 | ; check descriptor |
962 | ; check descriptor |
963 | movzx eax, [device.cur_tx] |
963 | movzx eax, [device.cur_tx] |
Line 1159... | Line 1159... | ||
1159 | pop ax |
1159 | pop ax |
1160 | call [device.access_write_csr] |
1160 | call [device.access_write_csr] |
1161 | DEBUGF 1,"." |
1161 | DEBUGF 1,"." |
1162 | inc ecx |
1162 | inc ecx |
1163 | cmp ecx, PCNET_CSR_PAR2 |
1163 | cmp ecx, PCNET_CSR_PAR2 |
1164 | jl @r |
1164 | jb @r |
Line 1165... | Line 1165... | ||
1165 | 1165 | ||
Line 1166... | Line 1166... | ||
1166 | DEBUGF 1,"\n" |
1166 | DEBUGF 1,"\n" |
Line 1183... | Line 1183... | ||
1183 | dec dx |
1183 | dec dx |
1184 | in ax, dx |
1184 | in ax, dx |
1185 | push ax |
1185 | push ax |
1186 | DEBUGF 1,"." |
1186 | DEBUGF 1,"." |
1187 | cmp edx, [device.io_addr] |
1187 | cmp edx, [device.io_addr] |
1188 | jg @r |
1188 | ja @r |
Line 1189... | Line 1189... | ||
1189 | 1189 | ||
Line 1190... | Line 1190... | ||
1190 | DEBUGF 1," %x-%x-%x-%x-%x-%x\n",[esp+0]:2,[esp+1]:2,[esp+2]:2,[esp+3]:2,[esp+4]:2,[esp+5]:2 |
1190 | DEBUGF 1," %x-%x-%x-%x-%x-%x\n",[esp+0]:2,[esp+1]:2,[esp+2]:2,[esp+3]:2,[esp+4]:2,[esp+5]:2 |
1191 | 1191 |