]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[smsc75xx] Expose functionality shared with LAN78xx devices
authorMichael Brown <mcb30@ipxe.org>
Fri, 7 Jul 2017 16:25:37 +0000 (17:25 +0100)
committerMichael Brown <mcb30@ipxe.org>
Mon, 10 Jul 2017 11:41:23 +0000 (12:41 +0100)
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>
src/drivers/net/smsc75xx.c
src/drivers/net/smsc75xx.h

index 0da255c209801ea39e69e173e8897f40d33ca58b..861669edf57594df2d0c34d2ee13ff9f4a7222f4 100644 (file)
@@ -60,7 +60,7 @@ static struct profiler smsc75xx_out_profiler __profiler =
  * @v smscusb          SMSC USB device
  * @ret rc             Return status code
  */
-static int smsc75xx_dump_statistics ( struct smscusb_device *smscusb ) {
+int smsc75xx_dump_statistics ( struct smscusb_device *smscusb ) {
        struct smsc75xx_statistics stats;
        int rc;
 
@@ -230,7 +230,7 @@ static void smsc75xx_in_complete ( struct usb_endpoint *ep,
 }
 
 /** Bulk IN endpoint operations */
-static struct usb_endpoint_driver_operations smsc75xx_in_operations = {
+struct usb_endpoint_driver_operations smsc75xx_in_operations = {
        .complete = smsc75xx_in_complete,
 };
 
@@ -386,7 +386,8 @@ static void smsc75xx_close ( struct net_device *netdev ) {
        usbnet_close ( &smscusb->usbnet );
 
        /* Dump statistics (for debugging) */
-       smsc75xx_dump_statistics ( smscusb );
+       if ( DBG_LOG )
+               smsc75xx_dump_statistics ( smscusb );
 
        /* Reset device */
        smsc75xx_reset ( smscusb );
@@ -399,8 +400,7 @@ static void smsc75xx_close ( struct net_device *netdev ) {
  * @v iobuf            I/O buffer
  * @ret rc             Return status code
  */
-static int smsc75xx_transmit ( struct net_device *netdev,
-                              struct io_buffer *iobuf ) {
+int smsc75xx_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) {
        struct smscusb_device *smscusb = netdev->priv;
        int rc;
 
@@ -416,7 +416,7 @@ static int smsc75xx_transmit ( struct net_device *netdev,
  *
  * @v netdev           Network device
  */
-static void smsc75xx_poll ( struct net_device *netdev ) {
+void smsc75xx_poll ( struct net_device *netdev ) {
        struct smscusb_device *smscusb = netdev->priv;
        uint32_t int_sts;
        int rc;
index f8bcefb785ae6df5d6cc9a7e27f568105f992ba2..72339df037d83d34ad98058e7e2a1c812240a554 100644 (file)
@@ -213,4 +213,11 @@ struct smsc75xx_statistics {
        ( sizeof ( struct smsc75xx_rx_header ) +                \
          ETH_FRAME_LEN + 4 /* possible VLAN header */ )
 
+extern struct usb_endpoint_driver_operations smsc75xx_in_operations;
+
+extern int smsc75xx_dump_statistics ( struct smscusb_device *smscusb );
+extern int smsc75xx_transmit ( struct net_device *netdev,
+                              struct io_buffer *iobuf );
+extern void smsc75xx_poll ( struct net_device *netdev );
+
 #endif /* _SMSC75XX_H */