All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] xenomai-3/next: modprobe rtpacket fails with -EINVAL
@ 2015-02-05 11:15 Anders Blomdell
  2015-02-05 11:50 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Anders Blomdell @ 2015-02-05 11:15 UTC (permalink / raw)
  To: Xenomai@xenomai.org

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



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

end of thread, other threads:[~2015-02-05 14:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 11:15 [Xenomai] xenomai-3/next: modprobe rtpacket fails with -EINVAL Anders Blomdell
2015-02-05 11:50 ` Gilles Chanteperdrix
2015-02-05 13:59   ` Anders Blomdell
2015-02-05 14:03     ` Gilles Chanteperdrix

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.