SCCS-vsn: sys/kern/uipc_usrreq.c 1.12
SCCS-vsn: sys/vax/if/if_dmc.c 4.29
SCCS-vsn: sys/vax/if/if_ec.c 4.37
SCCS-vsn: sys/vax/if/if_en.c 4.80
SCCS-vsn: sys/vax/if/if_hy.c 4.8
SCCS-vsn: sys/vax/if/if_il.c 4.24
SCCS-vsn: sys/vax/if/if_pcl.c 4.3
SCCS-vsn: sys/vax/if/if_vv.c 4.22
SCCS-vsn: sys/vax/uba/lp.c 4.33
SCCS-vsn: sys/vax/uba/rl.c 4.4
SCCS-vsn: sys/vax/uba/rlreg.h 4.2
SCCS-vsn: sys/vax/vax/Locore.c 4.25
SCCS-vsn: sys/vax/vax/machdep.c 4.81
SCCS-vsn: sys/deprecated/netimp/if_imp.c 4.51
SCCS-vsn: sys/netinet/if_ether.c 4.3
SCCS-vsn: sys/deprecated/netpup/raw_pup.c 4.18
16 files changed:
-/* if_imp.c 4.50 83/06/13 */
+/* if_imp.c 4.51 83/06/13 */
#include "imp.h"
#if NIMP > 0
#include "imp.h"
#if NIMP > 0
{
struct imp_softc *sc = &imp_softc[ui->ui_unit];
register struct ifnet *ifp = &sc->imp_if;
{
struct imp_softc *sc = &imp_softc[ui->ui_unit];
register struct ifnet *ifp = &sc->imp_if;
- struct sockaddr_in *sin;
/* UNIT COULD BE AMBIGUOUS */
ifp->if_unit = ui->ui_unit;
/* UNIT COULD BE AMBIGUOUS */
ifp->if_unit = ui->ui_unit;
register struct imp_softc *sc = &imp_softc[unit];
struct sockaddr_in *sin;
register struct imp_softc *sc = &imp_softc[unit];
struct sockaddr_in *sin;
- sin = (struct sockaddr_in *)&sc->sc_if;
+ sin = (struct sockaddr_in *)&sc->imp_if.if_addr;
if (in_netof(sin->sin_addr) == 0)
return;
if ((*sc->imp_cb.ic_init)(unit) == 0) {
if (in_netof(sin->sin_addr) == 0)
return;
if ((*sc->imp_cb.ic_init)(unit) == 0) {
- sc->sc_if.if_flags |= IFF_RUNNING;
+ sc->imp_if.if_flags |= IFF_RUNNING;
sc->imp_state = IMPS_INIT;
impnoops(sc);
splx(s);
sc->imp_state = IMPS_INIT;
impnoops(sc);
splx(s);
-/* raw_pup.c 4.17 83/05/30 */
+/* raw_pup.c 4.18 83/06/13 */
#include "../h/param.h"
#include "../h/mbuf.h"
#include "../h/param.h"
#include "../h/mbuf.h"
error = EMSGSIZE;
goto bad;
}
error = EMSGSIZE;
goto bad;
}
- pup->pup_length = htons(len);
+ pup->pup_length = htons((u_short)len);
dst = (struct sockaddr_pup *)&rp->rcb_faddr;
bcopy((caddr_t)dst->spup_net, (caddr_t)pup->pup_dnet,
sizeof (struct pupport));
dst = (struct sockaddr_pup *)&rp->rcb_faddr;
bcopy((caddr_t)dst->spup_net, (caddr_t)pup->pup_dnet,
sizeof (struct pupport));
- ifp = if_ifonnetof((u_int)pup->pup_dnet);
+ ifp = if_ifonnetof((int)(unsigned)pup->pup_dnet);
if (ifp == 0) {
error = ENETUNREACH;
goto bad;
if (ifp == 0) {
error = ENETUNREACH;
goto bad;
-/* uipc_usrreq.c 1.11 83/06/12 */
+/* uipc_usrreq.c 1.12 83/06/13 */
#include "../h/param.h"
#include "../h/dir.h"
#include "../h/param.h"
#include "../h/dir.h"
register struct file *fp;
rp = mtod(rights, struct file **);
register struct file *fp;
rp = mtod(rights, struct file **);
- for (i = 0; i < oldfds; i++) {
+ for (i = 0; i < oldfds; i++)
if (getf(*(int *)rp++) == 0)
return (EBADF);
rp = mtod(rights, struct file **);
if (getf(*(int *)rp++) == 0)
return (EBADF);
rp = mtod(rights, struct file **);
- for (i = 0; i < oldfds; i++)
+ for (i = 0; i < oldfds; i++) {
fp = getf(*(int *)rp);
*rp++ = fp;
fp->f_count++;
fp = getf(*(int *)rp);
*rp++ = fp;
fp->f_count++;
-/* if_ether.c 4.2 83/05/27 */
+/* if_ether.c 4.3 83/06/13 */
/*
* Ethernet address resolution protocol.
/*
* Ethernet address resolution protocol.
struct sockaddr sa;
if ((m = m_get(M_DONTWAIT, MT_DATA)) == NULL)
struct sockaddr sa;
if ((m = m_get(M_DONTWAIT, MT_DATA)) == NULL)
m->m_len = sizeof *ea + sizeof *eh;
m->m_off = MMAXOFF - m->m_len;
ea = mtod(m, struct ether_arp *);
m->m_len = sizeof *ea + sizeof *eh;
m->m_off = MMAXOFF - m->m_len;
ea = mtod(m, struct ether_arp *);
(caddr_t)ea->arp_spa, sizeof (ea->arp_spa));
bcopy((caddr_t)addr, (caddr_t)ea->arp_tpa, sizeof (ea->arp_tpa));
sa.sa_family = AF_UNSPEC;
(caddr_t)ea->arp_spa, sizeof (ea->arp_spa));
bcopy((caddr_t)addr, (caddr_t)ea->arp_tpa, sizeof (ea->arp_tpa));
sa.sa_family = AF_UNSPEC;
- return ((*ac->ac_if.if_output)(&ac->ac_if, m, &sa));
+ (void) (*ac->ac_if.if_output)(&ac->ac_if, m, &sa);
{
static struct in_addr addr;
{
static struct in_addr addr;
+#ifdef lint
+ ac = ac;
+#endif
addr.s_addr = 0;
return (addr);
}
addr.s_addr = 0;
return (addr);
}
-/* if_dmc.c 4.28 83/06/13 */
+/* if_dmc.c 4.29 83/06/13 */
#include "dmc.h"
#if NDMC > 0
#include "dmc.h"
#if NDMC > 0
#include "../h/systm.h"
#include "../h/mbuf.h"
#include "../h/buf.h"
#include "../h/systm.h"
#include "../h/mbuf.h"
#include "../h/buf.h"
+#include "../h/ioctl.h" /* must precede tty.h */
#include "../h/tty.h"
#include "../h/protosw.h"
#include "../h/socket.h"
#include "../h/vmmac.h"
#include "../h/tty.h"
#include "../h/protosw.h"
#include "../h/socket.h"
#include "../h/vmmac.h"
#include "../h/errno.h"
#include "../net/if.h"
#include "../h/errno.h"
#include "../net/if.h"
addr->bsel1 = DMC_MCLR;
for (i = 100000; i && (addr->bsel1 & DMC_RUN) == 0; i--)
;
addr->bsel1 = DMC_MCLR;
for (i = 100000; i && (addr->bsel1 & DMC_RUN) == 0; i--)
;
-#ifdef ECHACK
- br = 0x16;
-#endif
}
/* set up routing table entry */
if ((ifp->if_flags & IFF_ROUTE) == 0) {
}
/* set up routing table entry */
if ((ifp->if_flags & IFF_ROUTE) == 0) {
- rtinit(sin, sin, RTF_HOST|RTF_UP);
+ rtinit((struct sockaddr *)sin, (struct sockaddr *)sin,
+ RTF_HOST|RTF_UP);
ifp->if_flags |= IFF_ROUTE;
}
}
ifp->if_flags |= IFF_ROUTE;
}
}
struct dmcdevice *addr;
struct mbuf *m;
register struct ifqueue *inq;
struct dmcdevice *addr;
struct mbuf *m;
register struct ifqueue *inq;
- int arg, arg2, cmd, len;
addr = (struct dmcdevice *)ui->ui_addr;
cmd = addr->bsel2 & 0xff;
if ((cmd & DMC_RDYO) == 0)
return;
addr = (struct dmcdevice *)ui->ui_addr;
cmd = addr->bsel2 & 0xff;
if ((cmd & DMC_RDYO) == 0)
return;
arg = addr->sel6;
addr->bsel2 &= ~DMC_RDYO;
sc = &dmc_softc[unit];
arg = addr->sel6;
addr->bsel2 &= ~DMC_RDYO;
sc = &dmc_softc[unit];
register struct mbuf *m;
struct sockaddr *dst;
{
register struct mbuf *m;
struct sockaddr *dst;
{
- struct uba_device *ui = dmcinfo[ifp->if_unit];
int s;
printd("dmcoutput\n");
int s;
printd("dmcoutput\n");
if (ifp->if_flags & IFF_RUNNING)
if_rtinit(ifp, -1); /* delete previous route */
sin = (struct sockaddr_in *)&ifr->ifr_addr;
if (ifp->if_flags & IFF_RUNNING)
if_rtinit(ifp, -1); /* delete previous route */
sin = (struct sockaddr_in *)&ifr->ifr_addr;
+ ifp->if_addr = *(struct sockaddr *)sin;
ifp->if_net = in_netof(sin->sin_addr);
ifp->if_host[0] = in_lnaof(sin->sin_addr);
dmcinit(ifp->if_unit);
ifp->if_net = in_netof(sin->sin_addr);
ifp->if_host[0] = in_lnaof(sin->sin_addr);
dmcinit(ifp->if_unit);
splx(s);
return (error);
}
splx(s);
return (error);
}
-/* if_ec.c 4.36 83/06/13 */
+/* if_ec.c 4.37 83/06/13 */
struct ec_softc *es = &ec_softc[unit];
struct ecdevice *addr;
register struct ifnet *ifp = &es->es_if;
struct ec_softc *es = &ec_softc[unit];
struct ecdevice *addr;
register struct ifnet *ifp = &es->es_if;
- register struct sockaddr_in *sin, *sinb;
+ register struct sockaddr_in *sin;
int i, s;
sin = (struct sockaddr_in *)&ifp->if_addr;
int i, s;
sin = (struct sockaddr_in *)&ifp->if_addr;
-/* if_en.c 4.79 83/06/12 */
+/* if_en.c 4.80 83/06/13 */
addr->en_ostat = EN_IEN|EN_GO;
DELAY(100000);
addr->en_ostat = 0;
addr->en_ostat = EN_IEN|EN_GO;
DELAY(100000);
addr->en_ostat = 0;
-#ifdef ECHACK
- br = 0x16;
-#endif
-/* if_hy.c 4.7 83/06/13 */
+/* if_hy.c 4.8 83/06/13 */
#include "hy.h"
#if NHY > 0
#include "hy.h"
#if NHY > 0
#include "../h/time.h"
#include "../h/kernel.h"
#include "../h/ioctl.h"
#include "../h/time.h"
#include "../h/kernel.h"
#include "../h/ioctl.h"
#include "../net/if.h"
#include "../net/netisr.h"
#include "../net/route.h"
#include "../net/if.h"
#include "../net/netisr.h"
#include "../net/route.h"
struct sockaddr_in *sin;
int s;
struct sockaddr_in *sin;
int s;
- sin = (struct sockaddr_in *)&is->is_if.if_addr;
+ sin = (struct sockaddr_in *)&is->hy_if.if_addr;
if (in_netof(sin->sin_addr) == 0)
return;
if (if_ubainit(&is->hy_ifuba, ui->ui_ubanum,
if (in_netof(sin->sin_addr) == 0)
return;
if (if_ubainit(&is->hy_ifuba, ui->ui_ubanum,
is->hy_if.if_flags &= ~IFF_UP;
return;
}
is->hy_if.if_flags &= ~IFF_UP;
return;
}
- is->is_hy.if_flags |= IFF_RUNNING;
+ is->hy_if.if_flags |= IFF_RUNNING;
/*
* Issue wait for message and start the state machine
*/
/*
* Issue wait for message and start the state machine
*/
/*
* Encapsulate a packet of type family for the local net.
/*
* Encapsulate a packet of type family for the local net.
- * Use trailer local net encapsulation if enough data in first
- * packet leaves a multiple of 512 bytes of data in remainder.
*/
hyoutput(ifp, m0, dst)
struct ifnet *ifp;
*/
hyoutput(ifp, m0, dst)
struct ifnet *ifp;
is->hy_flags &= ~RQ_STATUS;
is->hy_state = STATSENT;
hystart(ui, HYF_STATUS, sizeof (is->hy_status),
is->hy_flags &= ~RQ_STATUS;
is->hy_state = STATSENT;
hystart(ui, HYF_STATUS, sizeof (is->hy_status),
- is->hy_ifuba.ifu_r.ifrw_info);
+ is->hy_ifuba.ifu_r.ifrw_info);
} else if (rq & RQ_ENDOP) {
is->hy_flags &= ~RQ_ENDOP;
is->hy_state = ENDOPSENT;
} else if (rq & RQ_ENDOP) {
is->hy_flags &= ~RQ_ENDOP;
is->hy_state = ENDOPSENT;
is->hy_flags &= ~RQ_STATISTICS;
is->hy_state = RSTATSENT;
hystart(ui, HYF_RSTATS, sizeof (is->hy_stat),
is->hy_flags &= ~RQ_STATISTICS;
is->hy_state = RSTATSENT;
hystart(ui, HYF_RSTATS, sizeof (is->hy_stat),
- is->hy_ifuba.ifu_r.ifrw_info);
+ is->hy_ifuba.ifu_r.ifrw_info);
} else if (HYS_RECVDATA(addr)) {
is->hy_state = RECVSENT;
is->hy_retry = 0;
hystart(ui, HYF_INPUTMSG, MPSIZE,
} else if (HYS_RECVDATA(addr)) {
is->hy_state = RECVSENT;
is->hy_retry = 0;
hystart(ui, HYF_INPUTMSG, MPSIZE,
- is->hy_ifuba.ifu_r.ifrw_info);
+ is->hy_ifuba.ifu_r.ifrw_info);
} else if (rq & RQ_REISSUE) {
is->hy_flags &= ~RQ_REISSUE;
is->hy_state = is->hy_savedstate;
} else if (rq & RQ_REISSUE) {
is->hy_flags &= ~RQ_REISSUE;
is->hy_state = is->hy_savedstate;
is->hy_savedaddr, is->hy_retry);
#endif
hystart(ui, is->hy_savedcmd, is->hy_savedcount,
is->hy_savedaddr, is->hy_retry);
#endif
hystart(ui, is->hy_savedcmd, is->hy_savedcount,
} else {
register struct mbuf *m;
} else {
register struct mbuf *m;
hym = mtod(m, struct hym_hdr *);
#ifdef HYLOG
hylog(HYL_XMIT, sizeof(struct hym_hdr),
hym = mtod(m, struct hym_hdr *);
#ifdef HYLOG
hylog(HYL_XMIT, sizeof(struct hym_hdr),
#endif
mplen = hym->hym_mplen;
if (hym->hym_hdr.hyh_to_adapter ==
#endif
mplen = hym->hym_mplen;
if (hym->hym_hdr.hyh_to_adapter ==
- hym->hym_hdr.hyh_from_adapter)
+ hym->hym_hdr.hyh_from_adapter)
cmd = HYF_XMITLOCMSG;
else
cmd = HYF_XMITMSG;
cmd = HYF_XMITLOCMSG;
else
cmd = HYF_XMITMSG;
printD("hy%d: hym_hdr = ", ui->ui_unit);
if (hy_debug_flag)
hyprintdata((char *)hym,
printD("hy%d: hym_hdr = ", ui->ui_unit);
if (hy_debug_flag)
hyprintdata((char *)hym,
- sizeof (struct hym_hdr));
+ sizeof (struct hym_hdr));
#endif
/*
* Strip off the software part of
#endif
/*
* Strip off the software part of
ui->ui_unit, mplen, is->hy_olen);
if (hy_debug_flag)
hyprintdata(
ui->ui_unit, mplen, is->hy_olen);
if (hy_debug_flag)
hyprintdata(
- is->hy_ifuba.ifu_w.ifrw_addr,
- is->hy_olen);
+ is->hy_ifuba.ifu_w.ifrw_addr,
+ is->hy_olen);
- (mplen == 0) ? is->hy_olen : mplen,
- is->hy_ifuba.ifu_w.ifrw_info);
+ (mplen == 0) ? is->hy_olen : mplen,
+ is->hy_ifuba.ifu_w.ifrw_info);
if (mplen != 0)
is->hy_flags |= RQ_XASSOC;
} else if (rq & RQ_MARKDOWN) {
if (mplen != 0)
is->hy_flags |= RQ_XASSOC;
} else if (rq & RQ_MARKDOWN) {
if (is->hy_ifuba.ifu_flags & UBA_NEEDBDP)
UBAPURGE(is->hy_ifuba.ifu_uba,
if (is->hy_ifuba.ifu_flags & UBA_NEEDBDP)
UBAPURGE(is->hy_ifuba.ifu_uba,
- is->hy_ifuba.ifu_r.ifrw_bdp);
+ is->hy_ifuba.ifu_r.ifrw_bdp);
hyh = (struct hy_hdr *) (is->hy_ifuba.ifu_r.ifrw_addr);
len = (0xffff & (addr->hyd_wcr - is->hy_lastwcr)) << 1;
if (len > MPSIZE) {
printf("hy%d: RECVD MP > MPSIZE (%d)\n",
hyh = (struct hy_hdr *) (is->hy_ifuba.ifu_r.ifrw_addr);
len = (0xffff & (addr->hyd_wcr - is->hy_lastwcr)) << 1;
if (len > MPSIZE) {
printf("hy%d: RECVD MP > MPSIZE (%d)\n",
#ifdef DEBUG
hy_debug_flag = 1;
printD("hy%d: csr = 0x%b, bar = 0x%x, wcr = 0x%x\n",
#ifdef DEBUG
hy_debug_flag = 1;
printD("hy%d: csr = 0x%b, bar = 0x%x, wcr = 0x%x\n",
is->hy_ilen = len;
is->hy_retry = 0;
hystart(ui, HYF_INPUTDATA,
is->hy_ilen = len;
is->hy_retry = 0;
hystart(ui, HYF_INPUTDATA,
- (int)(HYMTU-len+sizeof (struct hy_hdr)),
- (int)(is->hy_ifuba.ifu_r.ifrw_info + len));
+ (int)(HYMTU-len+sizeof (struct hy_hdr)),
+ (int)(is->hy_ifuba.ifu_r.ifrw_info + len));
} else {
hyrecvdata(ui, hyh, (int)len);
is->hy_state = IDLE;
} else {
hyrecvdata(ui, hyh, (int)len);
is->hy_state = IDLE;
if (is->hy_ifuba.ifu_flags & UBA_NEEDBDP)
UBAPURGE(is->hy_ifuba.ifu_uba,
if (is->hy_ifuba.ifu_flags & UBA_NEEDBDP)
UBAPURGE(is->hy_ifuba.ifu_uba,
- is->hy_ifuba.ifu_r.ifrw_bdp);
+ is->hy_ifuba.ifu_r.ifrw_bdp);
hyh = (struct hy_hdr *) (is->hy_ifuba.ifu_r.ifrw_addr);
len = (0xffff & (addr->hyd_wcr - is->hy_lastwcr)) << 1;
#ifdef DEBUG
hyh = (struct hy_hdr *) (is->hy_ifuba.ifu_r.ifrw_addr);
len = (0xffff & (addr->hyd_wcr - is->hy_lastwcr)) << 1;
#ifdef DEBUG
#endif
}
hystart(ui, HYF_XMITLSTDATA, is->hy_olen - len,
#endif
}
hystart(ui, HYF_XMITLSTDATA, is->hy_olen - len,
- is->hy_ifuba.ifu_w.ifrw_info + len);
+ is->hy_ifuba.ifu_w.ifrw_info + len);
break;
}
/* fall through to ... */
break;
}
/* fall through to ... */
if (is->hy_state == IDLE)
goto actloop;
endintr:
if (is->hy_state == IDLE)
goto actloop;
endintr:
#ifdef DEBUG
printD("hy%d: hyact, exit at \"%s\"\n", ui->ui_unit,
hy_state_names[is->hy_state]);
#ifdef DEBUG
printD("hy%d: hyact, exit at \"%s\"\n", ui->ui_unit,
hy_state_names[is->hy_state]);
- * Called from device interrupt when recieving data.
+ * Called from device interrupt when receiving data.
* Examine packet to determine type. Decapsulate packet
* based on type and pass to type specific higher-level
* input routine.
*/
* Examine packet to determine type. Decapsulate packet
* based on type and pass to type specific higher-level
* input routine.
*/
-hyrecvdata(ui, hyh0, len)
+hyrecvdata(ui, hyh, len)
+ register struct hy_hdr *hyh;
int len;
{
register struct hy_softc *is = &hy_softc[ui->ui_unit];
int len;
{
register struct hy_softc *is = &hy_softc[ui->ui_unit];
- register struct hy_hdr *hyh = hyh0;
struct mbuf *m;
register struct ifqueue *inq;
struct mbuf *m;
register struct ifqueue *inq;
{
register struct hy_softc *is = &hy_softc[unit];
register struct uba_device *ui = hyinfo[unit];
{
register struct hy_softc *is = &hy_softc[unit];
register struct uba_device *ui = hyinfo[unit];
#ifdef HYLOG
hylog(code, len, ptr)
#ifdef HYLOG
hylog(code, len, ptr)
char *ptr;
{
register unsigned char *p;
char *ptr;
{
register unsigned char *p;
}
*p++ = code;
*p++ = len;
}
*p++ = code;
*p++ = len;
- bcopy(ptr, (caddr_t)p, (unsigned)len);
+ bcopy((caddr_t)ptr, (caddr_t)p, (unsigned)len);
hy_log.hyl_ptr = p + len;
out:
splx(s);
hy_log.hyl_ptr = p + len;
out:
splx(s);
caddr_t data;
{
struct sockaddr_in *sin;
caddr_t data;
{
struct sockaddr_in *sin;
+ struct ifreq *ifr = (struct ifreq *)data;
int s = splimp(), error = 0;
switch(cmd) {
int s = splimp(), error = 0;
switch(cmd) {
-/* if_il.c 4.23 83/06/13 */
+/* if_il.c 4.24 83/06/13 */
register struct ifnet *ifp;
register struct sockaddr_in *sin;
{
register struct ifnet *ifp;
register struct sockaddr_in *sin;
{
-/* if_pcl.c 4.2 83/06/13 */
+/* if_pcl.c 4.3 83/06/13 */
#include "pcl.h"
#if NPCL > 0
#include "pcl.h"
#if NPCL > 0
struct uba_device *ui;
{
register struct pcl_softc *sc = &pcl_softc[ui->ui_unit];
struct uba_device *ui;
{
register struct pcl_softc *sc = &pcl_softc[ui->ui_unit];
- register struct sockaddr_in *sin;
sc->sc_if.if_unit = ui->ui_unit;
sc->sc_if.if_name = "pcl";
sc->sc_if.if_unit = ui->ui_unit;
sc->sc_if.if_name = "pcl";
struct sockaddr_in *sin;
int s;
struct sockaddr_in *sin;
int s;
- sin = &sc->sc_if.if_addr;
+ sin = (struct sockaddr_in *)&sc->sc_if.if_addr;
if (sin->sin_addr.s_addr == 0)
return;
if (if_ubainit(&sc->sc_ifuba, ui->ui_ubanum, 0,
if (sin->sin_addr.s_addr == 0)
return;
if (if_ubainit(&sc->sc_ifuba, ui->ui_ubanum, 0,
struct mbuf *m;
struct sockaddr *dst;
{
struct mbuf *m;
struct sockaddr *dst;
{
- int type, dest, s, error;
struct pcl_header *pclp;
struct mbuf *m2;
struct pcl_header *pclp;
struct mbuf *m2;
#ifdef INET
case AF_INET:
dest = ((struct sockaddr_in *)dst)->sin_addr.s_addr;
#ifdef INET
case AF_INET:
dest = ((struct sockaddr_in *)dst)->sin_addr.s_addr;
- dest = ntohl(dest); /* ??? */
+ dest = ntohl((u_long)dest); /* ??? */
dest = dest & 0xff;
break;
#endif
dest = dest & 0xff;
break;
#endif
register struct pcl_softc *sc = &pcl_softc[unit];
struct pcldevice *addr = (struct pcldevice *)pclinfo[unit]->ui_addr;
struct mbuf *m;
register struct pcl_softc *sc = &pcl_softc[unit];
struct pcldevice *addr = (struct pcldevice *)pclinfo[unit]->ui_addr;
struct mbuf *m;
- int len, plen; short resid;
register struct ifqueue *inq;
register struct ifqueue *inq;
sc->sc_if.if_ipackets++;
/*
sc->sc_if.if_ipackets++;
/*
if (ifp->if_flags & IFF_RUNNING)
if_rtinit(ifp, -1); /* delete previous route */
sin = (struct sockaddr_in *)&ifr->ifr_addr;
if (ifp->if_flags & IFF_RUNNING)
if_rtinit(ifp, -1); /* delete previous route */
sin = (struct sockaddr_in *)&ifr->ifr_addr;
+ ifp->if_addr = *(struct sockaddr *)sin;
ifp->if_net = in_netof(sin->sin_addr);
ifp->if_host[0] = in_lnaof(sin->sin_addr);
if (ifp->if_flags & IFF_RUNNING)
ifp->if_net = in_netof(sin->sin_addr);
ifp->if_host[0] = in_lnaof(sin->sin_addr);
if (ifp->if_flags & IFF_RUNNING)
-/* if_vv.c 4.21 83/06/12 */
+/* if_vv.c 4.22 83/06/13 */
if (len > VVMRU || len <= 0)
goto dropit;
#define vvdataaddr(vv, off, type) ((type)(((caddr_t)((vv)+1)+(off))))
if (len > VVMRU || len <= 0)
goto dropit;
#define vvdataaddr(vv, off, type) ((type)(((caddr_t)((vv)+1)+(off))))
- if ((ifp->if_flags & IFF_NOTRAILERS) == 0)
if (vv->vh_type >= RING_IPTrailer &&
vv->vh_type < RING_IPTrailer+RING_IPNTrailer) {
off = (vv->vh_type - RING_IPTrailer) * 512;
if (vv->vh_type >= RING_IPTrailer &&
vv->vh_type < RING_IPTrailer+RING_IPNTrailer) {
off = (vv->vh_type - RING_IPTrailer) * 512;
goto bad;
}
off = ntohs((u_short)mtod(m, struct ip *)->ip_len) - m->m_len;
goto bad;
}
off = ntohs((u_short)mtod(m, struct ip *)->ip_len) - m->m_len;
- if (vv_dotrailer && off > 0 && (off & 0x1ff) == 0 &&
+ if ((ifp->if_flags & IFF_NOTRAILERS) == 0)
+ if (off > 0 && (off & 0x1ff) == 0 &&
m->m_off >= MMINOFF + 2 * sizeof (u_short)) {
type = RING_IPTrailer + (off>>9);
m->m_off -= 2 * sizeof (u_short);
m->m_off >= MMINOFF + 2 * sizeof (u_short)) {
type = RING_IPTrailer + (off>>9);
m->m_off -= 2 * sizeof (u_short);
case SIOCSIFADDR:
/* too difficult to change addr while running */
if ((ifp->if_flags & IFF_RUNNING) == 0) {
case SIOCSIFADDR:
/* too difficult to change addr while running */
if ((ifp->if_flags & IFF_RUNNING) == 0) {
- ifp->if_net = in_netof(ifr->ifr_addr.sin_addr);
+ struct sockaddr_in *sin =
+ (struct sockaddr_in *)&ifr->ifr_addr;
+ ifp->if_net = in_netof(sin->sin_addr);
vvinit(ifp->if_unit);
} else
error = EINVAL;
vvinit(ifp->if_unit);
} else
error = EINVAL;
-/* lp.c 4.32 83/01/03 */
+/* lp.c 4.33 83/06/13 */
#include "lp.h"
#if NLP > 0
#include "lp.h"
#if NLP > 0
register struct lp_softc *sc = &lp_softc[LPUNIT(dev)];
int error;
register struct lp_softc *sc = &lp_softc[LPUNIT(dev)];
int error;
- while (n = min(512, uio->uio_resid)) {
+ while (n = min(512, (unsigned)uio->uio_resid)) {
cp = sc->sc_inbuf->b_un.b_addr;
cp = sc->sc_inbuf->b_un.b_addr;
- error = uiomove(cp, n, UIO_WRITE, uio);
+ error = uiomove(cp, (int)n, UIO_WRITE, uio);
if (error)
return (error);
do
if (error)
return (error);
do
lpaddr->lpsr |= IENABLE;
}
}
lpaddr->lpsr |= IENABLE;
}
}
#include "rl.h"
#if NRL > 0
/*
* UNIBUS RL02 disk driver
#include "rl.h"
#if NRL > 0
/*
* UNIBUS RL02 disk driver
- * (not yet converted to 4.1c)
+#include "../machine/pte.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
-#include "../h/cpu.h"
-#include "../h/nexus.h"
#include "../h/buf.h"
#include "../h/conf.h"
#include "../h/dir.h"
#include "../h/user.h"
#include "../h/map.h"
#include "../h/buf.h"
#include "../h/conf.h"
#include "../h/dir.h"
#include "../h/user.h"
#include "../h/map.h"
-#include "../h/pte.h"
-#include "../h/mtpr.h"
-#include "../h/ubavar.h"
-#include "../h/ubareg.h"
+#include "../h/uio.h"
+#include "../h/kernel.h"
+#include "../vax/cpu.h"
+#include "../vax/nexus.h"
+#include "../vaxuba/ubavar.h"
+#include "../vaxuba/ubareg.h"
+#include "../vaxuba/rlreg.h"
/* Pending Controller items and statistics */
struct rl_softc {
/* Pending Controller items and statistics */
struct rl_softc {
- * this struct is used to keep the state of the controller for the last
- * transfer done. Since only one transfer can be done at a time per
+ * State of controller from last transfer.
+ * Since only one transfer can be done at a time per
* controller, only allocate one for each controller.
*/
struct rl_stat {
* controller, only allocate one for each controller.
*/
struct rl_stat {
} rl_stat[NHL];
/* THIS SHOULD BE READ OFF THE PACK, PER DRIVE */
} rl_stat[NHL];
/* THIS SHOULD BE READ OFF THE PACK, PER DRIVE */
+/* Last cylinder not used. Saved for Bad Sector File */
struct size {
daddr_t nblocks;
int cyloff;
} rl02_sizes[8] = {
struct size {
daddr_t nblocks;
int cyloff;
} rl02_sizes[8] = {
- 14440, 0, /* A=cyl 0 thru 360 */
- 6040, 361, /* B=cyl 361 thru 511 */
- 20480, 0, /* C=cyl 0 thru 511 */
- 0, 0, /* D= Not Defined */
- 0, 0, /* E= Not Defined */
+ 15884, 0, /* A=cyl 0 thru 397 */
+ 4520, 398, /* B=cyl 398 thru 510 */
+ -1, 0, /* C=cyl 0 thru 511 */
+ 4520, 398, /* D=cyl 398 thru 510 */
0, 0, /* F= Not Defined */
0, 0, /* F= Not Defined */
- 0, 0, /* G= Not Defined */
+ 20440, 0, /* G=cyl 0 thru 510 */
0, 0, /* H= Not Defined */
};
/* END OF STUFF WHICH SHOULD BE READ IN PER DISK */
0, 0, /* H= Not Defined */
};
/* END OF STUFF WHICH SHOULD BE READ IN PER DISK */
#ifdef lint
br = 0; cvec = br; br = cvec;
#ifdef lint
br = 0; cvec = br; br = cvec;
- ((struct rldevice *)reg)->rlcs = RL_IE | RL_NOOP; /* Enable intrpt */
- DELAY(10); /* Ensure interrupt takes place (10 microsec ) */
- ((struct rldevice *)reg)->rlcs &= ~RL_IE; /* Disable intrpt */
+ ((struct rldevice *)reg)->rlcs = RL_IE | RL_NOOP;
+ DELAY(10);
+ ((struct rldevice *)reg)->rlcs &= ~RL_IE;
return (sizeof (struct rldevice));
}
return (sizeof (struct rldevice));
}
-/* Check that drive exists and is functional*/
rlslave(ui, reg)
struct uba_device *ui;
caddr_t reg;
rlslave(ui, reg)
struct uba_device *ui;
caddr_t reg;
rladdr->rlda.getstat = RL_RESET;
rladdr->rlcs = (ui->ui_slave <<8) | RL_GETSTAT; /* Get status*/
rlwait(rladdr);
rladdr->rlda.getstat = RL_RESET;
rladdr->rlcs = (ui->ui_slave <<8) | RL_GETSTAT; /* Get status*/
rlwait(rladdr);
- } while( (rladdr->rlmp.getstat&RLMP_STATUS) != RLMP_STATOK && ++ctr<8 );
-
-
+ } while ((rladdr->rlmp.getstat&RLMP_STATUS) != RLMP_STATOK && ++ctr<8);
if ((rladdr->rlcs & RL_DE) || (ctr >= 8))
if ((rladdr->rlcs & RL_DE) || (ctr >= 8))
- return (0); /* Error return */
- if ((rladdr->rlmp.getstat & RLMP_DT) == 0 ) { /* NO RL01'S */
- printf("rl01 drives not supported (drive %d)\n", ui->ui_slave );
+ return (0);
+ if ((rladdr->rlmp.getstat & RLMP_DT) == 0 ) {
+ printf("rl%d: rl01's not supported\n", ui->ui_slave);
return(0);
}
return (1);
}
return(0);
}
return (1);
}
-/* Initialize controller */
rlattach(ui)
register struct uba_device *ui;
{
register struct rldevice *rladdr;
if (rlwstart == 0) {
rlattach(ui)
register struct uba_device *ui;
{
register struct rldevice *rladdr;
if (rlwstart == 0) {
- timeout(rlwatch, (caddr_t)0, hz); /* Watch for lost intr */
+ timeout(rlwatch, (caddr_t)0, hz);
rlwstart++;
}
/* Initialize iostat values */
if (ui->ui_dk >= 0)
dk_mspw[ui->ui_dk] = .000003906; /* 16bit transfer time? */
rlip[ui->ui_ctlr][ui->ui_slave] = ui;
rlwstart++;
}
/* Initialize iostat values */
if (ui->ui_dk >= 0)
dk_mspw[ui->ui_dk] = .000003906; /* 16bit transfer time? */
rlip[ui->ui_ctlr][ui->ui_slave] = ui;
- rl_softc[ui->ui_ctlr].rl_ndrive++; /* increment device/ctrl */
+ rl_softc[ui->ui_ctlr].rl_ndrive++;
rladdr = (struct rldevice *)ui->ui_addr;
rladdr = (struct rldevice *)ui->ui_addr;
/* reset controller */
rladdr->rlda.getstat = RL_RESET; /* SHOULD BE REPEATED? */
rladdr->rlcs = (ui->ui_slave << 8) | RL_GETSTAT; /* Reset DE bit */
rlwait(rladdr);
/* reset controller */
rladdr->rlda.getstat = RL_RESET; /* SHOULD BE REPEATED? */
rladdr->rlcs = (ui->ui_slave << 8) | RL_GETSTAT; /* Reset DE bit */
rlwait(rladdr);
-
- /* Determine disk posistion */
+ /* determine disk posistion */
rladdr->rlcs = (ui->ui_slave << 8) | RL_RHDR;
rlwait(rladdr);
rladdr->rlcs = (ui->ui_slave << 8) | RL_RHDR;
rlwait(rladdr);
/* save disk drive posistion */
rl_stat[ui->ui_ctlr].rl_cyl[ui->ui_slave] =
/* save disk drive posistion */
rl_stat[ui->ui_ctlr].rl_cyl[ui->ui_slave] =
- (rladdr->rlmp.readhdr & 0177700) >> 6;
+ (rladdr->rlmp.readhdr & 0177700) >> 6;
rl_stat[ui->ui_ctlr].rl_dn = -1;
}
rl_stat[ui->ui_ctlr].rl_dn = -1;
}
dev_t dev;
{
register int unit = minor(dev) >> 3;
dev_t dev;
{
register int unit = minor(dev) >> 3;
- register struct uba_device *mi;
+ register struct uba_device *ui;
if (unit >= NRL || (ui = rldinfo[unit]) == 0 || ui->ui_alive == 0)
return (ENXIO);
if (unit >= NRL || (ui = rldinfo[unit]) == 0 || ui->ui_alive == 0)
return (ENXIO);
register struct uba_device *ui;
register int drive;
register struct buf *dp;
register struct uba_device *ui;
register int drive;
register struct buf *dp;
- int partition = minor(bp->b_dev) & 07;
+ int partition = minor(bp->b_dev) & 07, s;
- sz = (bp->b_bcount+511) >> 9; /* Blocks to transfer */
-
- drive = dkunit(bp); /* Drive number */
+ sz = (bp->b_bcount+511) >> 9;
+ drive = dkunit(bp);
if (drive >= NRL)
goto bad;
if (drive >= NRL)
goto bad;
- ui = rldinfo[drive]; /* Controller uba_device */
if (ui == 0 || ui->ui_alive == 0)
goto bad;
if (bp->b_blkno < 0 ||
(bn = dkblock(bp))+sz > rl02.sizes[partition].nblocks)
goto bad;
if (ui == 0 || ui->ui_alive == 0)
goto bad;
if (bp->b_blkno < 0 ||
(bn = dkblock(bp))+sz > rl02.sizes[partition].nblocks)
goto bad;
/* bn is in 512 byte block size */
bp->b_cylin = bn/rl02.nbpc + rl02.sizes[partition].cyloff;
/* bn is in 512 byte block size */
bp->b_cylin = bn/rl02.nbpc + rl02.sizes[partition].cyloff;
dp = &rlutab[ui->ui_unit];
disksort(dp, bp);
if (dp->b_active == 0) {
dp = &rlutab[ui->ui_unit];
disksort(dp, bp);
if (dp->b_active == 0) {
bp = &ui->ui_mi->um_tab;
if (bp->b_actf && bp->b_active == 0)
bp = &ui->ui_mi->um_tab;
if (bp->b_actf && bp->b_active == 0)
- (void) rlstart(ui->ui_mi);
register struct uba_ctlr *um;
register struct rldevice *rladdr;
daddr_t bn;
register struct uba_ctlr *um;
register struct rldevice *rladdr;
daddr_t bn;
- short cyl, sn, hd, diff;
- dk_busy &= ~(1<<ui->ui_dk); /* Kernel define, drives busy */
+ dk_busy &= ~(1 << ui->ui_dk);
dp = &rlutab[ui->ui_unit];
if ((bp = dp->b_actf) == NULL)
dp = &rlutab[ui->ui_unit];
if ((bp = dp->b_actf) == NULL)
/*
* If the controller is active, just remember
* that this device has to be positioned...
*/
if (um->um_tab.b_active) {
rl_softc[um->um_ctlr].rl_softas |= 1<<ui->ui_slave;
/*
* If the controller is active, just remember
* that this device has to be positioned...
*/
if (um->um_tab.b_active) {
rl_softc[um->um_ctlr].rl_softas |= 1<<ui->ui_slave;
}
/*
* If we have already positioned this drive,
}
/*
* If we have already positioned this drive,
*/
if (dp->b_active)
goto done;
*/
if (dp->b_active)
goto done;
- dp->b_active = 1; /* Posistioning drive */
+ dp->b_active = 1; /* positioning drive */
rladdr = (struct rldevice *)um->um_addr;
/*
rladdr = (struct rldevice *)um->um_addr;
/*
*/
bn = dkblock(bp); /* Block # desired */
/*
*/
bn = dkblock(bp); /* Block # desired */
/*
- * these next two look funky... but we need to map
- * 512 byte logical disk blocks to 256 byte sectors.
- * (rl02's are stupid).
+ * Map 512 byte logical disk blocks
+ * to 256 byte sectors (rl02's are stupid).
- sn = (bn % rl02.nbpt) << 1; /* Sector # desired */
hd = (bn / rl02.nbpt) & 1; /* Get head required */
hd = (bn / rl02.nbpt) & 1; /* Get head required */
diff = (rl_stat[um->um_ctlr].rl_cyl[ui->ui_slave] >> 1) - bp->b_cylin;
if ( diff == 0 && (rl_stat[um->um_ctlr].rl_cyl[ui->ui_slave] & 1) == hd)
goto done; /* on cylinder and head */
diff = (rl_stat[um->um_ctlr].rl_cyl[ui->ui_slave] >> 1) - bp->b_cylin;
if ( diff == 0 && (rl_stat[um->um_ctlr].rl_cyl[ui->ui_slave] & 1) == hd)
goto done; /* on cylinder and head */
/*
* Not at correct position.
*/
/*
* Not at correct position.
*/
rl_stat[um->um_ctlr].rl_cyl[ui->ui_slave] = (bp->b_cylin << 1) | hd;
rl_stat[um->um_ctlr].rl_cyl[ui->ui_slave] = (bp->b_cylin << 1) | hd;
if (diff < 0)
rladdr->rlda.seek = -diff << 7 | RLDA_HGH | hd << 4;
else
if (diff < 0)
rladdr->rlda.seek = -diff << 7 | RLDA_HGH | hd << 4;
else
dk_seek[ui->ui_dk]++;
}
rlwait(rladdr);
dk_seek[ui->ui_dk]++;
}
rlwait(rladdr);
-
- /*
- * fall through since we are now at the correct cylinder
- */
done:
/*
* Device is ready to go.
done:
/*
* Device is ready to go.
um->um_tab.b_actl = dp;
dp->b_active = 2; /* Request on ready queue */
}
um->um_tab.b_actl = dp;
dp->b_active = 2; /* Request on ready queue */
}
short sn, cyl, cmd;
loop:
short sn, cyl, cmd;
loop:
- /*
- * Pull a request off the controller queue
- */
if ((dp = um->um_tab.b_actf) == NULL) {
st->rl_dn = -1;
st->rl_cylnhd = 0;
st->rl_bleft = 0;
st->rl_bpart = 0;
if ((dp = um->um_tab.b_actf) == NULL) {
st->rl_dn = -1;
st->rl_cylnhd = 0;
st->rl_bleft = 0;
st->rl_bpart = 0;
}
if ((bp = dp->b_actf) == NULL) {
um->um_tab.b_actf = dp->b_forw;
}
if ((bp = dp->b_actf) == NULL) {
um->um_tab.b_actf = dp->b_forw;
}
/*
* Mark controller busy, and
}
/*
* Mark controller busy, and
- * determine destinationst.
+ * determine destination.
*/
um->um_tab.b_active++;
ui = rldinfo[dkunit(bp)]; /* Controller */
*/
um->um_tab.b_active++;
ui = rldinfo[dkunit(bp)]; /* Controller */
cyl |= (bn / rl02.nbpt) & 1; /* Get head required */
sn = (bn % rl02.nbpt) << 1; /* Sector number */
rladdr = (struct rldevice *)ui->ui_addr;
cyl |= (bn / rl02.nbpt) & 1; /* Get head required */
sn = (bn % rl02.nbpt) << 1; /* Sector number */
rladdr = (struct rldevice *)ui->ui_addr;
-
- /*
- * Check that controller is ready
- */
-
- /*
- * Setup for the transfer, and get in the
- * UNIBUS adaptor queue.
- */
rladdr->rlda.rw = cyl<<6 | sn;
rladdr->rlda.rw = cyl<<6 | sn;
/* save away current transfers drive status */
st->rl_dn = ui->ui_slave;
st->rl_cylnhd = cyl;
st->rl_bleft = bp->b_bcount;
st->rl_bpart = rl02.btrak - (sn * NRLBPSC);
/* save away current transfers drive status */
st->rl_dn = ui->ui_slave;
st->rl_cylnhd = cyl;
st->rl_bleft = bp->b_bcount;
st->rl_bpart = rl02.btrak - (sn * NRLBPSC);
-
- /* RL02 must seek between cylinders and between tracks */
- /* Determine maximum data transfer at this time */
- if( st->rl_bleft < st->rl_bpart)
+ /*
+ * RL02 must seek between cylinders and between tracks,
+ * determine maximum data transfer at this time.
+ */
+ if (st->rl_bleft < st->rl_bpart)
st->rl_bpart = st->rl_bleft;
st->rl_bpart = st->rl_bleft;
rladdr->rlmp.rw = -(st->rl_bpart >> 1);
if (bp->b_flags & B_READ)
cmd = RL_IE | RL_READ | (ui->ui_slave << 8);
rladdr->rlmp.rw = -(st->rl_bpart >> 1);
if (bp->b_flags & B_READ)
cmd = RL_IE | RL_READ | (ui->ui_slave << 8);
cmd = RL_IE | RL_WRITE | (ui->ui_slave << 8);
um->um_cmd = cmd;
(void) ubago(ui);
cmd = RL_IE | RL_WRITE | (ui->ui_slave << 8);
um->um_cmd = cmd;
(void) ubago(ui);
-/*
- * Now all ready to go, stuff the registers.
- */
rldgo(um)
register struct uba_ctlr *um;
{
register struct rldevice *rladdr = (struct rldevice *)um->um_addr;
rldgo(um)
register struct uba_ctlr *um;
{
register struct rldevice *rladdr = (struct rldevice *)um->um_addr;
-
- /* Place in unibus address for transfer (lower 18 bits of um_ubinfo) */
- /* Then execute instruction */
rladdr->rlba = um->um_ubinfo;
rladdr->rlcs = um->um_cmd|((um->um_ubinfo>>12)&RL_BAE);
}
rladdr->rlba = um->um_ubinfo;
rladdr->rlcs = um->um_cmd|((um->um_ubinfo>>12)&RL_BAE);
}
register unit;
struct rl_softc *rl = &rl_softc[um->um_ctlr];
struct rl_stat *st = &rl_stat[um->um_ctlr];
register unit;
struct rl_softc *rl = &rl_softc[um->um_ctlr];
struct rl_stat *st = &rl_stat[um->um_ctlr];
- int as = rl->rl_softas;
- int needie = 1, waitdry, status;
+ int as = rl->rl_softas, status;
rl->rl_wticks = 0;
rl->rl_softas = 0;
rl->rl_wticks = 0;
rl->rl_softas = 0;
-
- /*
- * Get device and block structures, and a pointer
- * to the uba_device for the drive.
- */
dp = um->um_tab.b_actf;
bp = dp->b_actf;
ui = rldinfo[dkunit(bp)];
dp = um->um_tab.b_actf;
bp = dp->b_actf;
ui = rldinfo[dkunit(bp)];
- dk_busy &= ~(1 << ui->ui_dk); /* Clear busy bit */
+ dk_busy &= ~(1 << ui->ui_dk);
/*
* Check for and process errors on
/*
* Check for and process errors on
*/
if (rladdr->rlcs & RL_ERR) {
u_short err;
*/
if (rladdr->rlcs & RL_ERR) {
u_short err;
/* get staus and reset controller */
rladdr->rlda.getstat = RL_GSTAT;
rladdr->rlcs = (ui->ui_slave << 8) | RL_GETSTAT;
rlwait(rladdr);
status = rladdr->rlmp.getstat;
/* get staus and reset controller */
rladdr->rlda.getstat = RL_GSTAT;
rladdr->rlcs = (ui->ui_slave << 8) | RL_GETSTAT;
rlwait(rladdr);
status = rladdr->rlmp.getstat;
/* reset drive */
rladdr->rlda.getstat = RL_RESET;
rladdr->rlcs = (ui->ui_slave <<8) | RL_GETSTAT; /* Get status*/
rlwait(rladdr);
/* reset drive */
rladdr->rlda.getstat = RL_RESET;
rladdr->rlcs = (ui->ui_slave <<8) | RL_GETSTAT; /* Get status*/
rlwait(rladdr);
-
- if ( (status & RLMP_WL) == RLMP_WL ) {
+ if ((status & RLMP_WL) == RLMP_WL) {
/*
* Give up on write protected devices
* immediately.
/*
* Give up on write protected devices
* immediately.
* After 10 retries give up.
*/
harderr(bp, "rl");
* After 10 retries give up.
*/
harderr(bp, "rl");
- printf("cs=%b mp=%b\n",
- err, RLCS_BITS, status, RLER_BITS);
-
+ printf("cs=%b mp=%b\n", err, RLCS_BITS,
+ status, RLER_BITS);
bp->b_flags |= B_ERROR;
} else
um->um_tab.b_active = 0; /* force retry */
bp->b_flags |= B_ERROR;
} else
um->um_tab.b_active = 0; /* force retry */
-
- /* Determine disk posistion */
+ /* determine disk position */
rladdr->rlcs = (ui->ui_slave << 8) | RL_RHDR;
rlwait(rladdr);
rladdr->rlcs = (ui->ui_slave << 8) | RL_RHDR;
rlwait(rladdr);
-
- /* save disk drive posistion */
- st->rl_cyl[ui->ui_slave] = (rladdr->rlmp.readhdr & 0177700) >> 6;
+ /* save disk drive position */
+ st->rl_cyl[ui->ui_slave] =
+ (rladdr->rlmp.readhdr & 0177700) >> 6;
/*
* If still ``active'', then don't need any more retries.
*/
if (um->um_tab.b_active) {
/* RL02 check if more data from previous request */
/*
* If still ``active'', then don't need any more retries.
*/
if (um->um_tab.b_active) {
/* RL02 check if more data from previous request */
- if ( (bp->b_flags & B_ERROR) == 0 &&
- (st->rl_bleft -= st->rl_bpart) > 0 ) {
+ if ((bp->b_flags & B_ERROR) == 0 &&
+ (int)(st->rl_bleft -= st->rl_bpart) > 0) {
- * the following code was modeled from the rk07
+ * The following code was modeled from the rk07
* driver when an ECC error occured. It has to
* fix the bits then restart the transfer which is
* what we have to do (restart transfer).
*/
int reg, npf, o, cmd, ubaddr, diff, head;
* driver when an ECC error occured. It has to
* fix the bits then restart the transfer which is
* what we have to do (restart transfer).
*/
int reg, npf, o, cmd, ubaddr, diff, head;
/* seek to next head/track */
/* seek to next head/track */
/* increment head and/or cylinder */
st->rl_cylnhd++;
diff = (st->rl_cyl[ui->ui_slave] >> 1) -
(st->rl_cylnhd >> 1);
st->rl_cyl[ui->ui_slave] = st->rl_cylnhd;
head = st->rl_cylnhd & 1;
/* increment head and/or cylinder */
st->rl_cylnhd++;
diff = (st->rl_cyl[ui->ui_slave] >> 1) -
(st->rl_cylnhd >> 1);
st->rl_cyl[ui->ui_slave] = st->rl_cylnhd;
head = st->rl_cylnhd & 1;
- rlwait( rladdr );
-
- if ( diff < 0 )
- rladdr->rlda.seek = -diff << 7 | RLDA_HGH | head << 4;
+ rlwait(rladdr);
+ if (diff < 0)
+ rladdr->rlda.seek =
+ -diff << 7 | RLDA_HGH | head << 4;
- rladdr->rlda.seek = diff << 7 | RLDA_LOW | head << 4;
+ rladdr->rlda.seek =
+ diff << 7 | RLDA_LOW | head << 4;
rladdr->rlcs = (ui->ui_slave << 8) | RL_SEEK;
rladdr->rlcs = (ui->ui_slave << 8) | RL_SEEK;
npf = btop( bp->b_bcount - st->rl_bleft );
reg = btop(um->um_ubinfo&0x3ffff) + npf;
o = (int)bp->b_un.b_addr & PGOFSET;
ubapurge(um);
um->um_tab.b_active++;
npf = btop( bp->b_bcount - st->rl_bleft );
reg = btop(um->um_ubinfo&0x3ffff) + npf;
o = (int)bp->b_un.b_addr & PGOFSET;
ubapurge(um);
um->um_tab.b_active++;
rladdr->rlda.rw = st->rl_cylnhd << 6;
rladdr->rlda.rw = st->rl_cylnhd << 6;
- if ( st->rl_bleft < (st->rl_bpart = rl02.btrak) )
+ if (st->rl_bleft < (st->rl_bpart = rl02.btrak))
st->rl_bpart = st->rl_bleft;
rladdr->rlmp.rw = -(st->rl_bpart >> 1);
cmd = (bp->b_flags&B_READ ? RL_READ : RL_WRITE) |
st->rl_bpart = st->rl_bleft;
rladdr->rlmp.rw = -(st->rl_bpart >> 1);
cmd = (bp->b_flags&B_READ ? RL_READ : RL_WRITE) |
- RL_IE | (ui->ui_slave << 8);
+ RL_IE | (ui->ui_slave << 8);
ubaddr = (int)ptob(reg) + o;
cmd |= ((ubaddr >> 12) & RL_BAE);
ubaddr = (int)ptob(reg) + o;
cmd |= ((ubaddr >> 12) & RL_BAE);
rladdr->rlba = ubaddr;
rladdr->rlcs = cmd;
return;
}
rladdr->rlba = ubaddr;
rladdr->rlcs = cmd;
return;
}
um->um_tab.b_active = 0;
um->um_tab.b_errcnt = 0;
dp->b_active = 0;
dp->b_errcnt = 0;
um->um_tab.b_active = 0;
um->um_tab.b_errcnt = 0;
dp->b_active = 0;
dp->b_errcnt = 0;
/* "b_resid" words remaining after error */
bp->b_resid = st->rl_bleft;
um->um_tab.b_actf = dp->b_forw;
dp->b_actf = bp->av_forw;
/* "b_resid" words remaining after error */
bp->b_resid = st->rl_bleft;
um->um_tab.b_actf = dp->b_forw;
dp->b_actf = bp->av_forw;
st->rl_dn = -1;
st->rl_bpart = st->rl_bleft = 0;
iodone(bp);
st->rl_dn = -1;
st->rl_bpart = st->rl_bleft = 0;
iodone(bp);
* then start it up right away.
*/
if (dp->b_actf)
* then start it up right away.
*/
if (dp->b_actf)
- if (rlustart(ui))
- needie = 0;
as &= ~(1<<ui->ui_slave);
} else
as |= (1<<ui->ui_slave);
as &= ~(1<<ui->ui_slave);
} else
as |= (1<<ui->ui_slave);
- /*
- * Release unibus resources and flush data paths.
- */
/* reset state info */
st->rl_dn = -1;
st->rl_cylnhd = st->rl_bpart = st->rl_bleft = 0;
/* reset state info */
st->rl_dn = -1;
st->rl_cylnhd = st->rl_bpart = st->rl_bleft = 0;
/*
* Process other units which need attention.
* For each unit which needs attention, call
/*
* Process other units which need attention.
* For each unit which needs attention, call
while (unit = ffs(as)) {
unit--; /* was 1 origin */
as &= ~(1<<unit);
while (unit = ffs(as)) {
unit--; /* was 1 origin */
as &= ~(1<<unit);
- (void) rlustart(rlip[rl21][unit]);
+ rlustart(rlip[rl21][unit]);
}
/*
* If the controller is not transferring, but
}
/*
* If the controller is not transferring, but
* the controller.
*/
if (um->um_tab.b_actf && um->um_tab.b_active == 0)
* the controller.
*/
if (um->um_tab.b_actf && um->um_tab.b_active == 0)
{
while ((rladdr->rlcs & RL_CRDY) == 0)
{
while ((rladdr->rlcs & RL_CRDY) == 0)
register struct uba_device *ui;
register struct rldevice *rladdr;
register struct rl_stat *st;
register struct uba_device *ui;
register struct rldevice *rladdr;
register struct rl_stat *st;
- register int rl21, unit;
+ register int rl21, unit;
for (rl21 = 0; rl21 < NHL; rl21++) {
if ((um = rlminfo[rl21]) == 0 || um->um_ubanum != uban ||
um->um_alive == 0)
continue;
for (rl21 = 0; rl21 < NHL; rl21++) {
if ((um = rlminfo[rl21]) == 0 || um->um_ubanum != uban ||
um->um_alive == 0)
continue;
- printf(" Reset hl%d", rl21);
rladdr = (struct rldevice *)um->um_addr;
st = &rl_stat[rl21];
um->um_tab.b_active = 0;
rladdr = (struct rldevice *)um->um_addr;
st = &rl_stat[rl21];
um->um_tab.b_active = 0;
printf("<%d>", (um->um_ubinfo>>28)&0xf);
um->um_ubinfo = 0;
}
printf("<%d>", (um->um_ubinfo>>28)&0xf);
um->um_ubinfo = 0;
}
/* reset controller */
st->rl_dn = -1;
st->rl_cylnhd = 0;
st->rl_bleft = 0;
st->rl_bpart = 0;
rlwait(rladdr);
/* reset controller */
st->rl_dn = -1;
st->rl_cylnhd = 0;
st->rl_bleft = 0;
st->rl_bpart = 0;
rlwait(rladdr);
for (unit = 0; unit < NRL; unit++) {
rladdr->rlcs = (unit << 8) | RL_GETSTAT;
rlwait(rladdr);
for (unit = 0; unit < NRL; unit++) {
rladdr->rlcs = (unit << 8) | RL_GETSTAT;
rlwait(rladdr);
/* Determine disk posistion */
rladdr->rlcs = (unit << 8) | RL_RHDR;
rlwait(rladdr);
/* Determine disk posistion */
rladdr->rlcs = (unit << 8) | RL_RHDR;
rlwait(rladdr);
/* save disk drive posistion */
st->rl_cyl[unit] =
(rladdr->rlmp.readhdr & 0177700) >> 6;
/* save disk drive posistion */
st->rl_cyl[unit] =
(rladdr->rlmp.readhdr & 0177700) >> 6;
if ((ui = rldinfo[unit]) == 0)
continue;
if (ui->ui_alive == 0 || ui->ui_mi != um)
continue;
rlutab[unit].b_active = 0;
if ((ui = rldinfo[unit]) == 0)
continue;
if (ui->ui_alive == 0 || ui->ui_mi != um)
continue;
rlutab[unit].b_active = 0;
- /* don't think there is room on swap for it anyway. */
-}
-
-rlsize(dev)
- dev_t dev;
-{
- int unit = minor(dev) >> 3;
- struct uba_device *ui;
- struct rlst *st;
- if (unit >= NRL || (ui = rldinfo[unit]) == 0 || ui->ui_alive == 0)
- return (-1);
- st = &rl02;
- return (st->sizes[minor(dev) & 07].nblocks);
+ /* don't think there is room on swap for it anyway. */
-/* rlreg.h 4.1 83/02/08 */
+/* rlreg.h 4.2 83/06/13 */
struct rldevice {
short rlcs; /* control status */
struct rldevice {
short rlcs; /* control status */
/* mp_rhc */
#define RLMP_SA 0000077 /* sector address */
/* mp_rhc */
#define RLMP_SA 0000077 /* sector address */
-#define RLMP_HS 0000100 /* head select
- 0 upper head
- 1 lower head */
#define RLMP_CA 0177600 /* cylinder address */
/* check these bits after a get status and reset */
#define RLMP_CA 0177600 /* cylinder address */
/* check these bits after a get status and reset */
-/* Locore.c 4.24 83/05/27 */
+/* Locore.c 4.25 83/06/13 */
#include "dz.h"
#include "mba.h"
#include "dz.h"
#include "mba.h"
#include "../h/buf.h"
#include "../h/msgbuf.h"
#include "../h/mbuf.h"
#include "../h/buf.h"
#include "../h/msgbuf.h"
#include "../h/mbuf.h"
+#include "../h/protosw.h"
+#include "../h/domain.h"
#include "../vax/nexus.h"
#include "../vaxuba/ubavar.h"
#include "../vax/nexus.h"
#include "../vaxuba/ubavar.h"
lowinit()
{
extern int dumpmag;
lowinit()
{
extern int dumpmag;
+ extern struct domain unixdomain;
+#ifdef PUP
+ extern struct domain pupdomain;
+#endif
+#ifdef INET
+ extern struct domain inetdomain;
+#endif
+#include "imp.h"
+#if NIMP > 0
+ extern struct domain impdomain;
+#endif
+ /* cpp messes these up for lint so put them here */
+ unixdomain.dom_next = domains;
+ domains = &unixdomain;
+#ifdef PUP
+ pupdomain.dom_next = domains;
+ domains = &pupdomain;
+#endif
+#ifdef INET
+ inetdomain.dom_next = domains;
+ domains = &inetdomain;
+#endif
+#if NIMP > 0
+ impdomain.dom_next = domains;
+ domains = &impdomain;
+#endif
dumpmag = 0; /* used only by savecore */
/*
dumpmag = 0; /* used only by savecore */
/*
-/* machdep.c 4.80 83/06/09 */
+/* machdep.c 4.81 83/06/13 */
#include "../machine/reg.h"
#include "../machine/pte.h"
#include "../machine/reg.h"
#include "../machine/pte.h"
u.u_code = 0;
} else
*usp++ = 0;
u.u_code = 0;
} else
*usp++ = 0;
- *usp++ = (int)(usp + 2);
+ *usp = (int)(usp + 2); usp++;
*usp++ = (int)p;
/* struct sigcontext used for the inward return */
*usp++ = oonstack;
*usp++ = (int)p;
/* struct sigcontext used for the inward return */
*usp++ = oonstack;