aboutsummaryrefslogtreecommitdiffstats
path: root/comms
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2005-06-23 03:07:52 +0800
committerimp <imp@FreeBSD.org>2005-06-23 03:07:52 +0800
commita41811cc18ce37d3f2d0f84a44ff7fe2e238b7fd (patch)
tree4799dd110b0b0275e0caafb08feeff6bf617272d /comms
parent7b1edb6ab3765d44e405970628d80bf32d4ef51f (diff)
downloadfreebsd-ports-gnome-a41811cc18ce37d3f2d0f84a44ff7fe2e238b7fd.tar.gz
freebsd-ports-gnome-a41811cc18ce37d3f2d0f84a44ff7fe2e238b7fd.tar.zst
freebsd-ports-gnome-a41811cc18ce37d3f2d0f84a44ff7fe2e238b7fd.zip
Use new PCI_BAR(x) macro everywhere in preference to the PCI_MAPS + x * 4
used before. PCI_MAPS has disappeared. If PCI_BAR(x) doesn't exist, define it to the old expansion. Reviewed by: jhb
Diffstat (limited to 'comms')
-rw-r--r--comms/ltmdm/files/patch-sys-dev-ltmdm-ltmdmsio.c88
1 files changed, 55 insertions, 33 deletions
diff --git a/comms/ltmdm/files/patch-sys-dev-ltmdm-ltmdmsio.c b/comms/ltmdm/files/patch-sys-dev-ltmdm-ltmdmsio.c
index d05642e03d4c..0796b82487c9 100644
--- a/comms/ltmdm/files/patch-sys-dev-ltmdm-ltmdmsio.c
+++ b/comms/ltmdm/files/patch-sys-dev-ltmdm-ltmdmsio.c
@@ -1,5 +1,5 @@
---- sys/dev/ltmdm/ltmdmsio.c.orig Tue Mar 12 04:47:31 2002
-+++ sys/dev/ltmdm/ltmdmsio.c Mon Mar 21 15:57:38 2005
+--- sys/dev/ltmdm/ltmdmsio.c.orig Mon Mar 11 18:47:31 2002
++++ sys/dev/ltmdm/ltmdmsio.c Wed Jun 22 13:06:35 2005
@@ -60,7 +60,9 @@
#include <sys/proc.h>
#include <sys/module.h>
@@ -43,7 +43,7 @@
#include <dev/sio/sioreg.h>
#else
#include <isa/sioreg.h>
-@@ -124,9 +137,11 @@
+@@ -124,10 +137,15 @@
#endif
#if __FreeBSD_version >= 500023 /* >= 20010912 */
@@ -54,9 +54,13 @@
#endif
+#endif
++#ifndef PCI_BAR
++#define PCI_BAR(x) PCI_MAPS + (x) * 4
++#endif
#define LOTS_OF_EVENTS 64 /* helps separate urgent events from input */
-@@ -230,7 +245,9 @@
+
+@@ -230,7 +248,9 @@
u_char last_modem_status; /* last MSR read by intr handler */
u_char prev_modem_status; /* last MSR handled by high level */
@@ -66,7 +70,7 @@
u_char *ibuf; /* start of input buffer */
u_char *ibufend; /* end of input buffer */
u_char *ibufold; /* old input buffer, to be freed */
-@@ -256,7 +273,9 @@
+@@ -256,7 +276,9 @@
bool_t do_dcd_timestamp;
struct timeval timestamp;
struct timeval dcd_timestamp;
@@ -76,7 +80,7 @@
u_long bytes_in; /* statistics */
u_long bytes_out;
-@@ -268,7 +287,11 @@
+@@ -268,7 +290,11 @@
struct resource *iores[6];
struct resource *irqres;
void *cookie;
@@ -88,7 +92,7 @@
/*
* Data area for output buffers. Someday we should build the output
-@@ -352,6 +375,7 @@
+@@ -352,6 +378,7 @@
#endif
static struct cdevsw sio_cdevsw = {
@@ -96,7 +100,7 @@
/* open */ sioopen,
/* close */ sioclose,
/* read */ sioread,
-@@ -361,7 +385,11 @@
+@@ -361,7 +388,11 @@
/* mmap */ nommap,
/* strategy */ nostrategy,
/* name */ driver_name,
@@ -108,7 +112,7 @@
/* dump */ nodump,
/* psize */ nopsize,
#if __FreeBSD_version < 430000
-@@ -373,10 +401,32 @@
+@@ -373,10 +404,32 @@
/* bmaj */ -1,
/* kqfilter */ ttykqfilter,
#else /* __FreeBSD_version >= 500000 */
@@ -142,7 +146,7 @@
};
static u_int com_events; /* input chars + weighted output completions */
-@@ -566,8 +616,8 @@
+@@ -566,8 +619,8 @@
u_int32_t Get_PCI_BASE_ADDRESS_IO_MASK(void);
u_int8_t Get_PCI_BASE_ADDRESS_SPACE_IO(void);
u_int32_t VMODEM_Get_System_Time(void);
@@ -153,7 +157,16 @@
u_int16_t inpw(u_int16_t addr);
void outpw(u_int16_t addr, u_int16_t value);
u_int32_t inpd(u_int16_t addr);
-@@ -836,12 +886,12 @@
+@@ -695,7 +748,7 @@
+
+ for (i = 0; i < 6; i++) {
+ dev_info->BaseAddress[i]
+- = pci_read_config(lt_dev, PCIR_MAPS + i * 4, 4);
++ = pci_read_config(lt_dev, PCIR_BAR(i), 4);
+ DPRINTF(1,(" BaseAddress[%d] = 0x%08lx\n",
+ i, dev_info->BaseAddress[i]));
+ }
+@@ -836,12 +889,12 @@
return t;
}
@@ -168,7 +181,7 @@
{
outb(addr, value);
}
-@@ -968,8 +1018,6 @@
+@@ -968,8 +1021,6 @@
{
{ SWI_TTY , "SWI_TTY" },
{ SWI_NET , "SWI_NET" },
@@ -177,7 +190,16 @@
{ -1 , NULL }
};
-@@ -1295,8 +1343,11 @@
+@@ -1175,7 +1226,7 @@
+
+ found = 0;
+ for (i = 0; i < 6; i++) {
+- com->iorid[i] = PCIR_MAPS + 4 * i;
++ com->iorid[i] = PCIR_BAR(i);
+ data = pci_read_config(dev, com->iorid[i], 4);
+ if (((data & 0x01UL) == 0x01) &&
+ ((data & ~0x03UL) != 0 )) {
+@@ -1295,8 +1346,11 @@
DPRINTF(1,(" x_chip_version = %d\n", x_chip_version));
com->flags = flags;
@@ -189,7 +211,7 @@
/*
* initialize the device registers as follows:
-@@ -1433,11 +1484,19 @@
+@@ -1433,11 +1487,19 @@
s = splfunc();
if (tp) {
@@ -209,7 +231,7 @@
}
vxdPortClose();
siosettimeout();
-@@ -1470,7 +1529,11 @@
+@@ -1470,7 +1532,11 @@
}
static int
@@ -221,7 +243,7 @@
{
struct com_s *com;
int error;
-@@ -1610,7 +1673,11 @@
+@@ -1610,7 +1676,11 @@
* the true carrier.
*/
if (com->prev_modem_status & MSR_DCD || mynor & CALLOUT_MASK)
@@ -233,7 +255,7 @@
}
/*
* Wait for DCD if necessary.
-@@ -1626,7 +1693,11 @@
+@@ -1626,7 +1696,11 @@
goto out;
goto open_top;
}
@@ -245,7 +267,7 @@
disc_optim(tp, &tp->t_termios, com);
if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK)
com->active_out = TRUE;
-@@ -1639,7 +1710,11 @@
+@@ -1639,7 +1713,11 @@
}
static int
@@ -257,7 +279,7 @@
{
struct com_s *com;
int mynor;
-@@ -1654,11 +1729,19 @@
+@@ -1654,11 +1732,19 @@
return (ENODEV);
tp = com->tp;
s = splfunc();
@@ -277,7 +299,7 @@
siosettimeout();
splx(s);
if (com->gone) {
-@@ -1685,7 +1768,9 @@
+@@ -1685,7 +1771,9 @@
s = splfunc();
com->do_timestamp = FALSE;
com->do_dcd_timestamp = FALSE;
@@ -287,7 +309,7 @@
write_vuart_port(UART_CFCR, com->cfcr_image &= ~CFCR_SBREAK);
{
write_vuart_port(UART_IER, 0);
-@@ -1724,7 +1809,11 @@
+@@ -1724,7 +1812,11 @@
}
static int
@@ -299,7 +321,7 @@
{
int mynor;
struct com_s *com;
-@@ -1735,11 +1824,19 @@
+@@ -1735,11 +1827,19 @@
com = com_addr(MINOR_TO_UNIT(mynor));
if (com == NULL || com->gone)
return (ENODEV);
@@ -319,7 +341,7 @@
{
int mynor;
struct com_s *com;
-@@ -1754,7 +1851,11 @@
+@@ -1754,7 +1854,11 @@
if (com == NULL || com->gone)
return (ENODEV);
@@ -331,7 +353,7 @@
}
static void
-@@ -1860,7 +1961,11 @@
+@@ -1860,7 +1964,11 @@
if (line_status & LSR_PE)
recv_data |= TTY_PE;
}
@@ -343,7 +365,7 @@
lt_disable_intr();
} while (buf < com->iptr);
}
-@@ -1894,23 +1999,34 @@
+@@ -1894,23 +2002,34 @@
u_char recv_data;
u_char int_ctl;
u_char int_ctl_new;
@@ -378,7 +400,7 @@
line_status = read_vuart_port(UART_LSR);
/* input event? (check first to help avoid overruns) */
-@@ -1948,7 +2064,11 @@
+@@ -1948,7 +2067,11 @@
recv_data = 0;
}
++com->bytes_in;
@@ -390,7 +412,7 @@
setsofttty();
ioptr = com->iptr;
if (ioptr >= com->ibufend)
-@@ -2053,7 +2173,11 @@
+@@ -2053,7 +2176,11 @@
}
static int
@@ -402,7 +424,7 @@
{
struct com_s *com;
int error;
-@@ -2134,7 +2258,11 @@
+@@ -2134,7 +2261,11 @@
if (lt->c_ospeed != 0)
dt->c_ospeed = tp->t_ospeed;
}
@@ -414,7 +436,7 @@
if (error != ENOIOCTL)
return (error);
s = splfunc();
-@@ -2189,13 +2317,17 @@
+@@ -2189,13 +2320,17 @@
com->do_timestamp = TRUE;
*(struct timeval *)data = com->timestamp;
break;
@@ -432,7 +454,7 @@
if (error == ENODEV)
error = ENOTTY;
return (error);
-@@ -2257,8 +2389,13 @@
+@@ -2257,8 +2392,13 @@
com->state &= ~CS_CHECKMSR;
lt_enable_intr();
if (delta_modem_status & MSR_DCD)
@@ -446,7 +468,7 @@
}
if (com->state & CS_ODONE) {
lt_disable_intr();
-@@ -2270,7 +2407,11 @@
+@@ -2270,7 +2410,11 @@
sio_busycheck_handle = timeout(siobusycheck, com, hz / 100);
com->extra_state |= CSE_BUSYCHECK;
}
@@ -458,7 +480,7 @@
}
if (com_events == 0)
break;
-@@ -2769,11 +2910,21 @@
+@@ -2769,11 +2913,21 @@
&& (!(t->c_iflag & PARMRK)
|| (t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK))
&& !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN))
@@ -480,7 +502,7 @@
}
#ifdef KLD_MODULE
-@@ -2796,7 +2947,7 @@
+@@ -2796,7 +2950,7 @@
#endif
DRIVER_MODULE(ltmdm, pci, ltmdm_pci_driver, ltmdm_devclass, ltmdm_event, 0);