so stuff pkp in m_pkthdr.rcvif, and change conventions for pk_ctlinput to get pkp
SCCS-vsn: sys/netccitt/hd_var.h 7.4
SCCS-vsn: sys/netccitt/hd_subr.c 7.6
SCCS-vsn: sys/netccitt/hd_input.c 7.7
SCCS-vsn: sys/netccitt/hd_output.c 7.6
SCCS-vsn: sys/netccitt/hd_timer.c 7.4
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_input.c 7.6 (Berkeley) %G%
+ * @(#)hd_input.c 7.7 (Berkeley) %G%
hdp->hd_state = ABM;
hd_message (hdp, "Link level operational");
/* Notify the packet level - to send RESTART. */
hdp->hd_state = ABM;
hd_message (hdp, "Link level operational");
/* Notify the packet level - to send RESTART. */
- (void) pk_ctlinput (PRC_LINKUP, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKUP, hdp->hd_pkp);
break;
case SABM + SABM_SENT:
break;
case SABM + SABM_SENT:
hd_flush (hdp->hd_ifp);
hd_writeinternal (hdp, UA, pf);
hd_initvars (hdp);
hd_flush (hdp->hd_ifp);
hd_writeinternal (hdp, UA, pf);
hd_initvars (hdp);
- (void) pk_ctlinput (PRC_LINKRESET, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKRESET, hdp->hd_pkp);
#ifdef HDLCDEBUG
hd_dumptrace (hdp);
#endif
#ifdef HDLCDEBUG
hd_dumptrace (hdp);
#endif
- (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp);
hd_flush (hdp->hd_ifp);
case DM + DM_SENT:
case DM + WAIT_SABM:
hd_flush (hdp->hd_ifp);
case DM + DM_SENT:
case DM + WAIT_SABM:
case DISC + ABM:
hd_message (hdp, "DISC received: link down");
case DISC + ABM:
hd_message (hdp, "DISC received: link down");
- (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp);
case DISC + WAIT_SABM:
hd_writeinternal (hdp, UA, pf);
hdp->hd_state = DM_SENT;
case DISC + WAIT_SABM:
hd_writeinternal (hdp, UA, pf);
hdp->hd_state = DM_SENT;
case UA + ABM:
hd_message (hdp, "UA received: link down");
case UA + ABM:
hd_message (hdp, "UA received: link down");
- (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp);
case UA + WAIT_SABM:
hd_writeinternal (hdp, DM, pf);
hdp->hd_state = DM_SENT;
case UA + WAIT_SABM:
hd_writeinternal (hdp, DM, pf);
hdp->hd_state = DM_SENT;
case FRMR + ABM:
hd_message (hdp, "FRMR received: link down");
case FRMR + ABM:
hd_message (hdp, "FRMR received: link down");
- (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp);
#ifdef HDLCDEBUG
hd_dumptrace (hdp);
#endif
#ifdef HDLCDEBUG
hd_dumptrace (hdp);
#endif
case ILLEGAL + ABM:
hd_message (hdp, "Unknown frame received: link down");
case ILLEGAL + ABM:
hd_message (hdp, "Unknown frame received: link down");
- (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp);
case ILLEGAL + WAIT_SABM:
hdp->hd_unknown++;
#ifdef HDLCDEBUG
case ILLEGAL + WAIT_SABM:
hdp->hd_unknown++;
#ifdef HDLCDEBUG
* it is queued for the packet level.
*/
* it is queued for the packet level.
*/
- if (ns != (hdp->hd_lasttxnr + hdp->hd_xcp->xc_lwsize) % MODULUS) {
- hdp->hd_vr = (hdp->hd_vr + 1) % MODULUS;
+ if (ns != (hdp -> hd_lasttxnr + hdp -> hd_xcp -> xc_lwsize) % MODULUS) {
+ hdp -> hd_vr = (hdp -> hd_vr + 1) % MODULUS;
if (pf == 1) {
/* Must generate a RR or RNR with final bit on. */
hd_writeinternal (hdp, RR, POLLON);
if (pf == 1) {
/* Must generate a RR or RNR with final bit on. */
hd_writeinternal (hdp, RR, POLLON);
fbuf -> m_data += HDHEADERLN;
fbuf -> m_len -= HDHEADERLN;
fbuf -> m_pkthdr.len -= HDHEADERLN;
fbuf -> m_data += HDHEADERLN;
fbuf -> m_len -= HDHEADERLN;
fbuf -> m_pkthdr.len -= HDHEADERLN;
+ fbuf -> m_pkthdr.rcvif = (struct ifnet *)hdp -> hd_pkp;
#ifdef BSD4_3
fbuf->m_act = 0; /* probably not necessary */
#else
#ifdef BSD4_3
fbuf->m_act = 0; /* probably not necessary */
#else
m -> m_act = (struct mbuf *) 1;
}
#endif
m -> m_act = (struct mbuf *) 1;
}
#endif
- pk_input (fbuf, hdp->hd_xcp);
queued = TRUE;
hd_start (hdp);
} else {
queued = TRUE;
hd_start (hdp);
} else {
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_output.c 7.5 (Berkeley) %G%
+ * @(#)hd_output.c 7.6 (Berkeley) %G%
hdp->hd_state = WAIT_UA;
SET_TIMER (hdp);
hd_message (hdp, "Timer recovery failed: link down");
hdp->hd_state = WAIT_UA;
SET_TIMER (hdp);
hd_message (hdp, "Timer recovery failed: link down");
- (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_subr.c 7.5 (Berkeley) %G%
+ * @(#)hd_subr.c 7.6 (Berkeley) %G%
register struct hdcb *hdp;
register struct ifaddr *ifa;
struct ifnet *ifp;
register struct hdcb *hdp;
register struct ifaddr *ifa;
struct ifnet *ifp;
if (addr->sa_family != AF_CCITT)
return (EAFNOSUPPORT);
if (addr->sa_family != AF_CCITT)
return (EAFNOSUPPORT);
if (hdp == 0)
return (ENOBUFS);
bzero((caddr_t)hdp, sizeof(*hdp));
if (hdp == 0)
return (ENOBUFS);
bzero((caddr_t)hdp, sizeof(*hdp));
- if (error = pk_ctlinput (PRC_LINKDOWN, xcp)) {
- free((caddr_t)hdp, M_PCB);
- return (error);
+ hdp->hd_pkp =
+ pk_newlink ((struct x25_ifaddr *)ifa, (caddr_t)hdp);
+ if (hdp -> hd_pkp == 0) {
+ free(hdp, M_PCB);
+ return (ENOBUFS);
- hdp->hd_next = hdcbhead;
- hdcbhead = hdp;
hdp->hd_ifp = ifp;
hdp->hd_ifa = ifa;
hdp->hd_xcp = xcp;
hdp->hd_state = INIT;
hdp->hd_output = hd_ifoutput;
hdp->hd_ifp = ifp;
hdp->hd_ifa = ifa;
hdp->hd_xcp = xcp;
hdp->hd_state = INIT;
hdp->hd_output = hd_ifoutput;
- pk_ifattach((struct x25_ifaddr *)ifa, hd_output, (caddr_t)hdp);
+ hdp->hd_next = hdcbhead;
+ hdcbhead = hdp;
case PRC_IFDOWN:
if (hdp->hd_state == ABM)
hd_message (hdp, "Operator shutdown: link closed");
case PRC_IFDOWN:
if (hdp->hd_state == ABM)
hd_message (hdp, "Operator shutdown: link closed");
- (void) pk_ctlinput (PRC_LINKDOWN, xcp);
+ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp);
hd_writeinternal (hdp, DISC, POLLON);
hdp->hd_state = DISC_SENT;
SET_TIMER (hdp);
hd_writeinternal (hdp, DISC, POLLON);
hdp->hd_state = DISC_SENT;
SET_TIMER (hdp);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_timer.c 7.3 (Berkeley) %G%
+ * @(#)hd_timer.c 7.4 (Berkeley) %G%
case DM_SENT:
if (++hdp->hd_retxcnt == hd_n2) {
/* Notify the packet level. */
case DM_SENT:
if (++hdp->hd_retxcnt == hd_n2) {
/* Notify the packet level. */
- (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_xcp);
+ (void) pk_ctlinput (PRC_LINKDOWN, hdp->hd_pkp);
hdp->hd_retxcnt = 0;
hdp->hd_state = SABM_SENT;
hd_writeinternal (hdp, SABM, POLLOFF);
hdp->hd_retxcnt = 0;
hdp->hd_state = SABM_SENT;
hd_writeinternal (hdp, SABM, POLLOFF);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)hd_var.h 7.3 (Berkeley) %G%
+ * @(#)hd_var.h 7.4 (Berkeley) %G%
char hd_dontcopy; /* if-driver doesn't free I-frames */
struct ifnet *hd_ifp; /* device's network visible interface */
struct ifaddr *hd_ifa; /* device's X.25 network address */
char hd_dontcopy; /* if-driver doesn't free I-frames */
struct ifnet *hd_ifp; /* device's network visible interface */
struct ifaddr *hd_ifa; /* device's X.25 network address */
+ struct x25config *hd_xcp;
+ caddr_t hd_pkp; /* Level III junk */
int (*hd_output)(); /* separate entry for HDLC direct output */
int (*hd_output)(); /* separate entry for HDLC direct output */
- struct x25config *hd_xcp; /* copy of &hdp->hd_if->if_addr */