return -EPERM;
state->flags = ((state->flags & ~ASYNC_USR_MASK) |
(new_serial.flags & ASYNC_USR_MASK));
+ info->flags = ((state->flags & ~ASYNC_USR_MASK) |
+ (info->flags & ASYNC_USR_MASK));
state->custom_divisor = new_serial.custom_divisor;
goto check_and_exit;
}
new_serial.irq = irq_cannonicalize(new_serial.irq);
if ((new_serial.irq >= NR_IRQS) || (new_serial.port > 0xffff) ||
- (new_serial.type < PORT_UNKNOWN) ||
- (new_serial.type > PORT_MAX)) {
+ (new_serial.baud_base == 0) || (new_serial.type < PORT_UNKNOWN) ||
+ (new_serial.type > PORT_MAX) || (new_serial.type == PORT_CIRRUS) ||
+ (new_serial.type == PORT_STARTECH)) {
return -EINVAL;
}
switch (parport_ieee1284_nibble_mode_ok(port, 4)) {
case 1:
current->state=TASK_INTERRUPTIBLE;
- current->timeout=jiffies+1;
- schedule(); /* HACK: wait 10ms because printer seems to
- * ack wrong */
+ schedule_timeout(1); /* HACK: wait 10ms because printer seems to
+ * ack wrong */
result = read_polled(port, buffer, len);
break;
case 0:
static void sleep(unsigned howlong)
{
- current->timeout = jiffies + 1;
current->state = TASK_INTERRUPTIBLE;
- schedule();
- current->timeout = 0;
+ schedule_timeout(1);
}
static unsigned char sscape_read(struct sscape_info *devc, int reg)
/*
* Wait for the new connection.
*/
- current->timeout = jiffies + 5*HZ;
- interruptible_sleep_on(&server->wait);
- current->timeout = 0;
+ interruptible_sleep_on_timeout(&server->wait, 5*HZ);
if (signal_pending(current))
printk("smb_retry: caught signal\n");
/* Windows 95 is not able to deliver answers
* to FIND_NEXT fast enough, so sleep 0.2 sec
*/
- current->timeout = jiffies + HZ / 5;
current->state = TASK_INTERRUPTIBLE;
- schedule();
- current->timeout = 0;
+ schedule_timeout(HZ/5);
}
}
* can "mix" irq-safe locks - any writer needs to get a
* irq-safe write-lock, but readers can get non-irqsafe
* read-locks.
+ *
+ * Gcc-2.7.x has a nasty bug with empty initializers.
*/
-typedef struct { } rwlock_t;
-#define RW_LOCK_UNLOCKED (rwlock_t) { }
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
+ typedef struct { } rwlock_t;
+ #define RW_LOCK_UNLOCKED (rwlock_t) { }
+#else
+ typedef struct { int gcc_is_buggy; } rwlock_t;
+ #define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
+#endif
#define read_lock(lock) do { } while(0)
#define read_unlock(lock) do { } while(0)
#include <linux/capability.h>
#include <linux/securebits.h>
-#define JIFFIES_OFFSET (-3600*HZ)
-
/*
* cloning flags:
*/
#define PORT_16450 2
#define PORT_16550 3
#define PORT_16550A 4
-#define PORT_CIRRUS 5
+#define PORT_CIRRUS 5 /* usurped by cyclades.c */
#define PORT_16650 6
#define PORT_16650V2 7
#define PORT_16750 8
-#define PORT_STARTECH 9
+#define PORT_STARTECH 9 /* usurped by cyclades.c */
#define PORT_MAX 9
struct serial_uart_config {
#define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */
-#define ASYNC_FLAGS 0x2FFF /* Possible legal async flags */
+#define ASYNC_FLAGS 0x3FFF /* Possible legal async flags */
#define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged
* users can set or reset */