All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anders Blomdell <anders.blomdell@control.lth.se>
To: "Xenomai@xenomai.org" <Xenomai@xenomai.org>
Subject: [Xenomai] xenomai-3/next: modprobe rtpacket fails with -EINVAL
Date: Thu, 05 Feb 2015 12:15:22 +0100	[thread overview]
Message-ID: <54D350CA.90801@control.lth.se> (raw)

AFAICT there are two ways to fix it, either change kernel/cobalt/rtdm/device.c:

       if (drv->device_count <= 0)
                return -EINVAL;
to:
       if (drv->device_count <= 0 ||
	   (drv->device_count == 0 && 
	    (drv->device_flags & RTDM_DEVICE_TYPE_MASK) != RTDM_PROTOCOL_DEVICE)))
                return -EINVAL;    

or change kernel/drivers/net/stack/packet/af_packet.c:

  static struct rtdm_driver packet_proto_drv = {
    .profile_info =     RTDM_PROFILE_INFO(packet,
                                        RTDM_CLASS_NETWORK,
                                        RTDM_SUBCLASS_RTNET,
                                        RTNET_RTDM_VER),
    .device_flags =     RTDM_PROTOCOL_DEVICE,
    .context_size =     sizeof(struct rtsocket),
    ...
  }

to:

  static struct rtdm_driver packet_proto_drv = {
    .profile_info =     RTDM_PROFILE_INFO(packet,
                                        RTDM_CLASS_NETWORK,
                                        RTDM_SUBCLASS_RTNET,
                                        RTNET_RTDM_VER),
    .device_flags =     RTDM_PROTOCOL_DEVICE,
    .device_count =     1,
    .context_size =     sizeof(struct rtsocket),
    ...
  }

Since the second change is what 'rtdm_driver raw_packet_proto_drv', and the code looks
prettier, I guess that the second way is the preferred one?

/Anders
-- 
Anders Blomdell                  Email: anders.blomdell@control.lth.se
Department of Automatic Control
Lund University                  Phone:    +46 46 222 4625
P.O. Box 118                     Fax:      +46 46 138118
SE-221 00 Lund, Sweden



             reply	other threads:[~2015-02-05 11:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 11:15 Anders Blomdell [this message]
2015-02-05 11:50 ` [Xenomai] xenomai-3/next: modprobe rtpacket fails with -EINVAL Gilles Chanteperdrix
2015-02-05 13:59   ` Anders Blomdell
2015-02-05 14:03     ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54D350CA.90801@control.lth.se \
    --to=anders.blomdell@control.lth.se \
    --cc=Xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.