netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCHv3] drivers/net/usb: Add new driver ipheth
@ 2010-03-31 22:10 Daniel Borca
  0 siblings, 0 replies; 25+ messages in thread
From: Daniel Borca @ 2010-03-31 22:10 UTC (permalink / raw)
  To: Oliver Neukum
  Cc: L. Alberto Giménez, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, linux-usb@vger.kernel.org,
	linville@tuxdriver.com, j.dumon@option.com,
	steve.glendinning@smsc.com, davem@davemloft.net, gregkh@suse.de,
	dgiagio@gmail.com

Hello,

Thanks for the comments.  I've already fixed a few things.  We'll fix the remaining ones (below) ASAP.  

Regards,
Daniel Borca

On 31.03.2010, at 23:33, Oliver Neukum <oliver@neukum.org> wrote:

Am Mittwoch, 31. März 2010 21:42:07 schrieb L. Alberto Giménez:

Hi,

a few comments below.

   Regards
       Oliver

+
+static int ipheth_open(struct net_device *net)
+{
+    struct ipheth_device *dev = netdev_priv(net);
+    struct usb_device *udev = dev->udev;
+    int retval = 0;
+
+    usb_set_interface(udev, IPHETH_INTFNUM, IPHETH_ALT_INTFNUM);
+    usb_clear_halt(udev, usb_rcvbulkpipe(udev, dev->bulk_in));
+    usb_clear_halt(udev, usb_sndbulkpipe(udev, dev->bulk_out));

Is this really needed? If so, please add a comment.

+
+    retval = ipheth_carrier_set(dev);
+    if (retval)
+        goto error;
+
+    retval = ipheth_rx_submit(dev, GFP_KERNEL);
+    if (retval)
+        goto error;
+
+    schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);

Does it make sense to start rx while you have no carrier?

+static int ipheth_tx(struct sk_buff *skb, struct net_device *net)
+{
+    struct ipheth_device *dev = netdev_priv(net);
+    struct usb_device *udev = dev->udev;
+    int retval;
+
+    /* Paranoid */
+    if (skb->len > IPHETH_BUF_SIZE) {
+        err("%s: skb too large: %d bytes", __func__, skb->len);
+        dev->stats.tx_dropped++;
+        dev_kfree_skb_irq(skb);
+        goto exit;
+    }
+
+    memset(dev->tx_buf, 0, IPHETH_BUF_SIZE);
+    memcpy(dev->tx_buf, skb->data, skb->len);

a bit wasteful

+static void ipheth_disconnect(struct usb_interface *intf)
+{
+    struct ipheth_device *dev;
+
+    dev = usb_get_intfdata(intf);
+    if (dev != NULL) {

is this check needed?

+static struct usb_driver ipheth_driver = {
+    .name =        "ipheth",
+    .probe =    ipheth_probe,
+    .disconnect =    ipheth_disconnect,
+    .id_table =    ipheth_table,
+    .supports_autosuspend = 0,

redundant



      

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2010-04-22  5:44 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1269984864-28159-1-git-send-email-agimenez@sysvalve.es>
2010-03-31 19:42 ` [PATCHv3] drivers/net/usb: Add new driver ipheth L. Alberto Giménez
2010-03-31 20:33   ` Oliver Neukum
2010-03-31 21:38     ` "L. Alberto Giménez"
2010-04-02 18:23     ` "L. Alberto Giménez"
2010-04-04  7:24       ` Oliver Neukum
     [not found]         ` <201004040924.43949.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2010-04-05 18:51           ` "L. Alberto Giménez"
2010-03-31 23:18   ` Ben Hutchings
2010-03-31 23:25     ` Greg KH
2010-03-31 23:28       ` Ben Hutchings
2010-04-02 17:15     ` "L. Alberto Giménez"
2010-04-02 17:21       ` Ben Hutchings
2010-04-02 17:53         ` "L. Alberto Giménez"
     [not found]           ` <4BB62F33.1020507-lqZFv/KUvpAxAGwisGp4zA@public.gmane.org>
2010-04-02 18:35             ` Ben Hutchings
2010-04-07 22:11 ` [PATCH Resubmission] " L. Alberto Giménez
2010-04-07 22:37   ` Roland Dreier
     [not found]   ` <1270678281-20750-1-git-send-email-agimenez-lqZFv/KUvpAxAGwisGp4zA@public.gmane.org>
2010-04-08  6:35     ` Oliver Neukum
2010-04-13  8:15   ` David Miller
2010-04-13 19:03     ` "L. Alberto Giménez"
2010-04-13 21:29       ` David Miller
2010-04-15 19:46 ` [PATCH Resubmission v2] " L. Alberto Giménez
2010-04-16  6:44   ` David Miller
     [not found] ` <1269984864-28159-1-git-send-email-agimenez-lqZFv/KUvpAxAGwisGp4zA@public.gmane.org>
2010-04-18 18:35   ` [PATCH] " L. Alberto Giménez
2010-04-21 14:15     ` Diego Giagio
     [not found]       ` <x2g1b0798831004210715h37253bc5y74baf86556aea7c5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-04-22  5:44         ` David Miller
2010-03-31 22:10 [PATCHv3] " Daniel Borca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).