diff options
Diffstat (limited to 'drivers/char')
50 files changed, 703 insertions, 330 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 43d0cb19ef6a..4f27e5519296 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -735,7 +735,7 @@ config SGI_IP27_RTC | |||
735 | 735 | ||
736 | config GEN_RTC | 736 | config GEN_RTC |
737 | tristate "Generic /dev/rtc emulation" | 737 | tristate "Generic /dev/rtc emulation" |
738 | depends on RTC!=y && !IA64 && !ARM | 738 | depends on RTC!=y && !IA64 && !ARM && !PPC64 |
739 | ---help--- | 739 | ---help--- |
740 | If you say Y here and create a character special file /dev/rtc with | 740 | If you say Y here and create a character special file /dev/rtc with |
741 | major number 10 and minor number 135 using mknod ("man mknod"), you | 741 | major number 10 and minor number 135 using mknod ("man mknod"), you |
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h index c1fe013c64f3..b4af87c6f9c8 100644 --- a/drivers/char/agp/agp.h +++ b/drivers/char/agp/agp.h | |||
@@ -143,6 +143,7 @@ struct agp_bridge_data { | |||
143 | char major_version; | 143 | char major_version; |
144 | char minor_version; | 144 | char minor_version; |
145 | struct list_head list; | 145 | struct list_head list; |
146 | u32 apbase_config; | ||
146 | }; | 147 | }; |
147 | 148 | ||
148 | #define KB(x) ((x) * 1024) | 149 | #define KB(x) ((x) * 1024) |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 51266d6b4d78..1f7d415f432c 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -1047,9 +1047,15 @@ static int intel_845_configure(void) | |||
1047 | /* aperture size */ | 1047 | /* aperture size */ |
1048 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); | 1048 | pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); |
1049 | 1049 | ||
1050 | /* address to map to */ | 1050 | if (agp_bridge->apbase_config != 0) { |
1051 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | 1051 | pci_write_config_dword(agp_bridge->dev, AGP_APBASE, |
1052 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | 1052 | agp_bridge->apbase_config); |
1053 | } else { | ||
1054 | /* address to map to */ | ||
1055 | pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); | ||
1056 | agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); | ||
1057 | agp_bridge->apbase_config = temp; | ||
1058 | } | ||
1053 | 1059 | ||
1054 | /* attbase - aperture base */ | 1060 | /* attbase - aperture base */ |
1055 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); | 1061 | pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); |
diff --git a/drivers/char/drm/via_dma.c b/drivers/char/drm/via_dma.c index 82f839451622..4f60f7f4193d 100644 --- a/drivers/char/drm/via_dma.c +++ b/drivers/char/drm/via_dma.c | |||
@@ -231,7 +231,7 @@ int via_dma_init(DRM_IOCTL_ARGS) | |||
231 | drm_via_dma_init_t init; | 231 | drm_via_dma_init_t init; |
232 | int retcode = 0; | 232 | int retcode = 0; |
233 | 233 | ||
234 | DRM_COPY_FROM_USER_IOCTL(init, (drm_via_dma_init_t *) data, | 234 | DRM_COPY_FROM_USER_IOCTL(init, (drm_via_dma_init_t __user *) data, |
235 | sizeof(init)); | 235 | sizeof(init)); |
236 | 236 | ||
237 | switch (init.func) { | 237 | switch (init.func) { |
@@ -343,7 +343,7 @@ int via_cmdbuffer(DRM_IOCTL_ARGS) | |||
343 | 343 | ||
344 | LOCK_TEST_WITH_RETURN( dev, filp ); | 344 | LOCK_TEST_WITH_RETURN( dev, filp ); |
345 | 345 | ||
346 | DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data, | 346 | DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t __user *) data, |
347 | sizeof(cmdbuf)); | 347 | sizeof(cmdbuf)); |
348 | 348 | ||
349 | DRM_DEBUG("via cmdbuffer, buf %p size %lu\n", cmdbuf.buf, cmdbuf.size); | 349 | DRM_DEBUG("via cmdbuffer, buf %p size %lu\n", cmdbuf.buf, cmdbuf.size); |
@@ -386,7 +386,7 @@ int via_pci_cmdbuffer(DRM_IOCTL_ARGS) | |||
386 | 386 | ||
387 | LOCK_TEST_WITH_RETURN( dev, filp ); | 387 | LOCK_TEST_WITH_RETURN( dev, filp ); |
388 | 388 | ||
389 | DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data, | 389 | DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t __user *) data, |
390 | sizeof(cmdbuf)); | 390 | sizeof(cmdbuf)); |
391 | 391 | ||
392 | DRM_DEBUG("via_pci_cmdbuffer, buf %p size %lu\n", cmdbuf.buf, | 392 | DRM_DEBUG("via_pci_cmdbuffer, buf %p size %lu\n", cmdbuf.buf, |
@@ -701,7 +701,7 @@ via_cmdbuf_size(DRM_IOCTL_ARGS) | |||
701 | return DRM_ERR(EFAULT); | 701 | return DRM_ERR(EFAULT); |
702 | } | 702 | } |
703 | 703 | ||
704 | DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t *) data, | 704 | DRM_COPY_FROM_USER_IOCTL(d_siz, (drm_via_cmdbuf_size_t __user *) data, |
705 | sizeof(d_siz)); | 705 | sizeof(d_siz)); |
706 | 706 | ||
707 | 707 | ||
@@ -735,7 +735,7 @@ via_cmdbuf_size(DRM_IOCTL_ARGS) | |||
735 | } | 735 | } |
736 | d_siz.size = tmp_size; | 736 | d_siz.size = tmp_size; |
737 | 737 | ||
738 | DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t *) data, d_siz, | 738 | DRM_COPY_TO_USER_IOCTL((drm_via_cmdbuf_size_t __user *) data, d_siz, |
739 | sizeof(d_siz)); | 739 | sizeof(d_siz)); |
740 | return ret; | 740 | return ret; |
741 | } | 741 | } |
diff --git a/drivers/char/drm/via_drm.h b/drivers/char/drm/via_drm.h index 4588c9bd1816..be346bb0a26a 100644 --- a/drivers/char/drm/via_drm.h +++ b/drivers/char/drm/via_drm.h | |||
@@ -158,7 +158,7 @@ typedef struct _drm_via_dma_init { | |||
158 | } drm_via_dma_init_t; | 158 | } drm_via_dma_init_t; |
159 | 159 | ||
160 | typedef struct _drm_via_cmdbuffer { | 160 | typedef struct _drm_via_cmdbuffer { |
161 | char *buf; | 161 | char __user *buf; |
162 | unsigned long size; | 162 | unsigned long size; |
163 | } drm_via_cmdbuffer_t; | 163 | } drm_via_cmdbuffer_t; |
164 | 164 | ||
diff --git a/drivers/char/drm/via_ds.c b/drivers/char/drm/via_ds.c index daf3df75a20e..5c71e089246c 100644 --- a/drivers/char/drm/via_ds.c +++ b/drivers/char/drm/via_ds.c | |||
@@ -133,7 +133,7 @@ memHeap_t *via_mmInit(int ofs, int size) | |||
133 | PMemBlock blocks; | 133 | PMemBlock blocks; |
134 | 134 | ||
135 | if (size <= 0) | 135 | if (size <= 0) |
136 | return 0; | 136 | return NULL; |
137 | 137 | ||
138 | blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER); | 138 | blocks = (TMemBlock *) drm_calloc(1, sizeof(TMemBlock), DRM_MEM_DRIVER); |
139 | 139 | ||
@@ -143,7 +143,7 @@ memHeap_t *via_mmInit(int ofs, int size) | |||
143 | blocks->free = 1; | 143 | blocks->free = 1; |
144 | return (memHeap_t *) blocks; | 144 | return (memHeap_t *) blocks; |
145 | } else | 145 | } else |
146 | return 0; | 146 | return NULL; |
147 | } | 147 | } |
148 | 148 | ||
149 | static TMemBlock *SliceBlock(TMemBlock * p, | 149 | static TMemBlock *SliceBlock(TMemBlock * p, |
diff --git a/drivers/char/drm/via_ds.h b/drivers/char/drm/via_ds.h index be9c7f9f1aee..d2bb9f37ca38 100644 --- a/drivers/char/drm/via_ds.h +++ b/drivers/char/drm/via_ds.h | |||
@@ -61,8 +61,8 @@ struct mem_block_t { | |||
61 | struct mem_block_t *heap; | 61 | struct mem_block_t *heap; |
62 | int ofs, size; | 62 | int ofs, size; |
63 | int align; | 63 | int align; |
64 | int free:1; | 64 | unsigned int free:1; |
65 | int reserved:1; | 65 | unsigned int reserved:1; |
66 | }; | 66 | }; |
67 | typedef struct mem_block_t TMemBlock; | 67 | typedef struct mem_block_t TMemBlock; |
68 | typedef struct mem_block_t *PMemBlock; | 68 | typedef struct mem_block_t *PMemBlock; |
diff --git a/drivers/char/drm/via_map.c b/drivers/char/drm/via_map.c index 0be829b6ec65..bb171139e737 100644 --- a/drivers/char/drm/via_map.c +++ b/drivers/char/drm/via_map.c | |||
@@ -95,7 +95,8 @@ int via_map_init(DRM_IOCTL_ARGS) | |||
95 | 95 | ||
96 | DRM_DEBUG("%s\n", __FUNCTION__); | 96 | DRM_DEBUG("%s\n", __FUNCTION__); |
97 | 97 | ||
98 | DRM_COPY_FROM_USER_IOCTL(init, (drm_via_init_t *) data, sizeof(init)); | 98 | DRM_COPY_FROM_USER_IOCTL(init, (drm_via_init_t __user *) data, |
99 | sizeof(init)); | ||
99 | 100 | ||
100 | switch (init.func) { | 101 | switch (init.func) { |
101 | case VIA_INIT_MAP: | 102 | case VIA_INIT_MAP: |
diff --git a/drivers/char/drm/via_mm.c b/drivers/char/drm/via_mm.c index c22712f44d42..13921f3c0ec2 100644 --- a/drivers/char/drm/via_mm.c +++ b/drivers/char/drm/via_mm.c | |||
@@ -76,7 +76,8 @@ int via_agp_init(DRM_IOCTL_ARGS) | |||
76 | { | 76 | { |
77 | drm_via_agp_t agp; | 77 | drm_via_agp_t agp; |
78 | 78 | ||
79 | DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t *) data, sizeof(agp)); | 79 | DRM_COPY_FROM_USER_IOCTL(agp, (drm_via_agp_t __user *) data, |
80 | sizeof(agp)); | ||
80 | 81 | ||
81 | AgpHeap = via_mmInit(agp.offset, agp.size); | 82 | AgpHeap = via_mmInit(agp.offset, agp.size); |
82 | 83 | ||
@@ -92,7 +93,7 @@ int via_fb_init(DRM_IOCTL_ARGS) | |||
92 | { | 93 | { |
93 | drm_via_fb_t fb; | 94 | drm_via_fb_t fb; |
94 | 95 | ||
95 | DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t *) data, sizeof(fb)); | 96 | DRM_COPY_FROM_USER_IOCTL(fb, (drm_via_fb_t __user *) data, sizeof(fb)); |
96 | 97 | ||
97 | FBHeap = via_mmInit(fb.offset, fb.size); | 98 | FBHeap = via_mmInit(fb.offset, fb.size); |
98 | 99 | ||
@@ -193,19 +194,20 @@ int via_mem_alloc(DRM_IOCTL_ARGS) | |||
193 | { | 194 | { |
194 | drm_via_mem_t mem; | 195 | drm_via_mem_t mem; |
195 | 196 | ||
196 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem)); | 197 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data, |
198 | sizeof(mem)); | ||
197 | 199 | ||
198 | switch (mem.type) { | 200 | switch (mem.type) { |
199 | case VIDEO: | 201 | case VIDEO: |
200 | if (via_fb_alloc(&mem) < 0) | 202 | if (via_fb_alloc(&mem) < 0) |
201 | return -EFAULT; | 203 | return -EFAULT; |
202 | DRM_COPY_TO_USER_IOCTL((drm_via_mem_t *) data, mem, | 204 | DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem, |
203 | sizeof(mem)); | 205 | sizeof(mem)); |
204 | return 0; | 206 | return 0; |
205 | case AGP: | 207 | case AGP: |
206 | if (via_agp_alloc(&mem) < 0) | 208 | if (via_agp_alloc(&mem) < 0) |
207 | return -EFAULT; | 209 | return -EFAULT; |
208 | DRM_COPY_TO_USER_IOCTL((drm_via_mem_t *) data, mem, | 210 | DRM_COPY_TO_USER_IOCTL((drm_via_mem_t __user *) data, mem, |
209 | sizeof(mem)); | 211 | sizeof(mem)); |
210 | return 0; | 212 | return 0; |
211 | } | 213 | } |
@@ -289,7 +291,8 @@ int via_mem_free(DRM_IOCTL_ARGS) | |||
289 | { | 291 | { |
290 | drm_via_mem_t mem; | 292 | drm_via_mem_t mem; |
291 | 293 | ||
292 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t *) data, sizeof(mem)); | 294 | DRM_COPY_FROM_USER_IOCTL(mem, (drm_via_mem_t __user *) data, |
295 | sizeof(mem)); | ||
293 | 296 | ||
294 | switch (mem.type) { | 297 | switch (mem.type) { |
295 | 298 | ||
diff --git a/drivers/char/drm/via_video.c b/drivers/char/drm/via_video.c index 37a61c67b292..1e2d444587bf 100644 --- a/drivers/char/drm/via_video.c +++ b/drivers/char/drm/via_video.c | |||
@@ -76,7 +76,8 @@ via_decoder_futex(DRM_IOCTL_ARGS) | |||
76 | 76 | ||
77 | DRM_DEBUG("%s\n", __FUNCTION__); | 77 | DRM_DEBUG("%s\n", __FUNCTION__); |
78 | 78 | ||
79 | DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t *) data, sizeof(fx)); | 79 | DRM_COPY_FROM_USER_IOCTL(fx, (drm_via_futex_t __user *) data, |
80 | sizeof(fx)); | ||
80 | 81 | ||
81 | if (fx.lock > VIA_NR_XVMC_LOCKS) | 82 | if (fx.lock > VIA_NR_XVMC_LOCKS) |
82 | return -EFAULT; | 83 | return -EFAULT; |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 298574e16061..a44b97304e95 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -1726,7 +1726,7 @@ static int dmi_table(u32 base, int len, int num) | |||
1726 | return status; | 1726 | return status; |
1727 | } | 1727 | } |
1728 | 1728 | ||
1729 | inline static int dmi_checksum(u8 *buf) | 1729 | static inline int dmi_checksum(u8 *buf) |
1730 | { | 1730 | { |
1731 | u8 sum=0; | 1731 | u8 sum=0; |
1732 | int a; | 1732 | int a; |
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index fcd1c02a32cb..d35a953961cb 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -131,11 +131,7 @@ | |||
131 | #define WDIOC_GET_PRETIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 22, int) | 131 | #define WDIOC_GET_PRETIMEOUT _IOW(WATCHDOG_IOCTL_BASE, 22, int) |
132 | #endif | 132 | #endif |
133 | 133 | ||
134 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 134 | static int nowayout = WATCHDOG_NOWAYOUT; |
135 | static int nowayout = 1; | ||
136 | #else | ||
137 | static int nowayout; | ||
138 | #endif | ||
139 | 135 | ||
140 | static ipmi_user_t watchdog_user = NULL; | 136 | static ipmi_user_t watchdog_user = NULL; |
141 | 137 | ||
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 7b19e02f112f..523fd3c8bbaa 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c | |||
@@ -198,10 +198,10 @@ int setkeycode(unsigned int scancode, unsigned int keycode) | |||
198 | 198 | ||
199 | if (scancode >= dev->keycodemax) | 199 | if (scancode >= dev->keycodemax) |
200 | return -EINVAL; | 200 | return -EINVAL; |
201 | if (keycode > KEY_MAX) | ||
202 | return -EINVAL; | ||
203 | if (keycode < 0 || keycode > KEY_MAX) | 201 | if (keycode < 0 || keycode > KEY_MAX) |
204 | return -EINVAL; | 202 | return -EINVAL; |
203 | if (keycode >> (dev->keycodesize * 8)) | ||
204 | return -EINVAL; | ||
205 | 205 | ||
206 | oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); | 206 | oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode); |
207 | 207 | ||
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c index a8be11dfcba3..34cbb13aad4b 100644 --- a/drivers/char/rio/rioboot.c +++ b/drivers/char/rio/rioboot.c | |||
@@ -902,7 +902,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
902 | (HostP->Mapping[entry].RtaUniqueNum==RtaUniq)) | 902 | (HostP->Mapping[entry].RtaUniqueNum==RtaUniq)) |
903 | { | 903 | { |
904 | HostP->Mapping[entry].Flags |= RTA_BOOTED|RTA_NEWBOOT; | 904 | HostP->Mapping[entry].Flags |= RTA_BOOTED|RTA_NEWBOOT; |
905 | #if NEED_TO_FIX | 905 | #ifdef NEED_TO_FIX |
906 | RIO_SV_BROADCAST(HostP->svFlags[entry]); | 906 | RIO_SV_BROADCAST(HostP->svFlags[entry]); |
907 | #endif | 907 | #endif |
908 | if ( (sysport=HostP->Mapping[entry].SysPort) != NO_PORT ) | 908 | if ( (sysport=HostP->Mapping[entry].SysPort) != NO_PORT ) |
@@ -918,7 +918,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
918 | { | 918 | { |
919 | entry2 = HostP->Mapping[entry].ID2 - 1; | 919 | entry2 = HostP->Mapping[entry].ID2 - 1; |
920 | HostP->Mapping[entry2].Flags |= RTA_BOOTED|RTA_NEWBOOT; | 920 | HostP->Mapping[entry2].Flags |= RTA_BOOTED|RTA_NEWBOOT; |
921 | #if NEED_TO_FIX | 921 | #ifdef NEED_TO_FIX |
922 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); | 922 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); |
923 | #endif | 923 | #endif |
924 | sysport = HostP->Mapping[entry2].SysPort; | 924 | sysport = HostP->Mapping[entry2].SysPort; |
@@ -1143,7 +1143,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
1143 | CCOPY( MapP->Name, HostP->Mapping[entry].Name, MAX_NAME_LEN ); | 1143 | CCOPY( MapP->Name, HostP->Mapping[entry].Name, MAX_NAME_LEN ); |
1144 | HostP->Mapping[entry].Flags = | 1144 | HostP->Mapping[entry].Flags = |
1145 | SLOT_IN_USE | RTA_BOOTED | RTA_NEWBOOT; | 1145 | SLOT_IN_USE | RTA_BOOTED | RTA_NEWBOOT; |
1146 | #if NEED_TO_FIX | 1146 | #ifdef NEED_TO_FIX |
1147 | RIO_SV_BROADCAST(HostP->svFlags[entry]); | 1147 | RIO_SV_BROADCAST(HostP->svFlags[entry]); |
1148 | #endif | 1148 | #endif |
1149 | RIOReMapPorts( p, HostP, &HostP->Mapping[entry] ); | 1149 | RIOReMapPorts( p, HostP, &HostP->Mapping[entry] ); |
@@ -1159,7 +1159,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
1159 | "This RTA has a tentative entry on another host - delete that entry (1)\n"); | 1159 | "This RTA has a tentative entry on another host - delete that entry (1)\n"); |
1160 | HostP->Mapping[entry].Flags = | 1160 | HostP->Mapping[entry].Flags = |
1161 | SLOT_TENTATIVE | RTA_BOOTED | RTA_NEWBOOT; | 1161 | SLOT_TENTATIVE | RTA_BOOTED | RTA_NEWBOOT; |
1162 | #if NEED_TO_FIX | 1162 | #ifdef NEED_TO_FIX |
1163 | RIO_SV_BROADCAST(HostP->svFlags[entry]); | 1163 | RIO_SV_BROADCAST(HostP->svFlags[entry]); |
1164 | #endif | 1164 | #endif |
1165 | } | 1165 | } |
@@ -1169,7 +1169,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
1169 | { | 1169 | { |
1170 | HostP->Mapping[entry2].Flags = SLOT_IN_USE | | 1170 | HostP->Mapping[entry2].Flags = SLOT_IN_USE | |
1171 | RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT; | 1171 | RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT; |
1172 | #if NEED_TO_FIX | 1172 | #ifdef NEED_TO_FIX |
1173 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); | 1173 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); |
1174 | #endif | 1174 | #endif |
1175 | HostP->Mapping[entry2].SysPort = MapP2->SysPort; | 1175 | HostP->Mapping[entry2].SysPort = MapP2->SysPort; |
@@ -1188,7 +1188,7 @@ static int RIOBootComplete( struct rio_info *p, struct Host *HostP, uint Rup, st | |||
1188 | else | 1188 | else |
1189 | HostP->Mapping[entry2].Flags = SLOT_TENTATIVE | | 1189 | HostP->Mapping[entry2].Flags = SLOT_TENTATIVE | |
1190 | RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT; | 1190 | RTA_BOOTED | RTA_NEWBOOT | RTA16_SECOND_SLOT; |
1191 | #if NEED_TO_FIX | 1191 | #ifdef NEED_TO_FIX |
1192 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); | 1192 | RIO_SV_BROADCAST(HostP->svFlags[entry2]); |
1193 | #endif | 1193 | #endif |
1194 | bzero( (caddr_t)MapP2, sizeof(struct Map) ); | 1194 | bzero( (caddr_t)MapP2, sizeof(struct Map) ); |
diff --git a/drivers/char/rio/rioroute.c b/drivers/char/rio/rioroute.c index 106b31f48a21..e9564c9fb37c 100644 --- a/drivers/char/rio/rioroute.c +++ b/drivers/char/rio/rioroute.c | |||
@@ -1023,7 +1023,7 @@ RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit) | |||
1023 | if (link < LINKS_PER_UNIT) | 1023 | if (link < LINKS_PER_UNIT) |
1024 | return 1; | 1024 | return 1; |
1025 | 1025 | ||
1026 | #if NEED_TO_FIX_THIS | 1026 | #ifdef NEED_TO_FIX_THIS |
1027 | /* Ok so all the links are disconnected. But we may have only just | 1027 | /* Ok so all the links are disconnected. But we may have only just |
1028 | ** made this slot tentative and not yet received a topology update. | 1028 | ** made this slot tentative and not yet received a topology update. |
1029 | ** Lets check how long ago we made it tentative. | 1029 | ** Lets check how long ago we made it tentative. |
diff --git a/drivers/char/rio/riotable.c b/drivers/char/rio/riotable.c index 8fb26ad2aa12..e45bc275907a 100644 --- a/drivers/char/rio/riotable.c +++ b/drivers/char/rio/riotable.c | |||
@@ -771,7 +771,7 @@ int RIOAssignRta( struct rio_info *p, struct Map *MapP ) | |||
771 | if ((MapP->Flags & RTA16_SECOND_SLOT) == 0) | 771 | if ((MapP->Flags & RTA16_SECOND_SLOT) == 0) |
772 | CCOPY( MapP->Name, HostMapP->Name, MAX_NAME_LEN ); | 772 | CCOPY( MapP->Name, HostMapP->Name, MAX_NAME_LEN ); |
773 | HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED; | 773 | HostMapP->Flags = SLOT_IN_USE | RTA_BOOTED; |
774 | #if NEED_TO_FIX | 774 | #ifdef NEED_TO_FIX |
775 | RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID-1]); | 775 | RIO_SV_BROADCAST(p->RIOHosts[host].svFlags[MapP->ID-1]); |
776 | #endif | 776 | #endif |
777 | if (MapP->Flags & RTA16_SECOND_SLOT) | 777 | if (MapP->Flags & RTA16_SECOND_SLOT) |
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index d8f9e94ae475..cd4fe8b1709f 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c | |||
@@ -1209,6 +1209,7 @@ static int rtc_proc_open(struct inode *inode, struct file *file) | |||
1209 | 1209 | ||
1210 | void rtc_get_rtc_time(struct rtc_time *rtc_tm) | 1210 | void rtc_get_rtc_time(struct rtc_time *rtc_tm) |
1211 | { | 1211 | { |
1212 | unsigned long uip_watchdog = jiffies; | ||
1212 | unsigned char ctrl; | 1213 | unsigned char ctrl; |
1213 | #ifdef CONFIG_MACH_DECSTATION | 1214 | #ifdef CONFIG_MACH_DECSTATION |
1214 | unsigned int real_year; | 1215 | unsigned int real_year; |
@@ -1224,8 +1225,10 @@ void rtc_get_rtc_time(struct rtc_time *rtc_tm) | |||
1224 | * Once the read clears, read the RTC time (again via ioctl). Easy. | 1225 | * Once the read clears, read the RTC time (again via ioctl). Easy. |
1225 | */ | 1226 | */ |
1226 | 1227 | ||
1227 | if (rtc_is_updating() != 0) | 1228 | while (rtc_is_updating() != 0 && jiffies - uip_watchdog < 2*HZ/100) { |
1228 | msleep(20); | 1229 | barrier(); |
1230 | cpu_relax(); | ||
1231 | } | ||
1229 | 1232 | ||
1230 | /* | 1233 | /* |
1231 | * Only the values that we read from the RTC are set. We leave | 1234 | * Only the values that we read from the RTC are set. We leave |
diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index fd042060809a..cefbe985e55c 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c | |||
@@ -439,6 +439,11 @@ static struct { | |||
439 | { 0, 0 }, | 439 | { 0, 0 }, |
440 | }; | 440 | }; |
441 | 441 | ||
442 | struct sonypi_keypress { | ||
443 | struct input_dev *dev; | ||
444 | int key; | ||
445 | }; | ||
446 | |||
442 | static struct sonypi_device { | 447 | static struct sonypi_device { |
443 | struct pci_dev *dev; | 448 | struct pci_dev *dev; |
444 | struct platform_device *pdev; | 449 | struct platform_device *pdev; |
@@ -710,22 +715,61 @@ static void sonypi_setbluetoothpower(u8 state) | |||
710 | 715 | ||
711 | static void input_keyrelease(void *data) | 716 | static void input_keyrelease(void *data) |
712 | { | 717 | { |
713 | struct input_dev *input_dev; | 718 | struct sonypi_keypress kp; |
714 | int key; | ||
715 | |||
716 | while (1) { | ||
717 | if (kfifo_get(sonypi_device.input_fifo, | ||
718 | (unsigned char *)&input_dev, | ||
719 | sizeof(input_dev)) != sizeof(input_dev)) | ||
720 | return; | ||
721 | if (kfifo_get(sonypi_device.input_fifo, | ||
722 | (unsigned char *)&key, | ||
723 | sizeof(key)) != sizeof(key)) | ||
724 | return; | ||
725 | 719 | ||
720 | while (kfifo_get(sonypi_device.input_fifo, (unsigned char *)&kp, | ||
721 | sizeof(kp)) == sizeof(kp)) { | ||
726 | msleep(10); | 722 | msleep(10); |
727 | input_report_key(input_dev, key, 0); | 723 | input_report_key(kp.dev, kp.key, 0); |
728 | input_sync(input_dev); | 724 | input_sync(kp.dev); |
725 | } | ||
726 | } | ||
727 | |||
728 | static void sonypi_report_input_event(u8 event) | ||
729 | { | ||
730 | struct input_dev *jog_dev = &sonypi_device.input_jog_dev; | ||
731 | struct input_dev *key_dev = &sonypi_device.input_key_dev; | ||
732 | struct sonypi_keypress kp = { NULL }; | ||
733 | int i; | ||
734 | |||
735 | switch (event) { | ||
736 | case SONYPI_EVENT_JOGDIAL_UP: | ||
737 | case SONYPI_EVENT_JOGDIAL_UP_PRESSED: | ||
738 | input_report_rel(jog_dev, REL_WHEEL, 1); | ||
739 | input_sync(jog_dev); | ||
740 | break; | ||
741 | |||
742 | case SONYPI_EVENT_JOGDIAL_DOWN: | ||
743 | case SONYPI_EVENT_JOGDIAL_DOWN_PRESSED: | ||
744 | input_report_rel(jog_dev, REL_WHEEL, -1); | ||
745 | input_sync(jog_dev); | ||
746 | break; | ||
747 | |||
748 | case SONYPI_EVENT_JOGDIAL_PRESSED: | ||
749 | kp.key = BTN_MIDDLE; | ||
750 | kp.dev = jog_dev; | ||
751 | break; | ||
752 | |||
753 | case SONYPI_EVENT_FNKEY_RELEASED: | ||
754 | /* Nothing, not all VAIOs generate this event */ | ||
755 | break; | ||
756 | |||
757 | default: | ||
758 | for (i = 0; sonypi_inputkeys[i].sonypiev; i++) | ||
759 | if (event == sonypi_inputkeys[i].sonypiev) { | ||
760 | kp.dev = key_dev; | ||
761 | kp.key = sonypi_inputkeys[i].inputev; | ||
762 | break; | ||
763 | } | ||
764 | break; | ||
765 | } | ||
766 | |||
767 | if (kp.dev) { | ||
768 | input_report_key(kp.dev, kp.key, 1); | ||
769 | input_sync(kp.dev); | ||
770 | kfifo_put(sonypi_device.input_fifo, | ||
771 | (unsigned char *)&kp, sizeof(kp)); | ||
772 | schedule_work(&sonypi_device.input_work); | ||
729 | } | 773 | } |
730 | } | 774 | } |
731 | 775 | ||
@@ -768,51 +812,8 @@ found: | |||
768 | printk(KERN_INFO | 812 | printk(KERN_INFO |
769 | "sonypi: event port1=0x%02x,port2=0x%02x\n", v1, v2); | 813 | "sonypi: event port1=0x%02x,port2=0x%02x\n", v1, v2); |
770 | 814 | ||
771 | if (useinput) { | 815 | if (useinput) |
772 | struct input_dev *input_jog_dev = &sonypi_device.input_jog_dev; | 816 | sonypi_report_input_event(event); |
773 | struct input_dev *input_key_dev = &sonypi_device.input_key_dev; | ||
774 | switch (event) { | ||
775 | case SONYPI_EVENT_JOGDIAL_UP: | ||
776 | case SONYPI_EVENT_JOGDIAL_UP_PRESSED: | ||
777 | input_report_rel(input_jog_dev, REL_WHEEL, 1); | ||
778 | break; | ||
779 | case SONYPI_EVENT_JOGDIAL_DOWN: | ||
780 | case SONYPI_EVENT_JOGDIAL_DOWN_PRESSED: | ||
781 | input_report_rel(input_jog_dev, REL_WHEEL, -1); | ||
782 | break; | ||
783 | case SONYPI_EVENT_JOGDIAL_PRESSED: { | ||
784 | int key = BTN_MIDDLE; | ||
785 | input_report_key(input_jog_dev, key, 1); | ||
786 | kfifo_put(sonypi_device.input_fifo, | ||
787 | (unsigned char *)&input_jog_dev, | ||
788 | sizeof(input_jog_dev)); | ||
789 | kfifo_put(sonypi_device.input_fifo, | ||
790 | (unsigned char *)&key, sizeof(key)); | ||
791 | break; | ||
792 | } | ||
793 | case SONYPI_EVENT_FNKEY_RELEASED: | ||
794 | /* Nothing, not all VAIOs generate this event */ | ||
795 | break; | ||
796 | } | ||
797 | input_sync(input_jog_dev); | ||
798 | |||
799 | for (i = 0; sonypi_inputkeys[i].sonypiev; i++) { | ||
800 | int key; | ||
801 | |||
802 | if (event != sonypi_inputkeys[i].sonypiev) | ||
803 | continue; | ||
804 | |||
805 | key = sonypi_inputkeys[i].inputev; | ||
806 | input_report_key(input_key_dev, key, 1); | ||
807 | kfifo_put(sonypi_device.input_fifo, | ||
808 | (unsigned char *)&input_key_dev, | ||
809 | sizeof(input_key_dev)); | ||
810 | kfifo_put(sonypi_device.input_fifo, | ||
811 | (unsigned char *)&key, sizeof(key)); | ||
812 | } | ||
813 | input_sync(input_key_dev); | ||
814 | schedule_work(&sonypi_device.input_work); | ||
815 | } | ||
816 | 817 | ||
817 | kfifo_put(sonypi_device.fifo, (unsigned char *)&event, sizeof(event)); | 818 | kfifo_put(sonypi_device.fifo, (unsigned char *)&event, sizeof(event)); |
818 | kill_fasync(&sonypi_device.fifo_async, SIGIO, POLL_IN); | 819 | kill_fasync(&sonypi_device.fifo_async, SIGIO, POLL_IN); |
@@ -1227,14 +1228,7 @@ static int __devinit sonypi_probe(void) | |||
1227 | sonypi_device.input_jog_dev.keybit[LONG(BTN_MOUSE)] = | 1228 | sonypi_device.input_jog_dev.keybit[LONG(BTN_MOUSE)] = |
1228 | BIT(BTN_MIDDLE); | 1229 | BIT(BTN_MIDDLE); |
1229 | sonypi_device.input_jog_dev.relbit[0] = BIT(REL_WHEEL); | 1230 | sonypi_device.input_jog_dev.relbit[0] = BIT(REL_WHEEL); |
1230 | sonypi_device.input_jog_dev.name = | 1231 | sonypi_device.input_jog_dev.name = SONYPI_JOG_INPUTNAME; |
1231 | kmalloc(sizeof(SONYPI_JOG_INPUTNAME), GFP_KERNEL); | ||
1232 | if (!sonypi_device.input_jog_dev.name) { | ||
1233 | printk(KERN_ERR "sonypi: kmalloc failed\n"); | ||
1234 | ret = -ENOMEM; | ||
1235 | goto out_inkmallocinput1; | ||
1236 | } | ||
1237 | sprintf(sonypi_device.input_jog_dev.name, SONYPI_JOG_INPUTNAME); | ||
1238 | sonypi_device.input_jog_dev.id.bustype = BUS_ISA; | 1232 | sonypi_device.input_jog_dev.id.bustype = BUS_ISA; |
1239 | sonypi_device.input_jog_dev.id.vendor = PCI_VENDOR_ID_SONY; | 1233 | sonypi_device.input_jog_dev.id.vendor = PCI_VENDOR_ID_SONY; |
1240 | 1234 | ||
@@ -1248,14 +1242,7 @@ static int __devinit sonypi_probe(void) | |||
1248 | if (sonypi_inputkeys[i].inputev) | 1242 | if (sonypi_inputkeys[i].inputev) |
1249 | set_bit(sonypi_inputkeys[i].inputev, | 1243 | set_bit(sonypi_inputkeys[i].inputev, |
1250 | sonypi_device.input_key_dev.keybit); | 1244 | sonypi_device.input_key_dev.keybit); |
1251 | sonypi_device.input_key_dev.name = | 1245 | sonypi_device.input_key_dev.name = SONYPI_KEY_INPUTNAME; |
1252 | kmalloc(sizeof(SONYPI_KEY_INPUTNAME), GFP_KERNEL); | ||
1253 | if (!sonypi_device.input_key_dev.name) { | ||
1254 | printk(KERN_ERR "sonypi: kmalloc failed\n"); | ||
1255 | ret = -ENOMEM; | ||
1256 | goto out_inkmallocinput2; | ||
1257 | } | ||
1258 | sprintf(sonypi_device.input_key_dev.name, SONYPI_KEY_INPUTNAME); | ||
1259 | sonypi_device.input_key_dev.id.bustype = BUS_ISA; | 1246 | sonypi_device.input_key_dev.id.bustype = BUS_ISA; |
1260 | sonypi_device.input_key_dev.id.vendor = PCI_VENDOR_ID_SONY; | 1247 | sonypi_device.input_key_dev.id.vendor = PCI_VENDOR_ID_SONY; |
1261 | 1248 | ||
@@ -1313,11 +1300,7 @@ out_platformdev: | |||
1313 | kfifo_free(sonypi_device.input_fifo); | 1300 | kfifo_free(sonypi_device.input_fifo); |
1314 | out_infifo: | 1301 | out_infifo: |
1315 | input_unregister_device(&sonypi_device.input_key_dev); | 1302 | input_unregister_device(&sonypi_device.input_key_dev); |
1316 | kfree(sonypi_device.input_key_dev.name); | ||
1317 | out_inkmallocinput2: | ||
1318 | input_unregister_device(&sonypi_device.input_jog_dev); | 1303 | input_unregister_device(&sonypi_device.input_jog_dev); |
1319 | kfree(sonypi_device.input_jog_dev.name); | ||
1320 | out_inkmallocinput1: | ||
1321 | free_irq(sonypi_device.irq, sonypi_irq); | 1304 | free_irq(sonypi_device.irq, sonypi_irq); |
1322 | out_reqirq: | 1305 | out_reqirq: |
1323 | release_region(sonypi_device.ioport1, sonypi_device.region_size); | 1306 | release_region(sonypi_device.ioport1, sonypi_device.region_size); |
@@ -1337,13 +1320,14 @@ static void __devexit sonypi_remove(void) | |||
1337 | { | 1320 | { |
1338 | sonypi_disable(); | 1321 | sonypi_disable(); |
1339 | 1322 | ||
1323 | synchronize_sched(); /* Allow sonypi interrupt to complete. */ | ||
1324 | flush_scheduled_work(); | ||
1325 | |||
1340 | platform_device_unregister(sonypi_device.pdev); | 1326 | platform_device_unregister(sonypi_device.pdev); |
1341 | 1327 | ||
1342 | if (useinput) { | 1328 | if (useinput) { |
1343 | input_unregister_device(&sonypi_device.input_key_dev); | 1329 | input_unregister_device(&sonypi_device.input_key_dev); |
1344 | kfree(sonypi_device.input_key_dev.name); | ||
1345 | input_unregister_device(&sonypi_device.input_jog_dev); | 1330 | input_unregister_device(&sonypi_device.input_jog_dev); |
1346 | kfree(sonypi_device.input_jog_dev.name); | ||
1347 | kfifo_free(sonypi_device.input_fifo); | 1331 | kfifo_free(sonypi_device.input_fifo); |
1348 | } | 1332 | } |
1349 | 1333 | ||
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index 7a969778915a..79e9832ef1f3 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -17,6 +17,8 @@ config TCG_TPM | |||
17 | obtained at: <http://sourceforge.net/projects/trousers>. To | 17 | obtained at: <http://sourceforge.net/projects/trousers>. To |
18 | compile this driver as a module, choose M here; the module | 18 | compile this driver as a module, choose M here; the module |
19 | will be called tpm. If unsure, say N. | 19 | will be called tpm. If unsure, say N. |
20 | Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI_BUS | ||
21 | and CONFIG_PNPACPI. | ||
20 | 22 | ||
21 | config TCG_NSC | 23 | config TCG_NSC |
22 | tristate "National Semiconductor TPM Interface" | 24 | tristate "National Semiconductor TPM Interface" |
@@ -35,5 +37,17 @@ config TCG_ATMEL | |||
35 | will be accessible from within Linux. To compile this driver | 37 | will be accessible from within Linux. To compile this driver |
36 | as a module, choose M here; the module will be called tpm_atmel. | 38 | as a module, choose M here; the module will be called tpm_atmel. |
37 | 39 | ||
40 | config TCG_INFINEON | ||
41 | tristate "Infineon Technologies TPM Interface" | ||
42 | depends on TCG_TPM && PNPACPI | ||
43 | ---help--- | ||
44 | If you have a TPM security chip from Infineon Technologies | ||
45 | (either SLD 9630 TT 1.1 or SLB 9635 TT 1.2) say Yes and it | ||
46 | will be accessible from within Linux. | ||
47 | To compile this driver as a module, choose M here; the module | ||
48 | will be called tpm_infineon. | ||
49 | Further information on this driver and the supported hardware | ||
50 | can be found at http://www.prosec.rub.de/tpm | ||
51 | |||
38 | endmenu | 52 | endmenu |
39 | 53 | ||
diff --git a/drivers/char/tpm/Makefile b/drivers/char/tpm/Makefile index 736d3df266f5..2392e404e8d1 100644 --- a/drivers/char/tpm/Makefile +++ b/drivers/char/tpm/Makefile | |||
@@ -4,4 +4,4 @@ | |||
4 | obj-$(CONFIG_TCG_TPM) += tpm.o | 4 | obj-$(CONFIG_TCG_TPM) += tpm.o |
5 | obj-$(CONFIG_TCG_NSC) += tpm_nsc.o | 5 | obj-$(CONFIG_TCG_NSC) += tpm_nsc.o |
6 | obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o | 6 | obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o |
7 | 7 | obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o | |
diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c new file mode 100644 index 000000000000..dc8c540391fd --- /dev/null +++ b/drivers/char/tpm/tpm_infineon.c | |||
@@ -0,0 +1,533 @@ | |||
1 | /* | ||
2 | * Description: | ||
3 | * Device Driver for the Infineon Technologies | ||
4 | * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module | ||
5 | * Specifications at www.trustedcomputinggroup.org | ||
6 | * | ||
7 | * Copyright (C) 2005, Marcel Selhorst <selhorst@crypto.rub.de> | ||
8 | * Applied Data Security Group, Ruhr-University Bochum, Germany | ||
9 | * Project-Homepage: http://www.prosec.rub.de/tpm | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | ||
12 | * modify it under the terms of the GNU General Public License as | ||
13 | * published by the Free Software Foundation, version 2 of the | ||
14 | * License. | ||
15 | */ | ||
16 | |||
17 | #include <acpi/acpi_bus.h> | ||
18 | #include <linux/pnp.h> | ||
19 | #include "tpm.h" | ||
20 | |||
21 | /* Infineon specific definitions */ | ||
22 | /* maximum number of WTX-packages */ | ||
23 | #define TPM_MAX_WTX_PACKAGES 50 | ||
24 | /* msleep-Time for WTX-packages */ | ||
25 | #define TPM_WTX_MSLEEP_TIME 20 | ||
26 | /* msleep-Time --> Interval to check status register */ | ||
27 | #define TPM_MSLEEP_TIME 3 | ||
28 | /* gives number of max. msleep()-calls before throwing timeout */ | ||
29 | #define TPM_MAX_TRIES 5000 | ||
30 | #define TPM_INFINEON_DEV_VEN_VALUE 0x15D1 | ||
31 | |||
32 | /* These values will be filled after ACPI-call */ | ||
33 | static int TPM_INF_DATA = 0; | ||
34 | static int TPM_INF_ADDR = 0; | ||
35 | |||
36 | /* TPM header definitions */ | ||
37 | enum infineon_tpm_header { | ||
38 | TPM_VL_VER = 0x01, | ||
39 | TPM_VL_CHANNEL_CONTROL = 0x07, | ||
40 | TPM_VL_CHANNEL_PERSONALISATION = 0x0A, | ||
41 | TPM_VL_CHANNEL_TPM = 0x0B, | ||
42 | TPM_VL_CONTROL = 0x00, | ||
43 | TPM_INF_NAK = 0x15, | ||
44 | TPM_CTRL_WTX = 0x10, | ||
45 | TPM_CTRL_WTX_ABORT = 0x18, | ||
46 | TPM_CTRL_WTX_ABORT_ACK = 0x18, | ||
47 | TPM_CTRL_ERROR = 0x20, | ||
48 | TPM_CTRL_CHAININGACK = 0x40, | ||
49 | TPM_CTRL_CHAINING = 0x80, | ||
50 | TPM_CTRL_DATA = 0x04, | ||
51 | TPM_CTRL_DATA_CHA = 0x84, | ||
52 | TPM_CTRL_DATA_CHA_ACK = 0xC4 | ||
53 | }; | ||
54 | |||
55 | enum infineon_tpm_register { | ||
56 | WRFIFO = 0x00, | ||
57 | RDFIFO = 0x01, | ||
58 | STAT = 0x02, | ||
59 | CMD = 0x03 | ||
60 | }; | ||
61 | |||
62 | enum infineon_tpm_command_bits { | ||
63 | CMD_DIS = 0x00, | ||
64 | CMD_LP = 0x01, | ||
65 | CMD_RES = 0x02, | ||
66 | CMD_IRQC = 0x06 | ||
67 | }; | ||
68 | |||
69 | enum infineon_tpm_status_bits { | ||
70 | STAT_XFE = 0x00, | ||
71 | STAT_LPA = 0x01, | ||
72 | STAT_FOK = 0x02, | ||
73 | STAT_TOK = 0x03, | ||
74 | STAT_IRQA = 0x06, | ||
75 | STAT_RDA = 0x07 | ||
76 | }; | ||
77 | |||
78 | /* some outgoing values */ | ||
79 | enum infineon_tpm_values { | ||
80 | CHIP_ID1 = 0x20, | ||
81 | CHIP_ID2 = 0x21, | ||
82 | TPM_DAR = 0x30, | ||
83 | RESET_LP_IRQC_DISABLE = 0x41, | ||
84 | ENABLE_REGISTER_PAIR = 0x55, | ||
85 | IOLIMH = 0x60, | ||
86 | IOLIML = 0x61, | ||
87 | DISABLE_REGISTER_PAIR = 0xAA, | ||
88 | IDVENL = 0xF1, | ||
89 | IDVENH = 0xF2, | ||
90 | IDPDL = 0xF3, | ||
91 | IDPDH = 0xF4 | ||
92 | }; | ||
93 | |||
94 | static int number_of_wtx; | ||
95 | |||
96 | static int empty_fifo(struct tpm_chip *chip, int clear_wrfifo) | ||
97 | { | ||
98 | int status; | ||
99 | int check = 0; | ||
100 | int i; | ||
101 | |||
102 | if (clear_wrfifo) { | ||
103 | for (i = 0; i < 4096; i++) { | ||
104 | status = inb(chip->vendor->base + WRFIFO); | ||
105 | if (status == 0xff) { | ||
106 | if (check == 5) | ||
107 | break; | ||
108 | else | ||
109 | check++; | ||
110 | } | ||
111 | } | ||
112 | } | ||
113 | /* Note: The values which are currently in the FIFO of the TPM | ||
114 | are thrown away since there is no usage for them. Usually, | ||
115 | this has nothing to say, since the TPM will give its answer | ||
116 | immediately or will be aborted anyway, so the data here is | ||
117 | usually garbage and useless. | ||
118 | We have to clean this, because the next communication with | ||
119 | the TPM would be rubbish, if there is still some old data | ||
120 | in the Read FIFO. | ||
121 | */ | ||
122 | i = 0; | ||
123 | do { | ||
124 | status = inb(chip->vendor->base + RDFIFO); | ||
125 | status = inb(chip->vendor->base + STAT); | ||
126 | i++; | ||
127 | if (i == TPM_MAX_TRIES) | ||
128 | return -EIO; | ||
129 | } while ((status & (1 << STAT_RDA)) != 0); | ||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | static int wait(struct tpm_chip *chip, int wait_for_bit) | ||
134 | { | ||
135 | int status; | ||
136 | int i; | ||
137 | for (i = 0; i < TPM_MAX_TRIES; i++) { | ||
138 | status = inb(chip->vendor->base + STAT); | ||
139 | /* check the status-register if wait_for_bit is set */ | ||
140 | if (status & 1 << wait_for_bit) | ||
141 | break; | ||
142 | msleep(TPM_MSLEEP_TIME); | ||
143 | } | ||
144 | if (i == TPM_MAX_TRIES) { /* timeout occurs */ | ||
145 | if (wait_for_bit == STAT_XFE) | ||
146 | dev_err(&chip->pci_dev->dev, | ||
147 | "Timeout in wait(STAT_XFE)\n"); | ||
148 | if (wait_for_bit == STAT_RDA) | ||
149 | dev_err(&chip->pci_dev->dev, | ||
150 | "Timeout in wait(STAT_RDA)\n"); | ||
151 | return -EIO; | ||
152 | } | ||
153 | return 0; | ||
154 | }; | ||
155 | |||
156 | static void wait_and_send(struct tpm_chip *chip, u8 sendbyte) | ||
157 | { | ||
158 | wait(chip, STAT_XFE); | ||
159 | outb(sendbyte, chip->vendor->base + WRFIFO); | ||
160 | } | ||
161 | |||
162 | /* Note: WTX means Waiting-Time-Extension. Whenever the TPM needs more | ||
163 | calculation time, it sends a WTX-package, which has to be acknowledged | ||
164 | or aborted. This usually occurs if you are hammering the TPM with key | ||
165 | creation. Set the maximum number of WTX-packages in the definitions | ||
166 | above, if the number is reached, the waiting-time will be denied | ||
167 | and the TPM command has to be resend. | ||
168 | */ | ||
169 | |||
170 | static void tpm_wtx(struct tpm_chip *chip) | ||
171 | { | ||
172 | number_of_wtx++; | ||
173 | dev_info(&chip->pci_dev->dev, "Granting WTX (%02d / %02d)\n", | ||
174 | number_of_wtx, TPM_MAX_WTX_PACKAGES); | ||
175 | wait_and_send(chip, TPM_VL_VER); | ||
176 | wait_and_send(chip, TPM_CTRL_WTX); | ||
177 | wait_and_send(chip, 0x00); | ||
178 | wait_and_send(chip, 0x00); | ||
179 | msleep(TPM_WTX_MSLEEP_TIME); | ||
180 | } | ||
181 | |||
182 | static void tpm_wtx_abort(struct tpm_chip *chip) | ||
183 | { | ||
184 | dev_info(&chip->pci_dev->dev, "Aborting WTX\n"); | ||
185 | wait_and_send(chip, TPM_VL_VER); | ||
186 | wait_and_send(chip, TPM_CTRL_WTX_ABORT); | ||
187 | wait_and_send(chip, 0x00); | ||
188 | wait_and_send(chip, 0x00); | ||
189 | number_of_wtx = 0; | ||
190 | msleep(TPM_WTX_MSLEEP_TIME); | ||
191 | } | ||
192 | |||
193 | static int tpm_inf_recv(struct tpm_chip *chip, u8 * buf, size_t count) | ||
194 | { | ||
195 | int i; | ||
196 | int ret; | ||
197 | u32 size = 0; | ||
198 | |||
199 | recv_begin: | ||
200 | /* start receiving header */ | ||
201 | for (i = 0; i < 4; i++) { | ||
202 | ret = wait(chip, STAT_RDA); | ||
203 | if (ret) | ||
204 | return -EIO; | ||
205 | buf[i] = inb(chip->vendor->base + RDFIFO); | ||
206 | } | ||
207 | |||
208 | if (buf[0] != TPM_VL_VER) { | ||
209 | dev_err(&chip->pci_dev->dev, | ||
210 | "Wrong transport protocol implementation!\n"); | ||
211 | return -EIO; | ||
212 | } | ||
213 | |||
214 | if (buf[1] == TPM_CTRL_DATA) { | ||
215 | /* size of the data received */ | ||
216 | size = ((buf[2] << 8) | buf[3]); | ||
217 | |||
218 | for (i = 0; i < size; i++) { | ||
219 | wait(chip, STAT_RDA); | ||
220 | buf[i] = inb(chip->vendor->base + RDFIFO); | ||
221 | } | ||
222 | |||
223 | if ((size == 0x6D00) && (buf[1] == 0x80)) { | ||
224 | dev_err(&chip->pci_dev->dev, | ||
225 | "Error handling on vendor layer!\n"); | ||
226 | return -EIO; | ||
227 | } | ||
228 | |||
229 | for (i = 0; i < size; i++) | ||
230 | buf[i] = buf[i + 6]; | ||
231 | |||
232 | size = size - 6; | ||
233 | return size; | ||
234 | } | ||
235 | |||
236 | if (buf[1] == TPM_CTRL_WTX) { | ||
237 | dev_info(&chip->pci_dev->dev, "WTX-package received\n"); | ||
238 | if (number_of_wtx < TPM_MAX_WTX_PACKAGES) { | ||
239 | tpm_wtx(chip); | ||
240 | goto recv_begin; | ||
241 | } else { | ||
242 | tpm_wtx_abort(chip); | ||
243 | goto recv_begin; | ||
244 | } | ||
245 | } | ||
246 | |||
247 | if (buf[1] == TPM_CTRL_WTX_ABORT_ACK) { | ||
248 | dev_info(&chip->pci_dev->dev, "WTX-abort acknowledged\n"); | ||
249 | return size; | ||
250 | } | ||
251 | |||
252 | if (buf[1] == TPM_CTRL_ERROR) { | ||
253 | dev_err(&chip->pci_dev->dev, "ERROR-package received:\n"); | ||
254 | if (buf[4] == TPM_INF_NAK) | ||
255 | dev_err(&chip->pci_dev->dev, | ||
256 | "-> Negative acknowledgement" | ||
257 | " - retransmit command!\n"); | ||
258 | return -EIO; | ||
259 | } | ||
260 | return -EIO; | ||
261 | } | ||
262 | |||
263 | static int tpm_inf_send(struct tpm_chip *chip, u8 * buf, size_t count) | ||
264 | { | ||
265 | int i; | ||
266 | int ret; | ||
267 | u8 count_high, count_low, count_4, count_3, count_2, count_1; | ||
268 | |||
269 | /* Disabling Reset, LP and IRQC */ | ||
270 | outb(RESET_LP_IRQC_DISABLE, chip->vendor->base + CMD); | ||
271 | |||
272 | ret = empty_fifo(chip, 1); | ||
273 | if (ret) { | ||
274 | dev_err(&chip->pci_dev->dev, "Timeout while clearing FIFO\n"); | ||
275 | return -EIO; | ||
276 | } | ||
277 | |||
278 | ret = wait(chip, STAT_XFE); | ||
279 | if (ret) | ||
280 | return -EIO; | ||
281 | |||
282 | count_4 = (count & 0xff000000) >> 24; | ||
283 | count_3 = (count & 0x00ff0000) >> 16; | ||
284 | count_2 = (count & 0x0000ff00) >> 8; | ||
285 | count_1 = (count & 0x000000ff); | ||
286 | count_high = ((count + 6) & 0xffffff00) >> 8; | ||
287 | count_low = ((count + 6) & 0x000000ff); | ||
288 | |||
289 | /* Sending Header */ | ||
290 | wait_and_send(chip, TPM_VL_VER); | ||
291 | wait_and_send(chip, TPM_CTRL_DATA); | ||
292 | wait_and_send(chip, count_high); | ||
293 | wait_and_send(chip, count_low); | ||
294 | |||
295 | /* Sending Data Header */ | ||
296 | wait_and_send(chip, TPM_VL_VER); | ||
297 | wait_and_send(chip, TPM_VL_CHANNEL_TPM); | ||
298 | wait_and_send(chip, count_4); | ||
299 | wait_and_send(chip, count_3); | ||
300 | wait_and_send(chip, count_2); | ||
301 | wait_and_send(chip, count_1); | ||
302 | |||
303 | /* Sending Data */ | ||
304 | for (i = 0; i < count; i++) { | ||
305 | wait_and_send(chip, buf[i]); | ||
306 | } | ||
307 | return count; | ||
308 | } | ||
309 | |||
310 | static void tpm_inf_cancel(struct tpm_chip *chip) | ||
311 | { | ||
312 | /* | ||
313 | Since we are using the legacy mode to communicate | ||
314 | with the TPM, we have no cancel functions, but have | ||
315 | a workaround for interrupting the TPM through WTX. | ||
316 | */ | ||
317 | } | ||
318 | |||
319 | static DEVICE_ATTR(pubek, S_IRUGO, tpm_show_pubek, NULL); | ||
320 | static DEVICE_ATTR(pcrs, S_IRUGO, tpm_show_pcrs, NULL); | ||
321 | static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps, NULL); | ||
322 | static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); | ||
323 | |||
324 | static struct attribute *inf_attrs[] = { | ||
325 | &dev_attr_pubek.attr, | ||
326 | &dev_attr_pcrs.attr, | ||
327 | &dev_attr_caps.attr, | ||
328 | &dev_attr_cancel.attr, | ||
329 | NULL, | ||
330 | }; | ||
331 | |||
332 | static struct attribute_group inf_attr_grp = {.attrs = inf_attrs }; | ||
333 | |||
334 | static struct file_operations inf_ops = { | ||
335 | .owner = THIS_MODULE, | ||
336 | .llseek = no_llseek, | ||
337 | .open = tpm_open, | ||
338 | .read = tpm_read, | ||
339 | .write = tpm_write, | ||
340 | .release = tpm_release, | ||
341 | }; | ||
342 | |||
343 | static struct tpm_vendor_specific tpm_inf = { | ||
344 | .recv = tpm_inf_recv, | ||
345 | .send = tpm_inf_send, | ||
346 | .cancel = tpm_inf_cancel, | ||
347 | .req_complete_mask = 0, | ||
348 | .req_complete_val = 0, | ||
349 | .attr_group = &inf_attr_grp, | ||
350 | .miscdev = {.fops = &inf_ops,}, | ||
351 | }; | ||
352 | |||
353 | static const struct pnp_device_id tpm_pnp_tbl[] = { | ||
354 | /* Infineon TPMs */ | ||
355 | {"IFX0101", 0}, | ||
356 | {"IFX0102", 0}, | ||
357 | {"", 0} | ||
358 | }; | ||
359 | |||
360 | static int __devinit tpm_inf_acpi_probe(struct pnp_dev *dev, | ||
361 | const struct pnp_device_id *dev_id) | ||
362 | { | ||
363 | TPM_INF_ADDR = (pnp_port_start(dev, 0) & 0xff); | ||
364 | TPM_INF_DATA = ((TPM_INF_ADDR + 1) & 0xff); | ||
365 | tpm_inf.base = pnp_port_start(dev, 1); | ||
366 | dev_info(&dev->dev, "Found %s with ID %s\n", | ||
367 | dev->name, dev_id->id); | ||
368 | if (!((tpm_inf.base >> 8) & 0xff)) | ||
369 | tpm_inf.base = 0; | ||
370 | return 0; | ||
371 | } | ||
372 | |||
373 | static struct pnp_driver tpm_inf_pnp = { | ||
374 | .name = "tpm_inf_pnp", | ||
375 | .id_table = tpm_pnp_tbl, | ||
376 | .probe = tpm_inf_acpi_probe, | ||
377 | }; | ||
378 | |||
379 | static int __devinit tpm_inf_probe(struct pci_dev *pci_dev, | ||
380 | const struct pci_device_id *pci_id) | ||
381 | { | ||
382 | int rc = 0; | ||
383 | u8 iol, ioh; | ||
384 | int vendorid[2]; | ||
385 | int version[2]; | ||
386 | int productid[2]; | ||
387 | char chipname[20]; | ||
388 | |||
389 | if (pci_enable_device(pci_dev)) | ||
390 | return -EIO; | ||
391 | |||
392 | dev_info(&pci_dev->dev, "LPC-bus found at 0x%x\n", pci_id->device); | ||
393 | |||
394 | /* read IO-ports from ACPI */ | ||
395 | pnp_register_driver(&tpm_inf_pnp); | ||
396 | pnp_unregister_driver(&tpm_inf_pnp); | ||
397 | |||
398 | /* Make sure, we have received valid config ports */ | ||
399 | if (!TPM_INF_ADDR) { | ||
400 | pci_disable_device(pci_dev); | ||
401 | return -EIO; | ||
402 | } | ||
403 | |||
404 | /* query chip for its vendor, its version number a.s.o. */ | ||
405 | outb(ENABLE_REGISTER_PAIR, TPM_INF_ADDR); | ||
406 | outb(IDVENL, TPM_INF_ADDR); | ||
407 | vendorid[1] = inb(TPM_INF_DATA); | ||
408 | outb(IDVENH, TPM_INF_ADDR); | ||
409 | vendorid[0] = inb(TPM_INF_DATA); | ||
410 | outb(IDPDL, TPM_INF_ADDR); | ||
411 | productid[1] = inb(TPM_INF_DATA); | ||
412 | outb(IDPDH, TPM_INF_ADDR); | ||
413 | productid[0] = inb(TPM_INF_DATA); | ||
414 | outb(CHIP_ID1, TPM_INF_ADDR); | ||
415 | version[1] = inb(TPM_INF_DATA); | ||
416 | outb(CHIP_ID2, TPM_INF_ADDR); | ||
417 | version[0] = inb(TPM_INF_DATA); | ||
418 | |||
419 | switch ((productid[0] << 8) | productid[1]) { | ||
420 | case 6: | ||
421 | sprintf(chipname, " (SLD 9630 TT 1.1)"); | ||
422 | break; | ||
423 | case 11: | ||
424 | sprintf(chipname, " (SLB 9635 TT 1.2)"); | ||
425 | break; | ||
426 | default: | ||
427 | sprintf(chipname, " (unknown chip)"); | ||
428 | break; | ||
429 | } | ||
430 | chipname[19] = 0; | ||
431 | |||
432 | if ((vendorid[0] << 8 | vendorid[1]) == (TPM_INFINEON_DEV_VEN_VALUE)) { | ||
433 | |||
434 | if (tpm_inf.base == 0) { | ||
435 | dev_err(&pci_dev->dev, "No IO-ports found!\n"); | ||
436 | pci_disable_device(pci_dev); | ||
437 | return -EIO; | ||
438 | } | ||
439 | /* configure TPM with IO-ports */ | ||
440 | outb(IOLIMH, TPM_INF_ADDR); | ||
441 | outb(((tpm_inf.base >> 8) & 0xff), TPM_INF_DATA); | ||
442 | outb(IOLIML, TPM_INF_ADDR); | ||
443 | outb((tpm_inf.base & 0xff), TPM_INF_DATA); | ||
444 | |||
445 | /* control if IO-ports are set correctly */ | ||
446 | outb(IOLIMH, TPM_INF_ADDR); | ||
447 | ioh = inb(TPM_INF_DATA); | ||
448 | outb(IOLIML, TPM_INF_ADDR); | ||
449 | iol = inb(TPM_INF_DATA); | ||
450 | |||
451 | if ((ioh << 8 | iol) != tpm_inf.base) { | ||
452 | dev_err(&pci_dev->dev, | ||
453 | "Could not set IO-ports to %04x\n", | ||
454 | tpm_inf.base); | ||
455 | pci_disable_device(pci_dev); | ||
456 | return -EIO; | ||
457 | } | ||
458 | |||
459 | /* activate register */ | ||
460 | outb(TPM_DAR, TPM_INF_ADDR); | ||
461 | outb(0x01, TPM_INF_DATA); | ||
462 | outb(DISABLE_REGISTER_PAIR, TPM_INF_ADDR); | ||
463 | |||
464 | /* disable RESET, LP and IRQC */ | ||
465 | outb(RESET_LP_IRQC_DISABLE, tpm_inf.base + CMD); | ||
466 | |||
467 | /* Finally, we're done, print some infos */ | ||
468 | dev_info(&pci_dev->dev, "TPM found: " | ||
469 | "config base 0x%x, " | ||
470 | "io base 0x%x, " | ||
471 | "chip version %02x%02x, " | ||
472 | "vendor id %x%x (Infineon), " | ||
473 | "product id %02x%02x" | ||
474 | "%s\n", | ||
475 | TPM_INF_ADDR, | ||
476 | tpm_inf.base, | ||
477 | version[0], version[1], | ||
478 | vendorid[0], vendorid[1], | ||
479 | productid[0], productid[1], chipname); | ||
480 | |||
481 | rc = tpm_register_hardware(pci_dev, &tpm_inf); | ||
482 | if (rc < 0) { | ||
483 | pci_disable_device(pci_dev); | ||
484 | return -ENODEV; | ||
485 | } | ||
486 | return 0; | ||
487 | } else { | ||
488 | dev_info(&pci_dev->dev, "No Infineon TPM found!\n"); | ||
489 | pci_disable_device(pci_dev); | ||
490 | return -ENODEV; | ||
491 | } | ||
492 | } | ||
493 | |||
494 | static struct pci_device_id tpm_pci_tbl[] __devinitdata = { | ||
495 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0)}, | ||
496 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12)}, | ||
497 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0)}, | ||
498 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12)}, | ||
499 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0)}, | ||
500 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0)}, | ||
501 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1)}, | ||
502 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2)}, | ||
503 | {0,} | ||
504 | }; | ||
505 | |||
506 | MODULE_DEVICE_TABLE(pci, tpm_pci_tbl); | ||
507 | |||
508 | static struct pci_driver inf_pci_driver = { | ||
509 | .name = "tpm_inf", | ||
510 | .id_table = tpm_pci_tbl, | ||
511 | .probe = tpm_inf_probe, | ||
512 | .remove = __devexit_p(tpm_remove), | ||
513 | .suspend = tpm_pm_suspend, | ||
514 | .resume = tpm_pm_resume, | ||
515 | }; | ||
516 | |||
517 | static int __init init_inf(void) | ||
518 | { | ||
519 | return pci_register_driver(&inf_pci_driver); | ||
520 | } | ||
521 | |||
522 | static void __exit cleanup_inf(void) | ||
523 | { | ||
524 | pci_unregister_driver(&inf_pci_driver); | ||
525 | } | ||
526 | |||
527 | module_init(init_inf); | ||
528 | module_exit(cleanup_inf); | ||
529 | |||
530 | MODULE_AUTHOR("Marcel Selhorst <selhorst@crypto.rub.de>"); | ||
531 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); | ||
532 | MODULE_VERSION("1.5"); | ||
533 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/char/watchdog/acquirewdt.c b/drivers/char/watchdog/acquirewdt.c index 8f302121741b..7289f4af93d0 100644 --- a/drivers/char/watchdog/acquirewdt.c +++ b/drivers/char/watchdog/acquirewdt.c | |||
@@ -82,12 +82,7 @@ static int wdt_start = 0x443; | |||
82 | module_param(wdt_start, int, 0); | 82 | module_param(wdt_start, int, 0); |
83 | MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); | 83 | MODULE_PARM_DESC(wdt_start, "Acquire WDT 'start' io port (default 0x443)"); |
84 | 84 | ||
85 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 85 | static int nowayout = WATCHDOG_NOWAYOUT; |
86 | static int nowayout = 1; | ||
87 | #else | ||
88 | static int nowayout = 0; | ||
89 | #endif | ||
90 | |||
91 | module_param(nowayout, int, 0); | 86 | module_param(nowayout, int, 0); |
92 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 87 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
93 | 88 | ||
diff --git a/drivers/char/watchdog/advantechwdt.c b/drivers/char/watchdog/advantechwdt.c index ea73c8379bdd..194a3fd36b91 100644 --- a/drivers/char/watchdog/advantechwdt.c +++ b/drivers/char/watchdog/advantechwdt.c | |||
@@ -73,12 +73,7 @@ static int timeout = WATCHDOG_TIMEOUT; /* in seconds */ | |||
73 | module_param(timeout, int, 0); | 73 | module_param(timeout, int, 0); |
74 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); | 74 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); |
75 | 75 | ||
76 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 76 | static int nowayout = WATCHDOG_NOWAYOUT; |
77 | static int nowayout = 1; | ||
78 | #else | ||
79 | static int nowayout = 0; | ||
80 | #endif | ||
81 | |||
82 | module_param(nowayout, int, 0); | 77 | module_param(nowayout, int, 0); |
83 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 78 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
84 | 79 | ||
diff --git a/drivers/char/watchdog/alim1535_wdt.c b/drivers/char/watchdog/alim1535_wdt.c index 35dcbf8be7d1..8338ca300e2e 100644 --- a/drivers/char/watchdog/alim1535_wdt.c +++ b/drivers/char/watchdog/alim1535_wdt.c | |||
@@ -38,12 +38,7 @@ static int timeout = WATCHDOG_TIMEOUT; | |||
38 | module_param(timeout, int, 0); | 38 | module_param(timeout, int, 0); |
39 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0<timeout<18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 39 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (0<timeout<18000, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); |
40 | 40 | ||
41 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 41 | static int nowayout = WATCHDOG_NOWAYOUT; |
42 | static int nowayout = 1; | ||
43 | #else | ||
44 | static int nowayout = 0; | ||
45 | #endif | ||
46 | |||
47 | module_param(nowayout, int, 0); | 42 | module_param(nowayout, int, 0); |
48 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 43 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
49 | 44 | ||
@@ -317,7 +312,7 @@ static int ali_notify_sys(struct notifier_block *this, unsigned long code, void | |||
317 | */ | 312 | */ |
318 | 313 | ||
319 | static struct pci_device_id ali_pci_tbl[] = { | 314 | static struct pci_device_id ali_pci_tbl[] = { |
320 | { PCI_VENDOR_ID_AL, 1535, PCI_ANY_ID, PCI_ANY_ID,}, | 315 | { PCI_VENDOR_ID_AL, 0x1535, PCI_ANY_ID, PCI_ANY_ID,}, |
321 | { 0, }, | 316 | { 0, }, |
322 | }; | 317 | }; |
323 | MODULE_DEVICE_TABLE(pci, ali_pci_tbl); | 318 | MODULE_DEVICE_TABLE(pci, ali_pci_tbl); |
diff --git a/drivers/char/watchdog/alim7101_wdt.c b/drivers/char/watchdog/alim7101_wdt.c index 90c091d9e0f5..c05ac188a4d7 100644 --- a/drivers/char/watchdog/alim7101_wdt.c +++ b/drivers/char/watchdog/alim7101_wdt.c | |||
@@ -75,12 +75,7 @@ static unsigned long wdt_is_open; | |||
75 | static char wdt_expect_close; | 75 | static char wdt_expect_close; |
76 | static struct pci_dev *alim7101_pmu; | 76 | static struct pci_dev *alim7101_pmu; |
77 | 77 | ||
78 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 78 | static int nowayout = WATCHDOG_NOWAYOUT; |
79 | static int nowayout = 1; | ||
80 | #else | ||
81 | static int nowayout = 0; | ||
82 | #endif | ||
83 | |||
84 | module_param(nowayout, int, 0); | 79 | module_param(nowayout, int, 0); |
85 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 80 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
86 | 81 | ||
diff --git a/drivers/char/watchdog/eurotechwdt.c b/drivers/char/watchdog/eurotechwdt.c index 2a29a511df7f..25c2f2575611 100644 --- a/drivers/char/watchdog/eurotechwdt.c +++ b/drivers/char/watchdog/eurotechwdt.c | |||
@@ -72,12 +72,7 @@ static char *ev = "int"; | |||
72 | 72 | ||
73 | #define WDT_TIMEOUT 60 /* 1 minute */ | 73 | #define WDT_TIMEOUT 60 /* 1 minute */ |
74 | 74 | ||
75 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 75 | static int nowayout = WATCHDOG_NOWAYOUT; |
76 | static int nowayout = 1; | ||
77 | #else | ||
78 | static int nowayout = 0; | ||
79 | #endif | ||
80 | |||
81 | module_param(nowayout, int, 0); | 76 | module_param(nowayout, int, 0); |
82 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 77 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
83 | 78 | ||
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c index 5d07ee59679d..f975dab1ddf9 100644 --- a/drivers/char/watchdog/i8xx_tco.c +++ b/drivers/char/watchdog/i8xx_tco.c | |||
@@ -105,12 +105,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ | |||
105 | module_param(heartbeat, int, 0); | 105 | module_param(heartbeat, int, 0); |
106 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<heartbeat<39, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); | 106 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<heartbeat<39, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
107 | 107 | ||
108 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 108 | static int nowayout = WATCHDOG_NOWAYOUT; |
109 | static int nowayout = 1; | ||
110 | #else | ||
111 | static int nowayout = 0; | ||
112 | #endif | ||
113 | |||
114 | module_param(nowayout, int, 0); | 109 | module_param(nowayout, int, 0); |
115 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 110 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
116 | 111 | ||
diff --git a/drivers/char/watchdog/ib700wdt.c b/drivers/char/watchdog/ib700wdt.c index d974f16e84d2..cf60329eec85 100644 --- a/drivers/char/watchdog/ib700wdt.c +++ b/drivers/char/watchdog/ib700wdt.c | |||
@@ -117,12 +117,7 @@ static int wd_times[] = { | |||
117 | 117 | ||
118 | static int wd_margin = WD_TIMO; | 118 | static int wd_margin = WD_TIMO; |
119 | 119 | ||
120 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 120 | static int nowayout = WATCHDOG_NOWAYOUT; |
121 | static int nowayout = 1; | ||
122 | #else | ||
123 | static int nowayout = 0; | ||
124 | #endif | ||
125 | |||
126 | module_param(nowayout, int, 0); | 121 | module_param(nowayout, int, 0); |
127 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 122 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
128 | 123 | ||
diff --git a/drivers/char/watchdog/indydog.c b/drivers/char/watchdog/indydog.c index 6af2c799b57e..b4b94daba67e 100644 --- a/drivers/char/watchdog/indydog.c +++ b/drivers/char/watchdog/indydog.c | |||
@@ -29,14 +29,9 @@ | |||
29 | #define PFX "indydog: " | 29 | #define PFX "indydog: " |
30 | static int indydog_alive; | 30 | static int indydog_alive; |
31 | 31 | ||
32 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | ||
33 | static int nowayout = 1; | ||
34 | #else | ||
35 | static int nowayout = 0; | ||
36 | #endif | ||
37 | |||
38 | #define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */ | 32 | #define WATCHDOG_TIMEOUT 30 /* 30 sec default timeout */ |
39 | 33 | ||
34 | static int nowayout = WATCHDOG_NOWAYOUT; | ||
40 | module_param(nowayout, int, 0); | 35 | module_param(nowayout, int, 0); |
41 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 36 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
42 | 37 | ||
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c index 4b039516cc86..e7640bc4904b 100644 --- a/drivers/char/watchdog/ixp2000_wdt.c +++ b/drivers/char/watchdog/ixp2000_wdt.c | |||
@@ -30,11 +30,7 @@ | |||
30 | #include <asm/hardware.h> | 30 | #include <asm/hardware.h> |
31 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
32 | 32 | ||
33 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 33 | static int nowayout = WATCHDOG_NOWAYOUT; |
34 | static int nowayout = 1; | ||
35 | #else | ||
36 | static int nowayout = 0; | ||
37 | #endif | ||
38 | static unsigned int heartbeat = 60; /* (secs) Default is 1 minute */ | 34 | static unsigned int heartbeat = 60; /* (secs) Default is 1 minute */ |
39 | static unsigned long wdt_status; | 35 | static unsigned long wdt_status; |
40 | 36 | ||
diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c index 83df369113a4..8d916afbf4fa 100644 --- a/drivers/char/watchdog/ixp4xx_wdt.c +++ b/drivers/char/watchdog/ixp4xx_wdt.c | |||
@@ -27,11 +27,7 @@ | |||
27 | #include <asm/hardware.h> | 27 | #include <asm/hardware.h> |
28 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
29 | 29 | ||
30 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 30 | static int nowayout = WATCHDOG_NOWAYOUT; |
31 | static int nowayout = 1; | ||
32 | #else | ||
33 | static int nowayout = 0; | ||
34 | #endif | ||
35 | static int heartbeat = 60; /* (secs) Default is 1 minute */ | 31 | static int heartbeat = 60; /* (secs) Default is 1 minute */ |
36 | static unsigned long wdt_status; | 32 | static unsigned long wdt_status; |
37 | static unsigned long boot_status; | 33 | static unsigned long boot_status; |
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c index 9da395fa7794..a9a20aad61e7 100644 --- a/drivers/char/watchdog/machzwd.c +++ b/drivers/char/watchdog/machzwd.c | |||
@@ -94,12 +94,7 @@ MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver"); | |||
94 | MODULE_LICENSE("GPL"); | 94 | MODULE_LICENSE("GPL"); |
95 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 95 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
96 | 96 | ||
97 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 97 | static int nowayout = WATCHDOG_NOWAYOUT; |
98 | static int nowayout = 1; | ||
99 | #else | ||
100 | static int nowayout = 0; | ||
101 | #endif | ||
102 | |||
103 | module_param(nowayout, int, 0); | 98 | module_param(nowayout, int, 0); |
104 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 99 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
105 | 100 | ||
diff --git a/drivers/char/watchdog/mixcomwd.c b/drivers/char/watchdog/mixcomwd.c index 3143e4a07535..c9b301dccec3 100644 --- a/drivers/char/watchdog/mixcomwd.c +++ b/drivers/char/watchdog/mixcomwd.c | |||
@@ -62,12 +62,7 @@ static int mixcomwd_timer_alive; | |||
62 | static struct timer_list mixcomwd_timer = TIMER_INITIALIZER(NULL, 0, 0); | 62 | static struct timer_list mixcomwd_timer = TIMER_INITIALIZER(NULL, 0, 0); |
63 | static char expect_close; | 63 | static char expect_close; |
64 | 64 | ||
65 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 65 | static int nowayout = WATCHDOG_NOWAYOUT; |
66 | static int nowayout = 1; | ||
67 | #else | ||
68 | static int nowayout = 0; | ||
69 | #endif | ||
70 | |||
71 | module_param(nowayout, int, 0); | 66 | module_param(nowayout, int, 0); |
72 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 67 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
73 | 68 | ||
diff --git a/drivers/char/watchdog/pcwd.c b/drivers/char/watchdog/pcwd.c index 6ebce3f2ef9c..427ad51b7a35 100644 --- a/drivers/char/watchdog/pcwd.c +++ b/drivers/char/watchdog/pcwd.c | |||
@@ -146,12 +146,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; | |||
146 | module_param(heartbeat, int, 0); | 146 | module_param(heartbeat, int, 0); |
147 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); | 147 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<=heartbeat<=7200, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
148 | 148 | ||
149 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 149 | static int nowayout = WATCHDOG_NOWAYOUT; |
150 | static int nowayout = 1; | ||
151 | #else | ||
152 | static int nowayout = 0; | ||
153 | #endif | ||
154 | |||
155 | module_param(nowayout, int, 0); | 150 | module_param(nowayout, int, 0); |
156 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 151 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
157 | 152 | ||
diff --git a/drivers/char/watchdog/pcwd_pci.c b/drivers/char/watchdog/pcwd_pci.c index 8ce066627326..2b13afb09c5d 100644 --- a/drivers/char/watchdog/pcwd_pci.c +++ b/drivers/char/watchdog/pcwd_pci.c | |||
@@ -103,12 +103,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; | |||
103 | module_param(heartbeat, int, 0); | 103 | module_param(heartbeat, int, 0); |
104 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); | 104 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
105 | 105 | ||
106 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 106 | static int nowayout = WATCHDOG_NOWAYOUT; |
107 | static int nowayout = 1; | ||
108 | #else | ||
109 | static int nowayout = 0; | ||
110 | #endif | ||
111 | |||
112 | module_param(nowayout, int, 0); | 107 | module_param(nowayout, int, 0); |
113 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 108 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
114 | 109 | ||
diff --git a/drivers/char/watchdog/pcwd_usb.c b/drivers/char/watchdog/pcwd_usb.c index 1127201d73b8..092e9b133750 100644 --- a/drivers/char/watchdog/pcwd_usb.c +++ b/drivers/char/watchdog/pcwd_usb.c | |||
@@ -79,12 +79,7 @@ static int heartbeat = WATCHDOG_HEARTBEAT; | |||
79 | module_param(heartbeat, int, 0); | 79 | module_param(heartbeat, int, 0); |
80 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); | 80 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); |
81 | 81 | ||
82 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 82 | static int nowayout = WATCHDOG_NOWAYOUT; |
83 | static int nowayout = 1; | ||
84 | #else | ||
85 | static int nowayout = 0; | ||
86 | #endif | ||
87 | |||
88 | module_param(nowayout, int, 0); | 83 | module_param(nowayout, int, 0); |
89 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 84 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
90 | 85 | ||
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index 1699d2c28ce5..f85ac898a49a 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c | |||
@@ -62,12 +62,7 @@ | |||
62 | #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) | 62 | #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) |
63 | #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) | 63 | #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) |
64 | 64 | ||
65 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 65 | static int nowayout = WATCHDOG_NOWAYOUT; |
66 | static int nowayout = 1; | ||
67 | #else | ||
68 | static int nowayout = 0; | ||
69 | #endif | ||
70 | |||
71 | static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; | 66 | static int tmr_margin = CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME; |
72 | static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; | 67 | static int tmr_atboot = CONFIG_S3C2410_WATCHDOG_ATBOOT; |
73 | static int soft_noboot = 0; | 68 | static int soft_noboot = 0; |
diff --git a/drivers/char/watchdog/sa1100_wdt.c b/drivers/char/watchdog/sa1100_wdt.c index 34e8f7b15e30..fb88b4041dca 100644 --- a/drivers/char/watchdog/sa1100_wdt.c +++ b/drivers/char/watchdog/sa1100_wdt.c | |||
@@ -36,17 +36,10 @@ | |||
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | 37 | ||
38 | #define OSCR_FREQ CLOCK_TICK_RATE | 38 | #define OSCR_FREQ CLOCK_TICK_RATE |
39 | #define SA1100_CLOSE_MAGIC (0x5afc4453) | ||
40 | 39 | ||
41 | static unsigned long sa1100wdt_users; | 40 | static unsigned long sa1100wdt_users; |
42 | static int expect_close; | ||
43 | static int pre_margin; | 41 | static int pre_margin; |
44 | static int boot_status; | 42 | static int boot_status; |
45 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | ||
46 | static int nowayout = 1; | ||
47 | #else | ||
48 | static int nowayout = 0; | ||
49 | #endif | ||
50 | 43 | ||
51 | /* | 44 | /* |
52 | * Allow only one person to hold it open | 45 | * Allow only one person to hold it open |
@@ -66,55 +59,33 @@ static int sa1100dog_open(struct inode *inode, struct file *file) | |||
66 | } | 59 | } |
67 | 60 | ||
68 | /* | 61 | /* |
69 | * Shut off the timer. | 62 | * The watchdog cannot be disabled. |
70 | * Lock it in if it's a module and we defined ...NOWAYOUT | 63 | * |
71 | * Oddly, the watchdog can only be enabled, but we can turn off | 64 | * Previous comments suggested that turning off the interrupt by |
72 | * the interrupt, which appears to prevent the watchdog timing out. | 65 | * clearing OIER[E3] would prevent the watchdog timing out but this |
66 | * does not appear to be true (at least on the PXA255). | ||
73 | */ | 67 | */ |
74 | static int sa1100dog_release(struct inode *inode, struct file *file) | 68 | static int sa1100dog_release(struct inode *inode, struct file *file) |
75 | { | 69 | { |
76 | OSMR3 = OSCR + pre_margin; | 70 | printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n"); |
77 | |||
78 | if (expect_close == SA1100_CLOSE_MAGIC) { | ||
79 | OIER &= ~OIER_E3; | ||
80 | } else { | ||
81 | printk(KERN_CRIT "WATCHDOG: WDT device closed unexpectedly. WDT will not stop!\n"); | ||
82 | } | ||
83 | 71 | ||
84 | clear_bit(1, &sa1100wdt_users); | 72 | clear_bit(1, &sa1100wdt_users); |
85 | expect_close = 0; | ||
86 | 73 | ||
87 | return 0; | 74 | return 0; |
88 | } | 75 | } |
89 | 76 | ||
90 | static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos) | 77 | static ssize_t sa1100dog_write(struct file *file, const char *data, size_t len, loff_t *ppos) |
91 | { | 78 | { |
92 | if (len) { | 79 | if (len) |
93 | if (!nowayout) { | ||
94 | size_t i; | ||
95 | |||
96 | expect_close = 0; | ||
97 | |||
98 | for (i = 0; i != len; i++) { | ||
99 | char c; | ||
100 | |||
101 | if (get_user(c, data + i)) | ||
102 | return -EFAULT; | ||
103 | if (c == 'V') | ||
104 | expect_close = SA1100_CLOSE_MAGIC; | ||
105 | } | ||
106 | } | ||
107 | /* Refresh OSMR3 timer. */ | 80 | /* Refresh OSMR3 timer. */ |
108 | OSMR3 = OSCR + pre_margin; | 81 | OSMR3 = OSCR + pre_margin; |
109 | } | ||
110 | 82 | ||
111 | return len; | 83 | return len; |
112 | } | 84 | } |
113 | 85 | ||
114 | static struct watchdog_info ident = { | 86 | static struct watchdog_info ident = { |
115 | .options = WDIOF_CARDRESET | WDIOF_MAGICCLOSE | | 87 | .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, |
116 | WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, | 88 | .identity = "SA1100/PXA255 Watchdog", |
117 | .identity = "SA1100 Watchdog", | ||
118 | }; | 89 | }; |
119 | 90 | ||
120 | static int sa1100dog_ioctl(struct inode *inode, struct file *file, | 91 | static int sa1100dog_ioctl(struct inode *inode, struct file *file, |
@@ -176,7 +147,7 @@ static struct file_operations sa1100dog_fops = | |||
176 | static struct miscdevice sa1100dog_miscdev = | 147 | static struct miscdevice sa1100dog_miscdev = |
177 | { | 148 | { |
178 | .minor = WATCHDOG_MINOR, | 149 | .minor = WATCHDOG_MINOR, |
179 | .name = "SA1100/PXA2xx watchdog", | 150 | .name = "watchdog", |
180 | .fops = &sa1100dog_fops, | 151 | .fops = &sa1100dog_fops, |
181 | }; | 152 | }; |
182 | 153 | ||
@@ -198,7 +169,6 @@ static int __init sa1100dog_init(void) | |||
198 | if (ret == 0) | 169 | if (ret == 0) |
199 | printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", | 170 | printk("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", |
200 | margin); | 171 | margin); |
201 | |||
202 | return ret; | 172 | return ret; |
203 | } | 173 | } |
204 | 174 | ||
@@ -216,8 +186,5 @@ MODULE_DESCRIPTION("SA1100/PXA2xx Watchdog"); | |||
216 | module_param(margin, int, 0); | 186 | module_param(margin, int, 0); |
217 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); | 187 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); |
218 | 188 | ||
219 | module_param(nowayout, int, 0); | ||
220 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); | ||
221 | |||
222 | MODULE_LICENSE("GPL"); | 189 | MODULE_LICENSE("GPL"); |
223 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 190 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
diff --git a/drivers/char/watchdog/sbc60xxwdt.c b/drivers/char/watchdog/sbc60xxwdt.c index d7de9880605a..ed0bd55fbfc1 100644 --- a/drivers/char/watchdog/sbc60xxwdt.c +++ b/drivers/char/watchdog/sbc60xxwdt.c | |||
@@ -98,12 +98,7 @@ static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ t | |||
98 | module_param(timeout, int, 0); | 98 | module_param(timeout, int, 0); |
99 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 99 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); |
100 | 100 | ||
101 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 101 | static int nowayout = WATCHDOG_NOWAYOUT; |
102 | static int nowayout = 1; | ||
103 | #else | ||
104 | static int nowayout = 0; | ||
105 | #endif | ||
106 | |||
107 | module_param(nowayout, int, 0); | 102 | module_param(nowayout, int, 0); |
108 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 103 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
109 | 104 | ||
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c index 24401e84729e..515ce7572049 100644 --- a/drivers/char/watchdog/sc1200wdt.c +++ b/drivers/char/watchdog/sc1200wdt.c | |||
@@ -91,12 +91,7 @@ MODULE_PARM_DESC(io, "io port"); | |||
91 | module_param(timeout, int, 0); | 91 | module_param(timeout, int, 0); |
92 | MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1"); | 92 | MODULE_PARM_DESC(timeout, "range is 0-255 minutes, default is 1"); |
93 | 93 | ||
94 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 94 | static int nowayout = WATCHDOG_NOWAYOUT; |
95 | static int nowayout = 1; | ||
96 | #else | ||
97 | static int nowayout = 0; | ||
98 | #endif | ||
99 | |||
100 | module_param(nowayout, int, 0); | 95 | module_param(nowayout, int, 0); |
101 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 96 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
102 | 97 | ||
diff --git a/drivers/char/watchdog/sc520_wdt.c b/drivers/char/watchdog/sc520_wdt.c index f6d143e1900d..72501be79b0c 100644 --- a/drivers/char/watchdog/sc520_wdt.c +++ b/drivers/char/watchdog/sc520_wdt.c | |||
@@ -94,12 +94,7 @@ static int timeout = WATCHDOG_TIMEOUT; /* in seconds, will be multiplied by HZ t | |||
94 | module_param(timeout, int, 0); | 94 | module_param(timeout, int, 0); |
95 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 95 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); |
96 | 96 | ||
97 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 97 | static int nowayout = WATCHDOG_NOWAYOUT; |
98 | static int nowayout = 1; | ||
99 | #else | ||
100 | static int nowayout = 0; | ||
101 | #endif | ||
102 | |||
103 | module_param(nowayout, int, 0); | 98 | module_param(nowayout, int, 0); |
104 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 99 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
105 | 100 | ||
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c index b569670e4ed5..c4568569f3a8 100644 --- a/drivers/char/watchdog/scx200_wdt.c +++ b/drivers/char/watchdog/scx200_wdt.c | |||
@@ -39,15 +39,11 @@ MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); | |||
39 | MODULE_LICENSE("GPL"); | 39 | MODULE_LICENSE("GPL"); |
40 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 40 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
41 | 41 | ||
42 | #ifndef CONFIG_WATCHDOG_NOWAYOUT | ||
43 | #define CONFIG_WATCHDOG_NOWAYOUT 0 | ||
44 | #endif | ||
45 | |||
46 | static int margin = 60; /* in seconds */ | 42 | static int margin = 60; /* in seconds */ |
47 | module_param(margin, int, 0); | 43 | module_param(margin, int, 0); |
48 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds"); | 44 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds"); |
49 | 45 | ||
50 | static int nowayout = CONFIG_WATCHDOG_NOWAYOUT; | 46 | static int nowayout = WATCHDOG_NOWAYOUT; |
51 | module_param(nowayout, int, 0); | 47 | module_param(nowayout, int, 0); |
52 | MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); | 48 | MODULE_PARM_DESC(nowayout, "Disable watchdog shutdown on close"); |
53 | 49 | ||
diff --git a/drivers/char/watchdog/shwdt.c b/drivers/char/watchdog/shwdt.c index 3bc9272a474c..1f4cab55b2ef 100644 --- a/drivers/char/watchdog/shwdt.c +++ b/drivers/char/watchdog/shwdt.c | |||
@@ -75,11 +75,7 @@ static unsigned long next_heartbeat; | |||
75 | #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ | 75 | #define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ |
76 | static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ | 76 | static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ |
77 | 77 | ||
78 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 78 | static int nowayout = WATCHDOG_NOWAYOUT; |
79 | static int nowayout = 1; | ||
80 | #else | ||
81 | static int nowayout = 0; | ||
82 | #endif | ||
83 | 79 | ||
84 | /** | 80 | /** |
85 | * sh_wdt_start - Start the Watchdog | 81 | * sh_wdt_start - Start the Watchdog |
diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c index 98c7578740e2..4d7ed931f5c6 100644 --- a/drivers/char/watchdog/softdog.c +++ b/drivers/char/watchdog/softdog.c | |||
@@ -56,12 +56,7 @@ static int soft_margin = TIMER_MARGIN; /* in seconds */ | |||
56 | module_param(soft_margin, int, 0); | 56 | module_param(soft_margin, int, 0); |
57 | MODULE_PARM_DESC(soft_margin, "Watchdog soft_margin in seconds. (0<soft_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")"); | 57 | MODULE_PARM_DESC(soft_margin, "Watchdog soft_margin in seconds. (0<soft_margin<65536, default=" __MODULE_STRING(TIMER_MARGIN) ")"); |
58 | 58 | ||
59 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 59 | static int nowayout = WATCHDOG_NOWAYOUT; |
60 | static int nowayout = 1; | ||
61 | #else | ||
62 | static int nowayout = 0; | ||
63 | #endif | ||
64 | |||
65 | module_param(nowayout, int, 0); | 60 | module_param(nowayout, int, 0); |
66 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 61 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
67 | 62 | ||
diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c index 813c97038f84..465e0fd0423d 100644 --- a/drivers/char/watchdog/w83627hf_wdt.c +++ b/drivers/char/watchdog/w83627hf_wdt.c | |||
@@ -54,12 +54,7 @@ static int timeout = WATCHDOG_TIMEOUT; /* in seconds */ | |||
54 | module_param(timeout, int, 0); | 54 | module_param(timeout, int, 0); |
55 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); | 55 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=63, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); |
56 | 56 | ||
57 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 57 | static int nowayout = WATCHDOG_NOWAYOUT; |
58 | static int nowayout = 1; | ||
59 | #else | ||
60 | static int nowayout = 0; | ||
61 | #endif | ||
62 | |||
63 | module_param(nowayout, int, 0); | 58 | module_param(nowayout, int, 0); |
64 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 59 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
65 | 60 | ||
diff --git a/drivers/char/watchdog/w83877f_wdt.c b/drivers/char/watchdog/w83877f_wdt.c index bccbd4d6ac2d..52a8bd0a5988 100644 --- a/drivers/char/watchdog/w83877f_wdt.c +++ b/drivers/char/watchdog/w83877f_wdt.c | |||
@@ -85,12 +85,7 @@ module_param(timeout, int, 0); | |||
85 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); | 85 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. (1<=timeout<=3600, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) ")"); |
86 | 86 | ||
87 | 87 | ||
88 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 88 | static int nowayout = WATCHDOG_NOWAYOUT; |
89 | static int nowayout = 1; | ||
90 | #else | ||
91 | static int nowayout = 0; | ||
92 | #endif | ||
93 | |||
94 | module_param(nowayout, int, 0); | 89 | module_param(nowayout, int, 0); |
95 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 90 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
96 | 91 | ||
diff --git a/drivers/char/watchdog/wafer5823wdt.c b/drivers/char/watchdog/wafer5823wdt.c index abb0bea45c02..7cf6c9bbf486 100644 --- a/drivers/char/watchdog/wafer5823wdt.c +++ b/drivers/char/watchdog/wafer5823wdt.c | |||
@@ -63,12 +63,7 @@ static int timeout = WD_TIMO; /* in seconds */ | |||
63 | module_param(timeout, int, 0); | 63 | module_param(timeout, int, 0); |
64 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WD_TIMO) "."); | 64 | MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=255, default=" __MODULE_STRING(WD_TIMO) "."); |
65 | 65 | ||
66 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 66 | static int nowayout = WATCHDOG_NOWAYOUT; |
67 | static int nowayout = 1; | ||
68 | #else | ||
69 | static int nowayout = 0; | ||
70 | #endif | ||
71 | |||
72 | module_param(nowayout, int, 0); | 67 | module_param(nowayout, int, 0); |
73 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 68 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
74 | 69 | ||
diff --git a/drivers/char/watchdog/wdt.c b/drivers/char/watchdog/wdt.c index 1210ca0c425b..ec7e401228ee 100644 --- a/drivers/char/watchdog/wdt.c +++ b/drivers/char/watchdog/wdt.c | |||
@@ -63,12 +63,7 @@ static int wd_heartbeat; | |||
63 | module_param(heartbeat, int, 0); | 63 | module_param(heartbeat, int, 0); |
64 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")"); | 64 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")"); |
65 | 65 | ||
66 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 66 | static int nowayout = WATCHDOG_NOWAYOUT; |
67 | static int nowayout = 1; | ||
68 | #else | ||
69 | static int nowayout = 0; | ||
70 | #endif | ||
71 | |||
72 | module_param(nowayout, int, 0); | 67 | module_param(nowayout, int, 0); |
73 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 68 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
74 | 69 | ||
diff --git a/drivers/char/watchdog/wdt977.c b/drivers/char/watchdog/wdt977.c index 072e9b214759..44d49dfacbb3 100644 --- a/drivers/char/watchdog/wdt977.c +++ b/drivers/char/watchdog/wdt977.c | |||
@@ -53,12 +53,7 @@ MODULE_PARM_DESC(timeout,"Watchdog timeout in seconds (60..15300), default=" __M | |||
53 | module_param(testmode, int, 0); | 53 | module_param(testmode, int, 0); |
54 | MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0"); | 54 | MODULE_PARM_DESC(testmode,"Watchdog testmode (1 = no reboot), default=0"); |
55 | 55 | ||
56 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 56 | static int nowayout = WATCHDOG_NOWAYOUT; |
57 | static int nowayout = 1; | ||
58 | #else | ||
59 | static int nowayout = 0; | ||
60 | #endif | ||
61 | |||
62 | module_param(nowayout, int, 0); | 57 | module_param(nowayout, int, 0); |
63 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 58 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
64 | 59 | ||
diff --git a/drivers/char/watchdog/wdt_pci.c b/drivers/char/watchdog/wdt_pci.c index c80cb77b92fb..4b3311993d48 100644 --- a/drivers/char/watchdog/wdt_pci.c +++ b/drivers/char/watchdog/wdt_pci.c | |||
@@ -89,12 +89,7 @@ static int wd_heartbeat; | |||
89 | module_param(heartbeat, int, 0); | 89 | module_param(heartbeat, int, 0); |
90 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")"); | 90 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536, default=" __MODULE_STRING(WD_TIMO) ")"); |
91 | 91 | ||
92 | #ifdef CONFIG_WATCHDOG_NOWAYOUT | 92 | static int nowayout = WATCHDOG_NOWAYOUT; |
93 | static int nowayout = 1; | ||
94 | #else | ||
95 | static int nowayout = 0; | ||
96 | #endif | ||
97 | |||
98 | module_param(nowayout, int, 0); | 93 | module_param(nowayout, int, 0); |
99 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); | 94 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); |
100 | 95 | ||