diff options
Diffstat (limited to 'drivers/char/rio/rio_linux.c')
-rw-r--r-- | drivers/char/rio/rio_linux.c | 70 |
1 files changed, 10 insertions, 60 deletions
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c index f1e9e9a20c85..78dd856534ce 100644 --- a/drivers/char/rio/rio_linux.c +++ b/drivers/char/rio/rio_linux.c | |||
@@ -57,15 +57,12 @@ | |||
57 | #include <asm/uaccess.h> | 57 | #include <asm/uaccess.h> |
58 | 58 | ||
59 | #include "linux_compat.h" | 59 | #include "linux_compat.h" |
60 | #include "typdef.h" | ||
61 | #include "pkt.h" | 60 | #include "pkt.h" |
62 | #include "daemon.h" | 61 | #include "daemon.h" |
63 | #include "rio.h" | 62 | #include "rio.h" |
64 | #include "riospace.h" | 63 | #include "riospace.h" |
65 | #include "top.h" | ||
66 | #include "cmdpkt.h" | 64 | #include "cmdpkt.h" |
67 | #include "map.h" | 65 | #include "map.h" |
68 | #include "riotypes.h" | ||
69 | #include "rup.h" | 66 | #include "rup.h" |
70 | #include "port.h" | 67 | #include "port.h" |
71 | #include "riodrvr.h" | 68 | #include "riodrvr.h" |
@@ -78,17 +75,13 @@ | |||
78 | #include "unixrup.h" | 75 | #include "unixrup.h" |
79 | #include "board.h" | 76 | #include "board.h" |
80 | #include "host.h" | 77 | #include "host.h" |
81 | #include "error.h" | ||
82 | #include "phb.h" | 78 | #include "phb.h" |
83 | #include "link.h" | 79 | #include "link.h" |
84 | #include "cmdblk.h" | 80 | #include "cmdblk.h" |
85 | #include "route.h" | 81 | #include "route.h" |
86 | #include "control.h" | ||
87 | #include "cirrus.h" | 82 | #include "cirrus.h" |
88 | #include "rioioctl.h" | 83 | #include "rioioctl.h" |
89 | #include "param.h" | 84 | #include "param.h" |
90 | #include "list.h" | ||
91 | #include "sam.h" | ||
92 | #include "protsts.h" | 85 | #include "protsts.h" |
93 | #include "rioboard.h" | 86 | #include "rioboard.h" |
94 | 87 | ||
@@ -350,27 +343,9 @@ int rio_minor(struct tty_struct *tty) | |||
350 | return tty->index + (tty->driver == rio_driver) ? 0 : 256; | 343 | return tty->index + (tty->driver == rio_driver) ? 0 : 256; |
351 | } | 344 | } |
352 | 345 | ||
353 | int rio_ismodem(struct tty_struct *tty) | ||
354 | { | ||
355 | return 1; | ||
356 | } | ||
357 | |||
358 | |||
359 | static int rio_set_real_termios(void *ptr) | 346 | static int rio_set_real_termios(void *ptr) |
360 | { | 347 | { |
361 | int rv, modem; | 348 | return RIOParam((struct Port *) ptr, CONFIG, 1, 1); |
362 | struct tty_struct *tty; | ||
363 | func_enter(); | ||
364 | |||
365 | tty = ((struct Port *) ptr)->gs.tty; | ||
366 | |||
367 | modem = rio_ismodem(tty); | ||
368 | |||
369 | rv = RIOParam((struct Port *) ptr, CONFIG, modem, 1); | ||
370 | |||
371 | func_exit(); | ||
372 | |||
373 | return rv; | ||
374 | } | 349 | } |
375 | 350 | ||
376 | 351 | ||
@@ -973,7 +948,6 @@ static int __init rio_init(void) | |||
973 | 948 | ||
974 | #ifdef CONFIG_PCI | 949 | #ifdef CONFIG_PCI |
975 | struct pci_dev *pdev = NULL; | 950 | struct pci_dev *pdev = NULL; |
976 | unsigned int tint; | ||
977 | unsigned short tshort; | 951 | unsigned short tshort; |
978 | #endif | 952 | #endif |
979 | 953 | ||
@@ -998,6 +972,8 @@ static int __init rio_init(void) | |||
998 | #ifdef CONFIG_PCI | 972 | #ifdef CONFIG_PCI |
999 | /* First look for the JET devices: */ | 973 | /* First look for the JET devices: */ |
1000 | while ((pdev = pci_get_device(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, pdev))) { | 974 | while ((pdev = pci_get_device(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_SX_XIO_IO8, pdev))) { |
975 | u32 tint; | ||
976 | |||
1001 | if (pci_enable_device(pdev)) | 977 | if (pci_enable_device(pdev)) |
1002 | continue; | 978 | continue; |
1003 | 979 | ||
@@ -1008,7 +984,6 @@ static int __init rio_init(void) | |||
1008 | Also, reading a non-aligned dword doesn't work. So we read the | 984 | Also, reading a non-aligned dword doesn't work. So we read the |
1009 | whole dword at 0x2c and extract the word at 0x2e (SUBSYSTEM_ID) | 985 | whole dword at 0x2c and extract the word at 0x2e (SUBSYSTEM_ID) |
1010 | ourselves */ | 986 | ourselves */ |
1011 | /* I don't know why the define doesn't work, constant 0x2c does --REW */ | ||
1012 | pci_read_config_dword(pdev, 0x2c, &tint); | 987 | pci_read_config_dword(pdev, 0x2c, &tint); |
1013 | tshort = (tint >> 16) & 0xffff; | 988 | tshort = (tint >> 16) & 0xffff; |
1014 | rio_dprintk(RIO_DEBUG_PROBE, "Got a specialix card: %x.\n", tint); | 989 | rio_dprintk(RIO_DEBUG_PROBE, "Got a specialix card: %x.\n", tint); |
@@ -1018,10 +993,8 @@ static int __init rio_init(void) | |||
1018 | } | 993 | } |
1019 | rio_dprintk(RIO_DEBUG_PROBE, "cp1\n"); | 994 | rio_dprintk(RIO_DEBUG_PROBE, "cp1\n"); |
1020 | 995 | ||
1021 | pci_read_config_dword(pdev, PCI_BASE_ADDRESS_2, &tint); | ||
1022 | |||
1023 | hp = &p->RIOHosts[p->RIONumHosts]; | 996 | hp = &p->RIOHosts[p->RIONumHosts]; |
1024 | hp->PaddrP = tint & PCI_BASE_ADDRESS_MEM_MASK; | 997 | hp->PaddrP = pci_resource_start(pdev, 2); |
1025 | hp->Ivec = pdev->irq; | 998 | hp->Ivec = pdev->irq; |
1026 | if (((1 << hp->Ivec) & rio_irqmask) == 0) | 999 | if (((1 << hp->Ivec) & rio_irqmask) == 0) |
1027 | hp->Ivec = 0; | 1000 | hp->Ivec = 0; |
@@ -1035,7 +1008,7 @@ static int __init rio_init(void) | |||
1035 | rio_start_card_running(hp); | 1008 | rio_start_card_running(hp); |
1036 | 1009 | ||
1037 | rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr); | 1010 | rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr); |
1038 | if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == RIO_SUCCESS) { | 1011 | if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == 0) { |
1039 | rio_dprintk(RIO_DEBUG_INIT, "Done RIOBoardTest\n"); | 1012 | rio_dprintk(RIO_DEBUG_INIT, "Done RIOBoardTest\n"); |
1040 | writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); | 1013 | writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); |
1041 | p->RIOHosts[p->RIONumHosts].UniqueNum = | 1014 | p->RIOHosts[p->RIONumHosts].UniqueNum = |
@@ -1044,7 +1017,7 @@ static int __init rio_init(void) | |||
1044 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); | 1017 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); |
1045 | 1018 | ||
1046 | fix_rio_pci(pdev); | 1019 | fix_rio_pci(pdev); |
1047 | p->RIOLastPCISearch = RIO_SUCCESS; | 1020 | p->RIOLastPCISearch = 0; |
1048 | p->RIONumHosts++; | 1021 | p->RIONumHosts++; |
1049 | found++; | 1022 | found++; |
1050 | } else { | 1023 | } else { |
@@ -1067,10 +1040,8 @@ static int __init rio_init(void) | |||
1067 | continue; | 1040 | continue; |
1068 | 1041 | ||
1069 | #ifdef CONFIG_RIO_OLDPCI | 1042 | #ifdef CONFIG_RIO_OLDPCI |
1070 | pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0, &tint); | ||
1071 | |||
1072 | hp = &p->RIOHosts[p->RIONumHosts]; | 1043 | hp = &p->RIOHosts[p->RIONumHosts]; |
1073 | hp->PaddrP = tint & PCI_BASE_ADDRESS_MEM_MASK; | 1044 | hp->PaddrP = pci_resource_start(pdev, 0); |
1074 | hp->Ivec = pdev->irq; | 1045 | hp->Ivec = pdev->irq; |
1075 | if (((1 << hp->Ivec) & rio_irqmask) == 0) | 1046 | if (((1 << hp->Ivec) & rio_irqmask) == 0) |
1076 | hp->Ivec = 0; | 1047 | hp->Ivec = 0; |
@@ -1088,14 +1059,14 @@ static int __init rio_init(void) | |||
1088 | rio_reset_interrupt(hp); | 1059 | rio_reset_interrupt(hp); |
1089 | rio_start_card_running(hp); | 1060 | rio_start_card_running(hp); |
1090 | rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr); | 1061 | rio_dprintk(RIO_DEBUG_PROBE, "Going to test it (%p/%p).\n", (void *) p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr); |
1091 | if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == RIO_SUCCESS) { | 1062 | if (RIOBoardTest(p->RIOHosts[p->RIONumHosts].PaddrP, p->RIOHosts[p->RIONumHosts].Caddr, RIO_PCI, 0) == 0) { |
1092 | writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); | 1063 | writeb(0xFF, &p->RIOHosts[p->RIONumHosts].ResetInt); |
1093 | p->RIOHosts[p->RIONumHosts].UniqueNum = | 1064 | p->RIOHosts[p->RIONumHosts].UniqueNum = |
1094 | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[0]) & 0xFF) << 0) | | 1065 | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[0]) & 0xFF) << 0) | |
1095 | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24); | 1066 | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[1]) & 0xFF) << 8) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[2]) & 0xFF) << 16) | ((readb(&p->RIOHosts[p->RIONumHosts].Unique[3]) & 0xFF) << 24); |
1096 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); | 1067 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); |
1097 | 1068 | ||
1098 | p->RIOLastPCISearch = RIO_SUCCESS; | 1069 | p->RIOLastPCISearch = 0; |
1099 | p->RIONumHosts++; | 1070 | p->RIONumHosts++; |
1100 | found++; | 1071 | found++; |
1101 | } else { | 1072 | } else { |
@@ -1129,7 +1100,7 @@ static int __init rio_init(void) | |||
1129 | okboard = 0; | 1100 | okboard = 0; |
1130 | if ((strncmp(vpdp->identifier, RIO_ISA_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA2_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA3_IDENT, 16) == 0)) { | 1101 | if ((strncmp(vpdp->identifier, RIO_ISA_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA2_IDENT, 16) == 0) || (strncmp(vpdp->identifier, RIO_ISA3_IDENT, 16) == 0)) { |
1131 | /* Board is present... */ | 1102 | /* Board is present... */ |
1132 | if (RIOBoardTest(hp->PaddrP, hp->Caddr, RIO_AT, 0) == RIO_SUCCESS) { | 1103 | if (RIOBoardTest(hp->PaddrP, hp->Caddr, RIO_AT, 0) == 0) { |
1133 | /* ... and feeling fine!!!! */ | 1104 | /* ... and feeling fine!!!! */ |
1134 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); | 1105 | rio_dprintk(RIO_DEBUG_PROBE, "Hmm Tested ok, uniqid = %x.\n", p->RIOHosts[p->RIONumHosts].UniqueNum); |
1135 | if (RIOAssignAT(p, hp->PaddrP, hp->Caddr, 0)) { | 1106 | if (RIOAssignAT(p, hp->PaddrP, hp->Caddr, 0)) { |
@@ -1231,24 +1202,3 @@ static void __exit rio_exit(void) | |||
1231 | 1202 | ||
1232 | module_init(rio_init); | 1203 | module_init(rio_init); |
1233 | module_exit(rio_exit); | 1204 | module_exit(rio_exit); |
1234 | |||
1235 | /* | ||
1236 | * Anybody who knows why this doesn't work for me, please tell me -- REW. | ||
1237 | * Snatched from scsi.c (fixed one spelling error): | ||
1238 | * Overrides for Emacs so that we follow Linus' tabbing style. | ||
1239 | * Emacs will notice this stuff at the end of the file and automatically | ||
1240 | * adjust the settings for this buffer only. This must remain at the end | ||
1241 | * of the file. | ||
1242 | * --------------------------------------------------------------------------- | ||
1243 | * Local Variables: | ||
1244 | * c-indent-level: 4 | ||
1245 | * c-brace-imaginary-offset: 0 | ||
1246 | * c-brace-offset: -4 | ||
1247 | * c-argdecl-indent: 4 | ||
1248 | * c-label-offset: -4 | ||
1249 | * c-continued-statement-offset: 4 | ||
1250 | * c-continued-brace-offset: 0 | ||
1251 | * indent-tabs-mode: nil | ||
1252 | * tab-width: 8 | ||
1253 | * End: | ||
1254 | */ | ||