Subversion Repositories Kolibri OS

Rev

Rev 1559 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1559 Rev 1823
Line 8... Line 8...
8
;;  Copyright 2007 mike.dld,                                       ;;
8
;;  Copyright 2007 mike.dld,                                       ;;
9
;;   mike.dld@gmail.com                                            ;;
9
;;   mike.dld@gmail.com                                            ;;
10
;;                                                                 ;;
10
;;                                                                 ;;
11
;;  Version 0.1  11 February 2007                                  ;;
11
;;  Version 0.1  11 February 2007                                  ;;
12
;;  Version 0.2  3 August 2010 - port to net branch by hidnplayr   ;;
12
;;  Version 0.2  3 August 2010 - port to net branch by hidnplayr   ;;
-
 
13
;;  Version 0.3  31 Januari 2011 - bugfixes by hidnplayr           ;;
13
;;                                                                 ;;
14
;;                                                                 ;;
14
;;  References:                                                    ;;
15
;;  References:                                                    ;;
15
;;    r8169.c - linux driver (etherboot project)                   ;;
16
;;    r8169.c - linux driver (etherboot project)                   ;;
16
;;                                                                 ;;
17
;;                                                                 ;;
17
;;          GNU GENERAL PUBLIC LICENSE                             ;;
18
;;          GNU GENERAL PUBLIC LICENSE                             ;;
Line 602... Line 603...
602
	xor	eax, eax
603
	xor	eax, eax
603
	inc	eax
604
	inc	eax
604
	ret
605
	ret
Line 605... Line 606...
605
 
606
 
-
 
607
  .match:
606
  .match:
608
	DEBUGF	1,"init_board: chipset=%u\n", ecx
607
	xor	eax,eax
609
	xor	eax,eax
Line 1039... Line 1041...
1039
 
1041
 
1040
	mov	eax, tx_desc.size
1042
	mov	eax, tx_desc.size
1041
	mul	[tpc.cur_tx]
1043
	mul	[tpc.cur_tx]
Line -... Line 1044...
-
 
1044
	lea	esi, [eax + tx_ring]
-
 
1045
 
1042
	lea	esi, [eax + tx_ring]
1046
	DEBUGF	1,"Using TX desc: %x\n", esi
1043
 
1047
 
Line 1044... Line 1048...
1044
;---------------------------
1048
;---------------------------
1045
; Program the packet pointer
1049
; Program the packet pointer
Line 1138... Line 1142...
1138
 
1142
 
1139
	test	ax, ISB_RxOK
1143
	test	ax, ISB_RxOK
Line 1140... Line 1144...
1140
	jz	.no_rx
1144
	jz	.no_rx
-
 
1145
 
Line 1141... Line 1146...
1141
 
1146
	push	ax
-
 
1147
	push	ebx
-
 
1148
 
1142
	push	ax
1149
  .check_more:
1143
 
1150
	pop	ebx
1144
  .check_more:
1151
	DEBUGF	1,"ebx = 0x%x\n", ebx
Line 1145... Line 1152...
1145
	mov	eax, rx_desc.size
1152
	mov	eax, rx_desc.size
Line 1155... Line 1162...
1155
	DEBUGF	1,"tpc.cur_rx = %u\n", [tpc.cur_rx]
1162
	DEBUGF	1,"tpc.cur_rx = %u\n", [tpc.cur_rx]
Line 1156... Line 1163...
1156
 
1163
 
1157
	test	eax, SD_RxRES
1164
	test	eax, SD_RxRES
Line -... Line 1165...
-
 
1165
	jnz	.rx_return	;;;;; RX error!
1158
	jnz	.rx_return	;;;;; RX error!
1166
 
1159
 
1167
	push	ebx
1160
	push	.check_more
1168
	push	.check_more
1161
	and	eax, 0x00001FFF
1169
	and	eax, 0x00001FFF
1162
	add	eax, -4 			; we dont need CRC
1170
	add	eax, -4 			; we dont need CRC
Line 1218... Line 1226...
1218
 
1226
 
1219
	test	[esi+tx_desc.status], DSB_OWNbit
1227
	test	[esi+tx_desc.status], DSB_OWNbit
Line 1220... Line 1228...
1220
	jnz	.maybenext
1228
	jnz	.maybenext
-
 
1229
 
1221
 
1230
	push	ecx
1222
	push	ecx
1231
	DEBUGF	1,"Freeing up TX desc: %x\n", esi
1223
	stdcall KernelFree, [esi+tx_desc.buf_soft_addr]
1232
	stdcall KernelFree, [esi+tx_desc.buf_soft_addr]
Line 1224... Line 1233...
1224
	pop	ecx
1233
	pop	ecx