1
0

patch-setserial_c 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. --- setserial-2.17.orig/setserial.c 2000-01-27 16:40:52.000000000 +0100
  2. +++ setserial-2.17/setserial.c 2010-03-12 17:34:40.961901844 +0100
  3. @@ -11,6 +11,7 @@
  4. */
  5. #include <stdio.h>
  6. +#include <stdlib.h>
  7. #include <fcntl.h>
  8. #include <termios.h>
  9. #include <string.h>
  10. @@ -19,9 +20,6 @@
  11. #ifdef HAVE_ASM_IOCTLS_H
  12. #include <asm/ioctls.h>
  13. #endif
  14. -#ifdef HAVE_LINUX_HAYESESP_H
  15. -#include <linux/hayesesp.h>
  16. -#endif
  17. #include <linux/serial.h>
  18. #include "version.h"
  19. @@ -118,14 +116,6 @@ struct flag_type_table {
  20. CMD_CONFIG, "autoconfigure",0, 0, 0, 0,
  21. CMD_GETMULTI, "get_multiport",0, 0, 0, 0,
  22. CMD_SETMULTI, "set_multiport",0, 0, 0, 0,
  23. -#ifdef TIOCGHAYESESP
  24. - CMD_RX_TRIG, "rx_trigger", 0, 0, 0, FLAG_NEED_ARG,
  25. - CMD_TX_TRIG, "tx_trigger", 0, 0, 0, FLAG_NEED_ARG,
  26. - CMD_FLOW_OFF, "flow_off", 0, 0, 0, FLAG_NEED_ARG,
  27. - CMD_FLOW_ON, "flow_on", 0, 0, 0, FLAG_NEED_ARG,
  28. - CMD_RX_TMOUT, "rx_timeout", 0, 0, 0, FLAG_NEED_ARG,
  29. - CMD_DMA_CHAN, "dma_channel", 0, 0, 0, FLAG_NEED_ARG,
  30. -#endif
  31. 0, 0, 0, 0, 0, 0,
  32. };
  33. @@ -356,62 +346,6 @@ void set_multiport(char *device, int fd,
  34. }
  35. #endif
  36. -#ifdef TIOCGHAYESESP
  37. -void print_hayesesp(int fd)
  38. -{
  39. - struct hayes_esp_config esp;
  40. -
  41. - if (ioctl(fd, TIOCGHAYESESP, &esp) < 0)
  42. - return;
  43. -
  44. - printf("\tHayes ESP enhanced mode configuration:\n");
  45. - printf("\t\tRX trigger level: %d, TX trigger level: %d\n",
  46. - (int)esp.rx_trigger, (int)esp.tx_trigger);
  47. - printf("\t\tFlow off level: %d, Flow on level: %d\n",
  48. - (int)esp.flow_off, (int)esp.flow_on);
  49. - printf("\t\tRX timeout: %u, DMA channel: %d\n\n",
  50. - (unsigned int)esp.rx_timeout, (int)esp.dma_channel);
  51. -}
  52. -
  53. -void set_hayesesp(int fd, int cmd, int arg)
  54. -{
  55. - struct hayes_esp_config esp;
  56. -
  57. - if (ioctl(fd, TIOCGHAYESESP, &esp) < 0) {
  58. - printf("\nError: rx_trigger, tx_trigger, flow_off, "
  59. - "flow_on, rx_timeout, and dma_channel\n"
  60. - "are only valid for Hayes ESP ports.\n\n");
  61. - exit(1);
  62. - }
  63. -
  64. - switch (cmd) {
  65. - case CMD_RX_TRIG:
  66. - esp.rx_trigger = arg;
  67. - break;
  68. - case CMD_TX_TRIG:
  69. - esp.tx_trigger = arg;
  70. - break;
  71. - case CMD_FLOW_OFF:
  72. - esp.flow_off = arg;
  73. - break;
  74. - case CMD_FLOW_ON:
  75. - esp.flow_on = arg;
  76. - break;
  77. - case CMD_RX_TMOUT:
  78. - esp.rx_timeout = arg;
  79. - break;
  80. - case CMD_DMA_CHAN:
  81. - esp.dma_channel = arg;
  82. - break;
  83. - }
  84. -
  85. - if (ioctl(fd, TIOCSHAYESESP, &esp) < 0) {
  86. - printf("Cannot set Hayes ESP info\n");
  87. - exit(1);
  88. - }
  89. -}
  90. -#endif
  91. -
  92. void get_serial(char *device)
  93. {
  94. struct serial_struct serinfo;
  95. @@ -453,9 +387,6 @@ void get_serial(char *device)
  96. print_flags(&serinfo, "\tFlags: ", "");
  97. printf("\n\n");
  98. -#ifdef TIOCGHAYESESP
  99. - print_hayesesp(fd);
  100. -#endif
  101. } else if (verbosity==0) {
  102. if (serinfo.type) {
  103. printf("%s at 0x%.4x (irq = %d) is a %s",
  104. @@ -593,16 +524,6 @@ void set_serial(char *device, char ** ar
  105. }
  106. set_multiport(device, fd, &arg);
  107. break;
  108. -#ifdef TIOCGHAYESESP
  109. - case CMD_RX_TRIG:
  110. - case CMD_TX_TRIG:
  111. - case CMD_FLOW_OFF:
  112. - case CMD_FLOW_ON:
  113. - case CMD_RX_TMOUT:
  114. - case CMD_DMA_CHAN:
  115. - set_hayesesp(fd, p->cmd, atonum(*arg++));
  116. - break;
  117. -#endif
  118. default:
  119. fprintf(stderr, "Internal error: unhandled cmd #%d\n", p->cmd);
  120. exit(1);
  121. @@ -692,14 +613,6 @@ fprintf(stderr, "\t* port\t\tset the I/O
  122. fprintf(stderr, "\t get_multiport\tDisplay the multiport configuration\n");
  123. fprintf(stderr, "\t set_multiport\tSet the multiport configuration\n");
  124. fprintf(stderr, "\n");
  125. -#ifdef TIOCGHAYESESP
  126. - fprintf(stderr, "\t* rx_trigger\tSet RX trigger level (ESP-only)\n");
  127. - fprintf(stderr, "\t* tx_trigger\tSet TX trigger level (ESP-only)\n");
  128. - fprintf(stderr, "\t* flow_off\tSet hardware flow off level (ESP-only)\n");
  129. - fprintf(stderr, "\t* flow_on\tSet hardware flow on level (ESP-only)\n");
  130. - fprintf(stderr, "\t* rx_timeout\tSet receive timeout (ESP-only)\n");
  131. - fprintf(stderr, "\t* dma_channel\tSet DMA channel (ESP-only)\n");
  132. -#endif
  133. fprintf(stderr, "\n");
  134. fprintf(stderr, "\t spd_hi\tuse 56kb instead of 38.4kb\n");
  135. fprintf(stderr, "\t spd_vhi\tuse 115kb instead of 38.4kb\n");