Subversion Repositories Kolibri OS

Rev

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

Rev 1557 Rev 1558
Line 709... Line 709...
709
	mov	[tpc.RxDescArray], eax
709
	mov	[tpc.RxDescArray], eax
Line 710... Line 710...
710
 
710
 
711
	call	init_ring
711
	call	init_ring
Line -... Line 712...
-
 
712
	call	hw_start
-
 
713
 
-
 
714
; clear packet/byte counters
-
 
715
 
-
 
716
	xor	eax, eax
-
 
717
	lea	edi, [device.bytes_tx]
-
 
718
	mov	ecx, 6
712
	call	hw_start
719
	rep	stosd
Line 713... Line 720...
713
 
720
 
714
	mov	[device.mtu], 1500
721
	mov	[device.mtu], 1500
Line 1050... Line 1057...
1050
	cmp	[tpc.cur_tx], NUM_TX_DESC - 1
1057
	cmp	[tpc.cur_tx], NUM_TX_DESC - 1
1051
	jne	@f
1058
	jne	@f
1052
	or	eax, DSB_EORbit
1059
	or	eax, DSB_EORbit
1053
    @@: mov	[esi + tx_desc.status], eax
1060
    @@: mov	[esi + tx_desc.status], eax
Line 1054... Line 1061...
1054
 
1061
 
1055
;----------------------------------------
1062
;-----------------------------------------
Line 1056... Line 1063...
1056
; Set the polling bit (start transmission
1063
; Set the polling bit (start transmission)
1057
 
1064
 
1058
	set_io	0
1065
	set_io	0
1059
	set_io	REG_TxPoll
1066
	set_io	REG_TxPoll
Line 1063... Line 1070...
1063
;-----------------------
1070
;-----------------------
1064
; Update TX descriptor
1071
; Update TX descriptor
Line 1065... Line 1072...
1065
 
1072
 
1066
	inc	[tpc.cur_tx]
1073
	inc	[tpc.cur_tx]
-
 
1074
	and	[tpc.cur_tx], NUM_TX_DESC - 1
-
 
1075
 
-
 
1076
;-------------
-
 
1077
; Update stats
-
 
1078
 
-
 
1079
	inc	[device.packets_tx]
-
 
1080
	mov	eax, [esp+8]
-
 
1081
	add	dword [device.bytes_tx], eax
-
 
1082
	adc	dword [device.bytes_tx + 4], 0
1067
	and	[tpc.cur_tx], NUM_TX_DESC - 1
1083
 
Line 1068... Line 1084...
1068
	ret	8
1084
	ret	8
1069
 
1085
 
1070
  .fail:
1086
  .fail:
Line 1144... Line 1160...
1144
	and	eax, 0x00001FFF
1160
	and	eax, 0x00001FFF
1145
	add	eax, -4 			; we dont need CRC
1161
	add	eax, -4 			; we dont need CRC
1146
	push	eax
1162
	push	eax
1147
	DEBUGF	1,"data length = %u\n", ax
1163
	DEBUGF	1,"data length = %u\n", ax
Line -... Line 1164...
-
 
1164
 
-
 
1165
;-------------
-
 
1166
; Update stats
-
 
1167
	add	dword [device.bytes_rx], eax
-
 
1168
	adc	dword [device.bytes_rx + 4], 0
-
 
1169
	inc	dword [device.packets_rx]
1148
 
1170
 
Line 1149... Line 1171...
1149
	push	[esi + rx_desc.buf_soft_addr]
1171
	push	[esi + rx_desc.buf_soft_addr]
1150
 
1172
 
Line 1183... Line 1205...
1183
	test	ax, ISB_TxOK
1205
	test	ax, ISB_TxOK
1184
	jz	.no_tx
1206
	jz	.no_tx
1185
	push	ax
1207
	push	ax
Line 1186... Line 1208...
1186
 
1208
 
-
 
1209
	DEBUGF	1,"TX ok!\n"
-
 
1210
 
-
 
1211
	mov	ecx, NUM_TX_DESC
-
 
1212
	lea	esi, [device.tx_ring]
-
 
1213
  .txloop:
-
 
1214
	cmp	[esi+tx_desc.buf_soft_addr], 0
-
 
1215
	jz	.maybenext
-
 
1216
 
-
 
1217
	test	[esi+tx_desc.status], DSB_OWNbit
-
 
1218
	jnz	.maybenext
-
 
1219
 
-
 
1220
	push	ecx
-
 
1221
	stdcall KernelFree, [esi+tx_desc.buf_soft_addr]
-
 
1222
	pop	ecx
-
 
1223
	and	[esi+tx_desc.buf_soft_addr], 0
-
 
1224
 
1187
	DEBUGF	1,"TX ok!\n"
1225
  .maybenext:
-
 
1226
	add	esi, tx_desc.size
-
 
1227
	dec	ecx
Line 1188... Line 1228...
1188
	; TODO: free buffers
1228
	jnz	.txloop
1189
 
1229
 
Line 1190... Line 1230...
1190
	pop	ax
1230
	pop	ax
Line 1239... Line 1279...
1239
  0x10000000, MCFG_METHOD_04, \
1279
  0x10000000, MCFG_METHOD_04, \
1240
  0x04000000, MCFG_METHOD_03, \
1280
  0x04000000, MCFG_METHOD_03, \
1241
  0x00800000, MCFG_METHOD_02, \
1281
  0x00800000, MCFG_METHOD_02, \
1242
  0x00000000, MCFG_METHOD_01	; catch-all
1282
  0x00000000, MCFG_METHOD_01	; catch-all
Line -... Line 1283...
-
 
1283
 
-
 
1284
name_01 	db "RTL8169", 0
-
 
1285
name_02_03	db "RTL8169s/8110s", 0
-
 
1286
name_04 	db "RTL8169sb/8110sb", 0
-
 
1287
name_05 	db "RTL8169sc/8110sc", 0
-
 
1288
name_11_12	db "RTL8168b/8111b", 0	; PCI-E
-
 
1289
name_13 	db "RTL8101e", 0	; PCI-E 8139
-
 
1290
name_14_15	db "RTL8100e", 0	; PCI-E 8139
-
 
1291
 
1243
 
1292
 
Line 1244... Line 1293...
1244
section '.data' data readable writable align 16 ; place all uninitialized data place here
1293
section '.data' data readable writable align 16 ; place all uninitialized data place here