[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ygfbqbf14j0.fsf@janus.isnogud.escape.de>
Date: 04 Oct 2007 13:51:47 +0200
From: Urs Thuermann <urs@...ogud.escape.de>
To: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Cc: netdev@...r.kernel.org, David Miller <davem@...emloft.net>,
Patrick McHardy <kaber@...sh.net>,
Thomas Gleixner <tglx@...utronix.de>,
Oliver Hartkopp <oliver@...tkopp.net>,
Oliver Hartkopp <oliver.hartkopp@...kswagen.de>
Subject: Re: [PATCH 2/7] CAN: Add PF_CAN core module
Arnaldo Carvalho de Melo <acme@...stprotocols.net> writes:
> > +struct sockaddr_can {
> > + sa_family_t can_family;
> > + int can_ifindex;
> > + union {
> > + struct { canid_t rx_id, tx_id; } tp16;
> > + struct { canid_t rx_id, tx_id; } tp20;
> > + struct { canid_t rx_id, tx_id; } mcnet;
> > + struct { canid_t rx_id, tx_id; } isotp;
> > + } can_addr;
>
> Again being curious, what is the value of this union of all its members
> have the same definition? Backward source code compatibility?
As Oliver already wrote, different CAN transport protocols may use
different sockaddr structures. Therefore, we have made can_addr a
union. The four we have defined already, all look the same, but
other, future protocols may define a different structure.
> > +struct can_proto {
> > + int type;
> > + int protocol;
> > + int capability;
> > + struct proto_ops *ops;
> > + struct proto *prot;
> > +};
> > +
> > +/* function prototypes for the CAN networklayer core (af_can.c) */
> > +
> > +extern int can_proto_register(struct can_proto *cp);
> > +extern void can_proto_unregister(struct can_proto *cp);
>
> We have proto registering infrastructure for bluetooth, inet and now
> CAN, have you looked at:
>
> struct inet_protosw;
> proto_{register,unregister}, etc?
Yes, I know inet_protosw and inet_{,un}register_protosw(). But we
can't use inet_register_protosw().
And can_proto_register() does use proto_register(). What exactly do
you want to suggest?
urs
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists