Browse Source

[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 years ago
parent
commit
1ee7f4e036
2 changed files with 13 additions and 6 deletions
  1. 6
    6
      src/drivers/net/smsc75xx.c
  2. 7
    0
      src/drivers/net/smsc75xx.h

+ 6
- 6
src/drivers/net/smsc75xx.c View File

@@ -60,7 +60,7 @@ static struct profiler smsc75xx_out_profiler __profiler =
60 60
  * @v smscusb		SMSC USB device
61 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 64
 	struct smsc75xx_statistics stats;
65 65
 	int rc;
66 66
 
@@ -230,7 +230,7 @@ static void smsc75xx_in_complete ( struct usb_endpoint *ep,
230 230
 }
231 231
 
232 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 234
 	.complete = smsc75xx_in_complete,
235 235
 };
236 236
 
@@ -386,7 +386,8 @@ static void smsc75xx_close ( struct net_device *netdev ) {
386 386
 	usbnet_close ( &smscusb->usbnet );
387 387
 
388 388
 	/* Dump statistics (for debugging) */
389
-	smsc75xx_dump_statistics ( smscusb );
389
+	if ( DBG_LOG )
390
+		smsc75xx_dump_statistics ( smscusb );
390 391
 
391 392
 	/* Reset device */
392 393
 	smsc75xx_reset ( smscusb );
@@ -399,8 +400,7 @@ static void smsc75xx_close ( struct net_device *netdev ) {
399 400
  * @v iobuf		I/O buffer
400 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 404
 	struct smscusb_device *smscusb = netdev->priv;
405 405
 	int rc;
406 406
 
@@ -416,7 +416,7 @@ static int smsc75xx_transmit ( struct net_device *netdev,
416 416
  *
417 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 420
 	struct smscusb_device *smscusb = netdev->priv;
421 421
 	uint32_t int_sts;
422 422
 	int rc;

+ 7
- 0
src/drivers/net/smsc75xx.h View File

@@ -213,4 +213,11 @@ struct smsc75xx_statistics {
213 213
 	( sizeof ( struct smsc75xx_rx_header ) +		\
214 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 223
 #endif /* _SMSC75XX_H */

Loading…
Cancel
Save