ngatm: patch missing

Harti Brandt <[email protected]> Sun, 9 Feb 2003 17:35:06 +0100 (CET)
Newsgroups gmane.os.freebsd.devel.atm
Message-ID <[email protected]>
Hi all,

I fogot to update the patch to if_atmsubr.c when packing the tar files.
The updated patch is needed for the HARP pseudo interface to work.
Patch attached.

Regards,
harti
-- 
harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private
              [email protected], [email protected]
sys_net.patch (text/plain, 5.3 KB)
Index: sys/net/if_atm.h
===================================================================
RCS file: /home/ncvs/src/sys/net/if_atm.h,v
retrieving revision 1.5
diff -r1.5 if_atm.h
101a102,104
> void	atm_ifdetach(struct ifnet *);
> void	atm_ifattach1(struct ifnet *);
> void	atm_ifdetach1(struct ifnet *);
106d108
< #endif
107a110,115
> # define ATM_MSG_FLOW_CONTROL	0x0001	/* arg is (dis << 24) | ((vpi << 16) | vci) */
> # define ATM_MSG_CARRIER_CHANGE	0x0002	/* arg is carrier status 0 or 1*/
> # define ATM_MSG_VCC_CHANGED	0x0003	/* arg is (state << 24) | (vpi << 16) | vci */
> 
> void	atm_message(struct ifnet *, u_int32_t, u_int32_t);
> #endif
Index: sys/net/if_atmsubr.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_atmsubr.c,v
retrieving revision 1.19
diff -r1.19 if_atmsubr.c
70a71,85
> void	(*ng_atm_attach_p)(struct ifnet *);
> void	(*ng_atm_detach_p)(struct ifnet *);
> int	(*ng_atm_output_p)(struct ifnet *, struct mbuf **);
> void	(*ng_atm_input_p)(struct ifnet *, struct mbuf **,
> 	    struct atm_pseudohdr *, void *);
> void	(*ng_atm_input_orphan_p)(struct ifnet *, struct mbuf *,
> 	    struct atm_pseudohdr *, void *);
> void	(*ng_atm_message_p)(struct ifnet *, u_int32_t, u_int32_t);
> 
> /* Harp pseudo interface hooks */
> void	(*atm_harp_input_p)(struct ifnet *ifp, struct mbuf **m,
> 	    struct atm_pseudohdr *ah, void *rxhand);
> void	(*atm_harp_attach_p)(struct ifnet *);
> void	(*atm_harp_detach_p)(struct ifnet *);
> 
209a225,234
> 	if (ng_atm_output_p != NULL) {
> 		if ((error = (*ng_atm_output_p)(ifp, &m)) != 0) {
> 			if (m != NULL)
> 				m_freem(m);
> 			return (error);
> 		}
> 		if (m == NULL)
> 			return (0);
> 	}
> 
247a273,285
> 	if (ng_atm_input_p != NULL) {
> 		(*ng_atm_input_p)(ifp, &m, ah, rxhand);
> 		if (m == NULL)
> 			return;
> 	}
> 
> 	/* not eaten by ng_atm. Maybe it's a pseudo-harp PDU? */
> 	if (atm_harp_input_p != NULL) {
> 		(*atm_harp_input_p)(ifp, &m, ah, rxhand);
> 		if (m == NULL)
> 			return;
> 	}
> 
257a296
> /*
259,260c298,299
< 		m_freem(m);
< 		return;
---
> */
> 		goto dropit;
277,278c316,318
< 				printf("%s%d: recv'd invalid LLC/SNAP frame [vp=%d,vc=%d]\n",
< 				       ifp->if_name, ifp->if_unit, ATM_PH_VPI(ah), ATM_PH_VCI(ah));
---
> 				printf("%s%d: recv'd invalid LLC/SNAP frame [vp=%d,vc=%d]: %8D\n",
> 				    ifp->if_name, ifp->if_unit, ATM_PH_VPI(ah), ATM_PH_VCI(ah),
> 				    mtod(m, u_char *), ":");
301c341,347
< 			m_freem(m);
---
> #ifndef NATM
>   dropit:
> #endif
> 			if (ng_atm_input_orphan_p != NULL)
> 				(*ng_atm_input_orphan_p)(ifp, m, ah, rxhand);
> 			else
> 				m_freem(m);
346a393,426
> }
> 
> void
> atm_ifdetach(ifp)
> 	register struct ifnet *ifp;
> {
> 
> }
> 
> void
> atm_ifattach1(struct ifnet *ifp)
> {
> 	atm_ifattach(ifp);
> 	if(ng_atm_attach_p)
> 		(*ng_atm_attach_p)(ifp);
> 	if (atm_harp_attach_p)
> 		(*atm_harp_attach_p)(ifp);
> }
> 
> void
> atm_ifdetach1(struct ifnet *ifp)
> {
> 	if (atm_harp_detach_p)
> 		(*atm_harp_detach_p)(ifp);
> 	if(ng_atm_detach_p)
> 		(*ng_atm_detach_p)(ifp);
> 	atm_ifdetach(ifp);
> }
> 
> void
> atm_message(struct ifnet *ifp, u_int32_t msg, u_int32_t arg)
> {
> 	if(ng_atm_message_p)
> 		(*ng_atm_message_p)(ifp, msg, arg);
Index: sys/net/if_media.h
===================================================================
RCS file: /home/ncvs/src/sys/net/if_media.h,v
retrieving revision 1.18
diff -r1.18 if_media.h
170a171,184
>  * ATM
>  */
> #define IFM_ATM	0x000000a0
> #define IFM_ATM_TAXI_100	3
> #define IFM_ATM_TAXI_140	4
> #define IFM_ATM_MM_OC3		5
> #define IFM_ATM_SM_OC3		6
> #define IFM_ATM_UTP_SONET	7
> #define IFM_ATM_UNKNOWN		8
> #define IFM_ATM_MM_OC12		9
> #define IFM_ATM_SM_OC12		10
> 
> 
> /*
261a276
> 	{ IFM_ATM,		"ATM" },				\
350a366,393
> 	{ 0, NULL },							\
> }
> 
> # define IFM_SUBTYPE_ATM_DESCRIPTIONS {					\
> 	{ IFM_ATM_TAXI_100,	"Taxi/100MBit" },			\
> 	{ IFM_ATM_TAXI_140,	"Taxi/140MBit" },			\
> 	{ IFM_ATM_MM_OC3,	"Multimode/OC3" },			\
> 	{ IFM_ATM_SM_OC3,	"Singlemode/OC3" },			\
> 	{ IFM_ATM_UTP_SONET,	"UTP/155MBit" },			\
> 	{ IFM_ATM_UNKNOWN,	"Unknown" },				\
> 	{ IFM_ATM_MM_OC12,	"Multimode/OC12" },			\
> 	{ IFM_ATM_SM_OC12,	"Singlemode/OC12" },			\
> 	{ 0, NULL },							\
> }
> 
> # define IFM_SUBTYPE_ATM_ALIASES {					\
> 	{ IFM_ATM_TAXI_100,	"TAXI-100" },				\
> 	{ IFM_ATM_TAXI_140,	"TAXI-140" },				\
> 	{ IFM_ATM_MM_OC3,	"MM-OC3" },				\
> 	{ IFM_ATM_SM_OC3,	"SM-OC3" },				\
> 	{ IFM_ATM_UTP_SONET,	"UTP-155" },				\
> 	{ IFM_ATM_UNKNOWN,	"UNKNOWN" },				\
> 	{ IFM_ATM_MM_OC12,	"MM-OC12" },				\
> 	{ IFM_ATM_SM_OC12,	"SM-OC12" },				\
> 	{ 0, NULL },							\
> }
> 
> #define	IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS {				\
Index: sys/net/if_media.c
===================================================================
RCS file: /home/ncvs/src/sys/net/if_media.c,v
retrieving revision 1.17
diff -r1.17 if_media.c
405a406,411
> struct ifmedia_description ifm_subtype_atm_descriptions[] =
>     IFM_SUBTYPE_ATM_DESCRIPTIONS;
> 
> struct ifmedia_description ifm_subtype_atm_option_descriptions[] =
>     IFM_SUBTYPE_ATM_OPTION_DESCRIPTIONS;
> 
439a446,449
> 	},
> 	{
> 	  &ifm_subtype_atm_descriptions[0],
> 	  &ifm_subtype_atm_option_descriptions[0]