summaryrefslogtreecommitdiff
path: root/sys/dev/puc
diff options
context:
space:
mode:
authorMax Khon <fjoe@FreeBSD.org>2012-07-31 05:23:23 +0000
committerMax Khon <fjoe@FreeBSD.org>2012-07-31 05:23:23 +0000
commit51cb024f1fada9df80cf3a2457039dbfa8e1b33b (patch)
tree3bd6255fe8340bc7da92e1dc590184974b7867da /sys/dev/puc
parent1d35c178d89692c080401d14aa04ea87109a5622 (diff)
Notes
Diffstat (limited to 'sys/dev/puc')
-rw-r--r--sys/dev/puc/puc_cfg.h2
-rw-r--r--sys/dev/puc/pucdata.c19
2 files changed, 15 insertions, 6 deletions
diff --git a/sys/dev/puc/puc_cfg.h b/sys/dev/puc/puc_cfg.h
index f4969f641d13..4c2c65ee3bbd 100644
--- a/sys/dev/puc/puc_cfg.h
+++ b/sys/dev/puc/puc_cfg.h
@@ -79,7 +79,7 @@ struct puc_cfg {
int8_t ports;
int8_t rid; /* Rid of first port */
int8_t d_rid; /* Delta rid of next ports */
- int16_t d_ofs; /* Delta offset of next ports */
+ int8_t d_ofs; /* Delta offset of next ports */
puc_config_f *config_function;
};
diff --git a/sys/dev/puc/pucdata.c b/sys/dev/puc/pucdata.c
index 4040a2f25beb..54577abe7dec 100644
--- a/sys/dev/puc/pucdata.c
+++ b/sys/dev/puc/pucdata.c
@@ -510,13 +510,15 @@ const struct puc_cfg puc_pci_devices[] = {
{ 0x1393, 0x1024, 0xffff, 0,
"Moxa Technologies, Smartio CP-102E/PCIe",
DEFAULT_RCLK * 8,
- PUC_PORT_2S, 0x14, 0, 0x200
+ PUC_PORT_2S, 0x14, 0, -1,
+ .config_function = puc_config_moxa
},
{ 0x1393, 0x1025, 0xffff, 0,
"Moxa Technologies, Smartio CP-102EL/PCIe",
DEFAULT_RCLK * 8,
- PUC_PORT_2S, 0x14, 0, 0x200,
+ PUC_PORT_2S, 0x14, 0, -1,
+ .config_function = puc_config_moxa
},
{ 0x1393, 0x1040, 0xffff, 0,
@@ -572,7 +574,8 @@ const struct puc_cfg puc_pci_devices[] = {
{ 0x1393, 0x1182, 0xffff, 0,
"Moxa Technologies, Smartio CP-118EL-A/PCIe",
DEFAULT_RCLK * 8,
- PUC_PORT_8S, 0x14, 0, 0x200,
+ PUC_PORT_8S, 0x14, 0, -1,
+ .config_function = puc_config_moxa
},
{ 0x1393, 0x1680, 0xffff, 0,
@@ -596,7 +599,8 @@ const struct puc_cfg puc_pci_devices[] = {
{ 0x1393, 0x1683, 0xffff, 0,
"Moxa Technologies, Smartio CP-168EL-A/PCIe",
DEFAULT_RCLK * 8,
- PUC_PORT_8S, 0x14, 0, 0x200,
+ PUC_PORT_8S, 0x14, 0, -1,
+ .config_function = puc_config_moxa
},
{ 0x13a8, 0x0152, 0xffff, 0,
@@ -1159,7 +1163,12 @@ puc_config_moxa(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
intptr_t *res)
{
if (cmd == PUC_CFG_GET_OFS) {
- *res = ((port == 3) ? 7 : port) * 0x200;
+ const struct puc_cfg *cfg = sc->sc_cfg;
+
+ if (port == 3 && (cfg->device == 0x1045 || cfg->device == 0x1144))
+ port = 7;
+ *res = port * 0x200;
+
return 0;
}
return (ENXIO);