Pārlūkot izejas kodu

[smsc75xx] Expose functionality shared with LAN78xx devices

The LAN78xx datapath is essentially identical to that of the SMSC75xx.
Expose the transmit, poll, and bulk IN endpoint operations to allow
for reuse by the LAN78xx driver.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 6 gadus atpakaļ
vecāks
revīzija
1ee7f4e036
2 mainītis faili ar 13 papildinājumiem un 6 dzēšanām
  1. 6
    6
      src/drivers/net/smsc75xx.c
  2. 7
    0
      src/drivers/net/smsc75xx.h

+ 6
- 6
src/drivers/net/smsc75xx.c Parādīt failu

60
  * @v smscusb		SMSC USB device
60
  * @v smscusb		SMSC USB device
61
  * @ret rc		Return status code
61
  * @ret rc		Return status code
62
  */
62
  */
63
-static int smsc75xx_dump_statistics ( struct smscusb_device *smscusb ) {
63
+int smsc75xx_dump_statistics ( struct smscusb_device *smscusb ) {
64
 	struct smsc75xx_statistics stats;
64
 	struct smsc75xx_statistics stats;
65
 	int rc;
65
 	int rc;
66
 
66
 
230
 }
230
 }
231
 
231
 
232
 /** Bulk IN endpoint operations */
232
 /** Bulk IN endpoint operations */
233
-static struct usb_endpoint_driver_operations smsc75xx_in_operations = {
233
+struct usb_endpoint_driver_operations smsc75xx_in_operations = {
234
 	.complete = smsc75xx_in_complete,
234
 	.complete = smsc75xx_in_complete,
235
 };
235
 };
236
 
236
 
386
 	usbnet_close ( &smscusb->usbnet );
386
 	usbnet_close ( &smscusb->usbnet );
387
 
387
 
388
 	/* Dump statistics (for debugging) */
388
 	/* Dump statistics (for debugging) */
389
-	smsc75xx_dump_statistics ( smscusb );
389
+	if ( DBG_LOG )
390
+		smsc75xx_dump_statistics ( smscusb );
390
 
391
 
391
 	/* Reset device */
392
 	/* Reset device */
392
 	smsc75xx_reset ( smscusb );
393
 	smsc75xx_reset ( smscusb );
399
  * @v iobuf		I/O buffer
400
  * @v iobuf		I/O buffer
400
  * @ret rc		Return status code
401
  * @ret rc		Return status code
401
  */
402
  */
402
-static int smsc75xx_transmit ( struct net_device *netdev,
403
-			       struct io_buffer *iobuf ) {
403
+int smsc75xx_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) {
404
 	struct smscusb_device *smscusb = netdev->priv;
404
 	struct smscusb_device *smscusb = netdev->priv;
405
 	int rc;
405
 	int rc;
406
 
406
 
416
  *
416
  *
417
  * @v netdev		Network device
417
  * @v netdev		Network device
418
  */
418
  */
419
-static void smsc75xx_poll ( struct net_device *netdev ) {
419
+void smsc75xx_poll ( struct net_device *netdev ) {
420
 	struct smscusb_device *smscusb = netdev->priv;
420
 	struct smscusb_device *smscusb = netdev->priv;
421
 	uint32_t int_sts;
421
 	uint32_t int_sts;
422
 	int rc;
422
 	int rc;

+ 7
- 0
src/drivers/net/smsc75xx.h Parādīt failu

213
 	( sizeof ( struct smsc75xx_rx_header ) +		\
213
 	( sizeof ( struct smsc75xx_rx_header ) +		\
214
 	  ETH_FRAME_LEN + 4 /* possible VLAN header */ )
214
 	  ETH_FRAME_LEN + 4 /* possible VLAN header */ )
215
 
215
 
216
+extern struct usb_endpoint_driver_operations smsc75xx_in_operations;
217
+
218
+extern int smsc75xx_dump_statistics ( struct smscusb_device *smscusb );
219
+extern int smsc75xx_transmit ( struct net_device *netdev,
220
+			       struct io_buffer *iobuf );
221
+extern void smsc75xx_poll ( struct net_device *netdev );
222
+
216
 #endif /* _SMSC75XX_H */
223
 #endif /* _SMSC75XX_H */

Notiek ielāde…
Atcelt
Saglabāt