Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6

* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (26 commits)
amba pl011: workaround for uart registers lockup
n_gsm: fix the wrong FCS handling
pch_uart: add missing comment about OKI ML7223
pch_uart: Add MSI support
tty: fix "IRQ45: nobody cared"
PTI feature to allow user to name and mark masterchannel request.
0 for o PTI Makefile bug.
tty: serial: samsung.c remove legacy PM code.
SERIAL: SC26xx: Fix link error.
serial: mrst_max3110: initialize waitqueue earlier
mrst_max3110: Change max missing message priority.
tty: s5pv210: Add delay loop on fifo reset function for UART
tty/serial: Fix XSCALE serial ports, e.g. ce4100
serial: bfin_5xx: fix off-by-one with resource size
drivers/tty: use printk_ratelimited() instead of printk_ratelimit()
tty: n_gsm: Added refcount usage to gsm_mux and gsm_dlci structs
tty: n_gsm: Add raw-ip support
tty: n_gsm: expose gsmtty device nodes at ldisc open time
pch_phub: Fix register miss-setting issue
serial: 8250, increase PASS_LIMIT
...

+904 -188
+1 -1
drivers/misc/Makefile
··· 6 6 obj-$(CONFIG_AD525X_DPOT) += ad525x_dpot.o 7 7 obj-$(CONFIG_AD525X_DPOT_I2C) += ad525x_dpot-i2c.o 8 8 obj-$(CONFIG_AD525X_DPOT_SPI) += ad525x_dpot-spi.o 9 - 0bj-$(CONFIG_INTEL_MID_PTI) += pti.o 9 + obj-$(CONFIG_INTEL_MID_PTI) += pti.o 10 10 obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o 11 11 obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o 12 12 obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o
+2 -2
drivers/misc/pch_phub.c
··· 735 735 * Device8(GbE) 736 736 */ 737 737 iowrite32(0x000a0000, chip->pch_phub_base_address + 0x14); 738 + /* set the interrupt delay value */ 739 + iowrite32(0x25, chip->pch_phub_base_address + 0x140); 738 740 chip->pch_opt_rom_start_address =\ 739 741 PCH_PHUB_ROM_START_ADDR_ML7223; 740 742 chip->pch_mac_start_address = PCH_PHUB_MAC_START_ADDR_ML7223; ··· 754 752 * Device6(SATA 2):f 755 753 */ 756 754 iowrite32(0x0000ffa0, chip->pch_phub_base_address + 0x14); 757 - /* set the interrupt delay value */ 758 - iowrite32(0x25, chip->pch_phub_base_address + 0x140); 759 755 chip->pch_opt_rom_start_address =\ 760 756 PCH_PHUB_ROM_START_ADDR_ML7223; 761 757 chip->pch_mac_start_address = PCH_PHUB_MAC_START_ADDR_ML7223;
+60 -39
drivers/misc/pti.c
··· 146 146 /** 147 147 * pti_control_frame_built_and_sent()- control frame build and send function. 148 148 * 149 - * @mc: The master / channel structure on which the function 150 - * built a control frame. 149 + * @mc: The master / channel structure on which the function 150 + * built a control frame. 151 + * @thread_name: The thread name associated with the master / channel or 152 + * 'NULL' if using the 'current' global variable. 151 153 * 152 154 * To be able to post process the PTI contents on host side, a control frame 153 155 * is added before sending any PTI content. So the host side knows on 154 156 * each PTI frame the name of the thread using a dedicated master / channel. 155 - * The thread name is retrieved from the 'current' global variable. 157 + * The thread name is retrieved from 'current' global variable if 'thread_name' 158 + * is 'NULL', else it is retrieved from 'thread_name' parameter. 156 159 * This function builds this frame and sends it to a master ID CONTROL_ID. 157 160 * The overhead is only 32 bytes since the driver only writes to HW 158 161 * in 32 byte chunks. 159 162 */ 160 - 161 - static void pti_control_frame_built_and_sent(struct pti_masterchannel *mc) 163 + static void pti_control_frame_built_and_sent(struct pti_masterchannel *mc, 164 + const char *thread_name) 162 165 { 163 166 struct pti_masterchannel mccontrol = {.master = CONTROL_ID, 164 167 .channel = 0}; 168 + const char *thread_name_p; 165 169 const char *control_format = "%3d %3d %s"; 166 170 u8 control_frame[CONTROL_FRAME_LEN]; 167 171 168 - /* 169 - * Since we access the comm member in current's task_struct, 170 - * we only need to be as large as what 'comm' in that 171 - * structure is. 172 - */ 173 - char comm[TASK_COMM_LEN]; 172 + if (!thread_name) { 173 + /* 174 + * Since we access the comm member in current's task_struct, 175 + * we only need to be as large as what 'comm' in that 176 + * structure is. 177 + */ 178 + char comm[TASK_COMM_LEN]; 174 179 175 - if (!in_interrupt()) 176 - get_task_comm(comm, current); 177 - else 178 - strncpy(comm, "Interrupt", TASK_COMM_LEN); 180 + if (!in_interrupt()) 181 + get_task_comm(comm, current); 182 + else 183 + strncpy(comm, "Interrupt", TASK_COMM_LEN); 179 184 180 - /* Absolutely ensure our buffer is zero terminated. */ 181 - comm[TASK_COMM_LEN-1] = 0; 185 + /* Absolutely ensure our buffer is zero terminated. */ 186 + comm[TASK_COMM_LEN-1] = 0; 187 + thread_name_p = comm; 188 + } else { 189 + thread_name_p = thread_name; 190 + } 182 191 183 192 mccontrol.channel = pti_control_channel; 184 193 pti_control_channel = (pti_control_channel + 1) & 0x7f; 185 194 186 195 snprintf(control_frame, CONTROL_FRAME_LEN, control_format, mc->master, 187 - mc->channel, comm); 196 + mc->channel, thread_name_p); 188 197 pti_write_to_aperture(&mccontrol, control_frame, strlen(control_frame)); 189 198 } 190 199 ··· 215 206 const unsigned char *buf, 216 207 int len) 217 208 { 218 - pti_control_frame_built_and_sent(mc); 209 + pti_control_frame_built_and_sent(mc, NULL); 219 210 pti_write_to_aperture(mc, (u8 *)buf, len); 220 211 } 221 212 222 213 /** 223 214 * get_id()- Allocate a master and channel ID. 224 215 * 225 - * @id_array: an array of bits representing what channel 226 - * id's are allocated for writing. 227 - * @max_ids: The max amount of available write IDs to use. 228 - * @base_id: The starting SW channel ID, based on the Intel 229 - * PTI arch. 216 + * @id_array: an array of bits representing what channel 217 + * id's are allocated for writing. 218 + * @max_ids: The max amount of available write IDs to use. 219 + * @base_id: The starting SW channel ID, based on the Intel 220 + * PTI arch. 221 + * @thread_name: The thread name associated with the master / channel or 222 + * 'NULL' if using the 'current' global variable. 230 223 * 231 224 * Returns: 232 225 * pti_masterchannel struct with master, channel ID address ··· 238 227 * channel id. The bit is one if the id is taken and 0 if free. For 239 228 * every master there are 128 channel id's. 240 229 */ 241 - static struct pti_masterchannel *get_id(u8 *id_array, int max_ids, int base_id) 230 + static struct pti_masterchannel *get_id(u8 *id_array, 231 + int max_ids, 232 + int base_id, 233 + const char *thread_name) 242 234 { 243 235 struct pti_masterchannel *mc; 244 236 int i, j, mask; ··· 271 257 mc->master = base_id; 272 258 mc->channel = ((i & 0xf)<<3) + j; 273 259 /* write new master Id / channel Id allocation to channel control */ 274 - pti_control_frame_built_and_sent(mc); 260 + pti_control_frame_built_and_sent(mc, thread_name); 275 261 return mc; 276 262 } 277 263 ··· 287 273 * a master, channel ID address 288 274 * to write to PTI HW. 289 275 * 290 - * @type: 0- request Application master, channel aperture ID write address. 291 - * 1- request OS master, channel aperture ID write 292 - * address. 293 - * 2- request Modem master, channel aperture ID 294 - * write address. 295 - * Other values, error. 276 + * @type: 0- request Application master, channel aperture ID 277 + * write address. 278 + * 1- request OS master, channel aperture ID write 279 + * address. 280 + * 2- request Modem master, channel aperture ID 281 + * write address. 282 + * Other values, error. 283 + * @thread_name: The thread name associated with the master / channel or 284 + * 'NULL' if using the 'current' global variable. 296 285 * 297 286 * Returns: 298 287 * pti_masterchannel struct 299 288 * 0 for error 300 289 */ 301 - struct pti_masterchannel *pti_request_masterchannel(u8 type) 290 + struct pti_masterchannel *pti_request_masterchannel(u8 type, 291 + const char *thread_name) 302 292 { 303 293 struct pti_masterchannel *mc; 304 294 ··· 311 293 switch (type) { 312 294 313 295 case 0: 314 - mc = get_id(drv_data->ia_app, MAX_APP_IDS, APP_BASE_ID); 296 + mc = get_id(drv_data->ia_app, MAX_APP_IDS, 297 + APP_BASE_ID, thread_name); 315 298 break; 316 299 317 300 case 1: 318 - mc = get_id(drv_data->ia_os, MAX_OS_IDS, OS_BASE_ID); 301 + mc = get_id(drv_data->ia_os, MAX_OS_IDS, 302 + OS_BASE_ID, thread_name); 319 303 break; 320 304 321 305 case 2: 322 - mc = get_id(drv_data->ia_modem, MAX_MODEM_IDS, MODEM_BASE_ID); 306 + mc = get_id(drv_data->ia_modem, MAX_MODEM_IDS, 307 + MODEM_BASE_ID, thread_name); 323 308 break; 324 309 default: 325 310 mc = NULL; ··· 493 472 return -ENOMEM; 494 473 495 474 if (idx == PTITTY_MINOR_START) 496 - pti_tty_data->mc = pti_request_masterchannel(0); 475 + pti_tty_data->mc = pti_request_masterchannel(0, NULL); 497 476 else 498 - pti_tty_data->mc = pti_request_masterchannel(2); 477 + pti_tty_data->mc = pti_request_masterchannel(2, NULL); 499 478 500 479 if (pti_tty_data->mc == NULL) { 501 480 kfree(pti_tty_data); ··· 584 563 * before assigning the value to filp->private_data. 585 564 * Slightly easier to debug if this driver needs debugging. 586 565 */ 587 - mc = pti_request_masterchannel(0); 566 + mc = pti_request_masterchannel(0, NULL); 588 567 if (mc == NULL) 589 568 return -ENOMEM; 590 569 filp->private_data = mc;
-54
drivers/parport/parport_pc.c
··· 2864 2864 lava_parallel_dual_b, 2865 2865 boca_ioppar, 2866 2866 plx_9050, 2867 - timedia_4078a, 2868 - timedia_4079h, 2869 - timedia_4085h, 2870 - timedia_4088a, 2871 - timedia_4089a, 2872 - timedia_4095a, 2873 - timedia_4096a, 2874 - timedia_4078u, 2875 - timedia_4079a, 2876 - timedia_4085u, 2877 - timedia_4079r, 2878 - timedia_4079s, 2879 - timedia_4079d, 2880 - timedia_4079e, 2881 - timedia_4079f, 2882 - timedia_9079a, 2883 - timedia_9079b, 2884 - timedia_9079c, 2885 2867 timedia_4006a, 2886 2868 timedia_4014, 2887 2869 timedia_4008a, ··· 2922 2940 /* lava_parallel_dual_b */ { 1, { { 0, -1 }, } }, 2923 2941 /* boca_ioppar */ { 1, { { 0, -1 }, } }, 2924 2942 /* plx_9050 */ { 2, { { 4, -1 }, { 5, -1 }, } }, 2925 - /* timedia_4078a */ { 1, { { 2, -1 }, } }, 2926 - /* timedia_4079h */ { 1, { { 2, 3 }, } }, 2927 - /* timedia_4085h */ { 2, { { 2, -1 }, { 4, -1 }, } }, 2928 - /* timedia_4088a */ { 2, { { 2, 3 }, { 4, 5 }, } }, 2929 - /* timedia_4089a */ { 2, { { 2, 3 }, { 4, 5 }, } }, 2930 - /* timedia_4095a */ { 2, { { 2, 3 }, { 4, 5 }, } }, 2931 - /* timedia_4096a */ { 2, { { 2, 3 }, { 4, 5 }, } }, 2932 - /* timedia_4078u */ { 1, { { 2, -1 }, } }, 2933 - /* timedia_4079a */ { 1, { { 2, 3 }, } }, 2934 - /* timedia_4085u */ { 2, { { 2, -1 }, { 4, -1 }, } }, 2935 - /* timedia_4079r */ { 1, { { 2, 3 }, } }, 2936 - /* timedia_4079s */ { 1, { { 2, 3 }, } }, 2937 - /* timedia_4079d */ { 1, { { 2, 3 }, } }, 2938 - /* timedia_4079e */ { 1, { { 2, 3 }, } }, 2939 - /* timedia_4079f */ { 1, { { 2, 3 }, } }, 2940 - /* timedia_9079a */ { 1, { { 2, 3 }, } }, 2941 - /* timedia_9079b */ { 1, { { 2, 3 }, } }, 2942 - /* timedia_9079c */ { 1, { { 2, 3 }, } }, 2943 2943 /* timedia_4006a */ { 1, { { 0, -1 }, } }, 2944 2944 /* timedia_4014 */ { 2, { { 0, -1 }, { 2, -1 }, } }, 2945 2945 /* timedia_4008a */ { 1, { { 0, 1 }, } }, ··· 2983 3019 { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, 2984 3020 PCI_SUBVENDOR_ID_EXSYS, PCI_SUBDEVICE_ID_EXSYS_4014, 0, 0, plx_9050 }, 2985 3021 /* PCI_VENDOR_ID_TIMEDIA/SUNIX has many differing cards ...*/ 2986 - { 0x1409, 0x7168, 0x1409, 0x4078, 0, 0, timedia_4078a }, 2987 - { 0x1409, 0x7168, 0x1409, 0x4079, 0, 0, timedia_4079h }, 2988 - { 0x1409, 0x7168, 0x1409, 0x4085, 0, 0, timedia_4085h }, 2989 - { 0x1409, 0x7168, 0x1409, 0x4088, 0, 0, timedia_4088a }, 2990 - { 0x1409, 0x7168, 0x1409, 0x4089, 0, 0, timedia_4089a }, 2991 - { 0x1409, 0x7168, 0x1409, 0x4095, 0, 0, timedia_4095a }, 2992 - { 0x1409, 0x7168, 0x1409, 0x4096, 0, 0, timedia_4096a }, 2993 - { 0x1409, 0x7168, 0x1409, 0x5078, 0, 0, timedia_4078u }, 2994 - { 0x1409, 0x7168, 0x1409, 0x5079, 0, 0, timedia_4079a }, 2995 - { 0x1409, 0x7168, 0x1409, 0x5085, 0, 0, timedia_4085u }, 2996 - { 0x1409, 0x7168, 0x1409, 0x6079, 0, 0, timedia_4079r }, 2997 - { 0x1409, 0x7168, 0x1409, 0x7079, 0, 0, timedia_4079s }, 2998 - { 0x1409, 0x7168, 0x1409, 0x8079, 0, 0, timedia_4079d }, 2999 - { 0x1409, 0x7168, 0x1409, 0x9079, 0, 0, timedia_4079e }, 3000 - { 0x1409, 0x7168, 0x1409, 0xa079, 0, 0, timedia_4079f }, 3001 - { 0x1409, 0x7168, 0x1409, 0xb079, 0, 0, timedia_9079a }, 3002 - { 0x1409, 0x7168, 0x1409, 0xc079, 0, 0, timedia_9079b }, 3003 - { 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c }, 3004 3022 { 0x1409, 0x7268, 0x1409, 0x0101, 0, 0, timedia_4006a }, 3005 3023 { 0x1409, 0x7268, 0x1409, 0x0102, 0, 0, timedia_4014 }, 3006 3024 { 0x1409, 0x7268, 0x1409, 0x0103, 0, 0, timedia_4008a },
+213 -16
drivers/parport/parport_serial.c
··· 33 33 netmos_9xx5_combo, 34 34 netmos_9855, 35 35 netmos_9855_2p, 36 + netmos_9900, 37 + netmos_9900_2p, 38 + netmos_99xx_1p, 36 39 avlab_1s1p, 37 40 avlab_1s2p, 38 41 avlab_2s1p, ··· 44 41 siig_2p1s_20x, 45 42 siig_1s1p_20x, 46 43 siig_2s1p_20x, 44 + timedia_4078a, 45 + timedia_4079h, 46 + timedia_4085h, 47 + timedia_4088a, 48 + timedia_4089a, 49 + timedia_4095a, 50 + timedia_4096a, 51 + timedia_4078u, 52 + timedia_4079a, 53 + timedia_4085u, 54 + timedia_4079r, 55 + timedia_4079s, 56 + timedia_4079d, 57 + timedia_4079e, 58 + timedia_4079f, 59 + timedia_9079a, 60 + timedia_9079b, 61 + timedia_9079c, 47 62 }; 48 63 49 64 /* each element directly indexed from enum list, above */ ··· 93 72 dev->subsystem_vendor == PCI_VENDOR_ID_IBM && 94 73 dev->subsystem_device == 0x0299) 95 74 return -ENODEV; 96 - /* 97 - * Netmos uses the subdevice ID to indicate the number of parallel 98 - * and serial ports. The form is 0x00PS, where <P> is the number of 99 - * parallel ports and <S> is the number of serial ports. 100 - */ 101 - par->numports = (dev->subsystem_device & 0xf0) >> 4; 102 - if (par->numports > ARRAY_SIZE(par->addr)) 103 - par->numports = ARRAY_SIZE(par->addr); 104 - /* 105 - * This function is currently only called for cards with up to 106 - * one parallel port. 107 - * Parallel port BAR is either before or after serial ports BARS; 108 - * hence, lo should be either 0 or equal to the number of serial ports. 109 - */ 110 - if (par->addr[0].lo != 0) 111 - par->addr[0].lo = dev->subsystem_device & 0xf; 75 + 76 + if (dev->device == PCI_DEVICE_ID_NETMOS_9912) { 77 + par->numports = 1; 78 + } else { 79 + /* 80 + * Netmos uses the subdevice ID to indicate the number of parallel 81 + * and serial ports. The form is 0x00PS, where <P> is the number of 82 + * parallel ports and <S> is the number of serial ports. 83 + */ 84 + par->numports = (dev->subsystem_device & 0xf0) >> 4; 85 + if (par->numports > ARRAY_SIZE(par->addr)) 86 + par->numports = ARRAY_SIZE(par->addr); 87 + } 88 + 112 89 return 0; 113 90 } 114 91 ··· 116 97 /* netmos_9xx5_combo */ { 1, { { 2, -1 }, }, netmos_parallel_init }, 117 98 /* netmos_9855 */ { 1, { { 0, -1 }, }, netmos_parallel_init }, 118 99 /* netmos_9855_2p */ { 2, { { 0, -1 }, { 2, -1 }, } }, 100 + /* netmos_9900 */ {1, { { 3, 4 }, }, netmos_parallel_init }, 101 + /* netmos_9900_2p */ {2, { { 0, 1 }, { 3, 4 }, } }, 102 + /* netmos_99xx_1p */ {1, { { 0, 1 }, } }, 119 103 /* avlab_1s1p */ { 1, { { 1, 2}, } }, 120 104 /* avlab_1s2p */ { 2, { { 1, 2}, { 3, 4 },} }, 121 105 /* avlab_2s1p */ { 1, { { 2, 3}, } }, ··· 127 105 /* siig_2p1s_20x */ { 2, { { 1, 2 }, { 3, 4 }, } }, 128 106 /* siig_1s1p_20x */ { 1, { { 1, 2 }, } }, 129 107 /* siig_2s1p_20x */ { 1, { { 2, 3 }, } }, 108 + /* timedia_4078a */ { 1, { { 2, -1 }, } }, 109 + /* timedia_4079h */ { 1, { { 2, 3 }, } }, 110 + /* timedia_4085h */ { 2, { { 2, -1 }, { 4, -1 }, } }, 111 + /* timedia_4088a */ { 2, { { 2, 3 }, { 4, 5 }, } }, 112 + /* timedia_4089a */ { 2, { { 2, 3 }, { 4, 5 }, } }, 113 + /* timedia_4095a */ { 2, { { 2, 3 }, { 4, 5 }, } }, 114 + /* timedia_4096a */ { 2, { { 2, 3 }, { 4, 5 }, } }, 115 + /* timedia_4078u */ { 1, { { 2, -1 }, } }, 116 + /* timedia_4079a */ { 1, { { 2, 3 }, } }, 117 + /* timedia_4085u */ { 2, { { 2, -1 }, { 4, -1 }, } }, 118 + /* timedia_4079r */ { 1, { { 2, 3 }, } }, 119 + /* timedia_4079s */ { 1, { { 2, 3 }, } }, 120 + /* timedia_4079d */ { 1, { { 2, 3 }, } }, 121 + /* timedia_4079e */ { 1, { { 2, 3 }, } }, 122 + /* timedia_4079f */ { 1, { { 2, 3 }, } }, 123 + /* timedia_9079a */ { 1, { { 2, 3 }, } }, 124 + /* timedia_9079b */ { 1, { { 2, 3 }, } }, 125 + /* timedia_9079c */ { 1, { { 2, 3 }, } }, 130 126 }; 131 127 132 128 static struct pci_device_id parport_serial_pci_tbl[] = { ··· 167 127 0x1000, 0x0022, 0, 0, netmos_9855_2p }, 168 128 { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855, 169 129 PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 }, 130 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900, 131 + 0xA000, 0x3011, 0, 0, netmos_9900 }, 132 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900, 133 + 0xA000, 0x3012, 0, 0, netmos_9900 }, 134 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900, 135 + 0xA000, 0x3020, 0, 0, netmos_9900_2p }, 136 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912, 137 + 0xA000, 0x2000, 0, 0, netmos_99xx_1p }, 170 138 /* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/ 171 139 { PCI_VENDOR_ID_AFAVLAB, 0x2110, 172 140 PCI_ANY_ID, PCI_ANY_ID, 0, 0, avlab_1s1p }, ··· 224 176 PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x }, 225 177 { PCI_VENDOR_ID_SIIG, PCI_DEVICE_ID_SIIG_2S1P_20x_850, 226 178 PCI_ANY_ID, PCI_ANY_ID, 0, 0, siig_2s1p_20x }, 179 + /* PCI_VENDOR_ID_TIMEDIA/SUNIX has many differing cards ...*/ 180 + { 0x1409, 0x7168, 0x1409, 0x4078, 0, 0, timedia_4078a }, 181 + { 0x1409, 0x7168, 0x1409, 0x4079, 0, 0, timedia_4079h }, 182 + { 0x1409, 0x7168, 0x1409, 0x4085, 0, 0, timedia_4085h }, 183 + { 0x1409, 0x7168, 0x1409, 0x4088, 0, 0, timedia_4088a }, 184 + { 0x1409, 0x7168, 0x1409, 0x4089, 0, 0, timedia_4089a }, 185 + { 0x1409, 0x7168, 0x1409, 0x4095, 0, 0, timedia_4095a }, 186 + { 0x1409, 0x7168, 0x1409, 0x4096, 0, 0, timedia_4096a }, 187 + { 0x1409, 0x7168, 0x1409, 0x5078, 0, 0, timedia_4078u }, 188 + { 0x1409, 0x7168, 0x1409, 0x5079, 0, 0, timedia_4079a }, 189 + { 0x1409, 0x7168, 0x1409, 0x5085, 0, 0, timedia_4085u }, 190 + { 0x1409, 0x7168, 0x1409, 0x6079, 0, 0, timedia_4079r }, 191 + { 0x1409, 0x7168, 0x1409, 0x7079, 0, 0, timedia_4079s }, 192 + { 0x1409, 0x7168, 0x1409, 0x8079, 0, 0, timedia_4079d }, 193 + { 0x1409, 0x7168, 0x1409, 0x9079, 0, 0, timedia_4079e }, 194 + { 0x1409, 0x7168, 0x1409, 0xa079, 0, 0, timedia_4079f }, 195 + { 0x1409, 0x7168, 0x1409, 0xb079, 0, 0, timedia_9079a }, 196 + { 0x1409, 0x7168, 0x1409, 0xc079, 0, 0, timedia_9079b }, 197 + { 0x1409, 0x7168, 0x1409, 0xd079, 0, 0, timedia_9079c }, 227 198 228 199 { 0, } /* terminate list */ 229 200 }; ··· 283 216 [netmos_9855_2p] = { 284 217 .flags = FL_BASE4 | FL_BASE_BARS, 285 218 .num_ports = 1, 219 + .base_baud = 115200, 220 + .uart_offset = 8, 221 + }, 222 + [netmos_9900] = { /* n/t */ 223 + .flags = FL_BASE0 | FL_BASE_BARS, 224 + .num_ports = 1, 225 + .base_baud = 115200, 226 + .uart_offset = 8, 227 + }, 228 + [netmos_9900_2p] = { /* parallel only */ /* n/t */ 229 + .flags = FL_BASE0, 230 + .num_ports = 0, 231 + .base_baud = 115200, 232 + .uart_offset = 8, 233 + }, 234 + [netmos_99xx_1p] = { /* parallel only */ /* n/t */ 235 + .flags = FL_BASE0, 236 + .num_ports = 0, 286 237 .base_baud = 115200, 287 238 .uart_offset = 8, 288 239 }, ··· 352 267 .base_baud = 921600, 353 268 .uart_offset = 8, 354 269 }, 270 + [timedia_4078a] = { 271 + .flags = FL_BASE0|FL_BASE_BARS, 272 + .num_ports = 1, 273 + .base_baud = 921600, 274 + .uart_offset = 8, 275 + }, 276 + [timedia_4079h] = { 277 + .flags = FL_BASE0|FL_BASE_BARS, 278 + .num_ports = 1, 279 + .base_baud = 921600, 280 + .uart_offset = 8, 281 + }, 282 + [timedia_4085h] = { 283 + .flags = FL_BASE0|FL_BASE_BARS, 284 + .num_ports = 1, 285 + .base_baud = 921600, 286 + .uart_offset = 8, 287 + }, 288 + [timedia_4088a] = { 289 + .flags = FL_BASE0|FL_BASE_BARS, 290 + .num_ports = 1, 291 + .base_baud = 921600, 292 + .uart_offset = 8, 293 + }, 294 + [timedia_4089a] = { 295 + .flags = FL_BASE0|FL_BASE_BARS, 296 + .num_ports = 1, 297 + .base_baud = 921600, 298 + .uart_offset = 8, 299 + }, 300 + [timedia_4095a] = { 301 + .flags = FL_BASE0|FL_BASE_BARS, 302 + .num_ports = 1, 303 + .base_baud = 921600, 304 + .uart_offset = 8, 305 + }, 306 + [timedia_4096a] = { 307 + .flags = FL_BASE0|FL_BASE_BARS, 308 + .num_ports = 1, 309 + .base_baud = 921600, 310 + .uart_offset = 8, 311 + }, 312 + [timedia_4078u] = { 313 + .flags = FL_BASE0|FL_BASE_BARS, 314 + .num_ports = 1, 315 + .base_baud = 921600, 316 + .uart_offset = 8, 317 + }, 318 + [timedia_4079a] = { 319 + .flags = FL_BASE0|FL_BASE_BARS, 320 + .num_ports = 1, 321 + .base_baud = 921600, 322 + .uart_offset = 8, 323 + }, 324 + [timedia_4085u] = { 325 + .flags = FL_BASE0|FL_BASE_BARS, 326 + .num_ports = 1, 327 + .base_baud = 921600, 328 + .uart_offset = 8, 329 + }, 330 + [timedia_4079r] = { 331 + .flags = FL_BASE0|FL_BASE_BARS, 332 + .num_ports = 1, 333 + .base_baud = 921600, 334 + .uart_offset = 8, 335 + }, 336 + [timedia_4079s] = { 337 + .flags = FL_BASE0|FL_BASE_BARS, 338 + .num_ports = 1, 339 + .base_baud = 921600, 340 + .uart_offset = 8, 341 + }, 342 + [timedia_4079d] = { 343 + .flags = FL_BASE0|FL_BASE_BARS, 344 + .num_ports = 1, 345 + .base_baud = 921600, 346 + .uart_offset = 8, 347 + }, 348 + [timedia_4079e] = { 349 + .flags = FL_BASE0|FL_BASE_BARS, 350 + .num_ports = 1, 351 + .base_baud = 921600, 352 + .uart_offset = 8, 353 + }, 354 + [timedia_4079f] = { 355 + .flags = FL_BASE0|FL_BASE_BARS, 356 + .num_ports = 1, 357 + .base_baud = 921600, 358 + .uart_offset = 8, 359 + }, 360 + [timedia_9079a] = { 361 + .flags = FL_BASE0|FL_BASE_BARS, 362 + .num_ports = 1, 363 + .base_baud = 921600, 364 + .uart_offset = 8, 365 + }, 366 + [timedia_9079b] = { 367 + .flags = FL_BASE0|FL_BASE_BARS, 368 + .num_ports = 1, 369 + .base_baud = 921600, 370 + .uart_offset = 8, 371 + }, 372 + [timedia_9079c] = { 373 + .flags = FL_BASE0|FL_BASE_BARS, 374 + .num_ports = 1, 375 + .base_baud = 921600, 376 + .uart_offset = 8, 377 + }, 355 378 }; 356 379 357 380 struct parport_serial_private { ··· 478 285 struct serial_private *serial; 479 286 480 287 board = &pci_parport_serial_boards[id->driver_data]; 288 + 289 + if (board->num_ports == 0) 290 + return 0; 291 + 481 292 serial = pciserial_init_ports(dev, board); 482 293 483 294 if (IS_ERR(serial))
+3 -2
drivers/tty/moxa.c
··· 44 44 #include <linux/init.h> 45 45 #include <linux/bitops.h> 46 46 #include <linux/slab.h> 47 + #include <linux/ratelimit.h> 47 48 48 49 #include <asm/system.h> 49 50 #include <asm/io.h> ··· 243 242 while (readw(ofsAddr + FuncCode) != 0) 244 243 if (time_after(jiffies, end)) 245 244 return; 246 - if (readw(ofsAddr + FuncCode) != 0 && printk_ratelimit()) 247 - printk(KERN_WARNING "moxa function expired\n"); 245 + if (readw(ofsAddr + FuncCode) != 0) 246 + printk_ratelimited(KERN_WARNING "moxa function expired\n"); 248 247 } 249 248 250 249 static void moxafunc(void __iomem *ofsAddr, u16 cmd, u16 arg)
+2 -2
drivers/tty/mxser.c
··· 39 39 #include <linux/pci.h> 40 40 #include <linux/bitops.h> 41 41 #include <linux/slab.h> 42 + #include <linux/ratelimit.h> 42 43 43 44 #include <asm/system.h> 44 45 #include <asm/io.h> ··· 1491 1490 1492 1491 switch (cmd) { 1493 1492 case MOXA_GET_MAJOR: 1494 - if (printk_ratelimit()) 1495 - printk(KERN_WARNING "mxser: '%s' uses deprecated ioctl " 1493 + printk_ratelimited(KERN_WARNING "mxser: '%s' uses deprecated ioctl " 1496 1494 "%x (GET_MAJOR), fix your userspace\n", 1497 1495 current->comm, cmd); 1498 1496 return put_user(ttymajor, (int __user *)argp);
+373 -30
drivers/tty/n_gsm.c
··· 58 58 #include <linux/serial.h> 59 59 #include <linux/kfifo.h> 60 60 #include <linux/skbuff.h> 61 + #include <net/arp.h> 62 + #include <linux/ip.h> 63 + #include <linux/netdevice.h> 64 + #include <linux/etherdevice.h> 61 65 #include <linux/gsmmux.h> 62 66 63 67 static int debug; ··· 81 77 * Semi-arbitrary buffer size limits. 0710 is normally run with 32-64 byte 82 78 * limits so this is plenty 83 79 */ 84 - #define MAX_MRU 512 85 - #define MAX_MTU 512 80 + #define MAX_MRU 1500 81 + #define MAX_MTU 1500 82 + #define GSM_NET_TX_TIMEOUT (HZ*10) 83 + 84 + /** 85 + * struct gsm_mux_net - network interface 86 + * @struct gsm_dlci* dlci 87 + * @struct net_device_stats stats; 88 + * 89 + * Created when net interface is initialized. 90 + **/ 91 + struct gsm_mux_net { 92 + struct kref ref; 93 + struct gsm_dlci *dlci; 94 + struct net_device_stats stats; 95 + }; 96 + 97 + #define STATS(net) (((struct gsm_mux_net *)netdev_priv(net))->stats) 86 98 87 99 /* 88 100 * Each block of data we have queued to go out is in the form of ··· 133 113 #define DLCI_OPENING 1 /* Sending SABM not seen UA */ 134 114 #define DLCI_OPEN 2 /* SABM/UA complete */ 135 115 #define DLCI_CLOSING 3 /* Sending DISC not seen UA/DM */ 116 + struct kref ref; /* freed from port or mux close */ 117 + struct mutex mutex; 136 118 137 119 /* Link layer */ 138 120 spinlock_t lock; /* Protects the internal state */ ··· 145 123 struct kfifo *fifo; /* Queue fifo for the DLCI */ 146 124 struct kfifo _fifo; /* For new fifo API porting only */ 147 125 int adaption; /* Adaption layer in use */ 126 + int prev_adaption; 148 127 u32 modem_rx; /* Our incoming virtual modem lines */ 149 128 u32 modem_tx; /* Our outgoing modem lines */ 150 129 int dead; /* Refuse re-open */ ··· 157 134 struct sk_buff_head skb_list; /* Queued frames */ 158 135 /* Data handling callback */ 159 136 void (*data)(struct gsm_dlci *dlci, u8 *data, int len); 137 + void (*prev_data)(struct gsm_dlci *dlci, u8 *data, int len); 138 + struct net_device *net; /* network interface, if created */ 160 139 }; 161 140 162 141 /* DLCI 0, 62/63 are special or reseved see gsmtty_open */ ··· 194 169 struct gsm_mux { 195 170 struct tty_struct *tty; /* The tty our ldisc is bound to */ 196 171 spinlock_t lock; 172 + unsigned int num; 173 + struct kref ref; 197 174 198 175 /* Events on the GSM channel */ 199 176 wait_queue_head_t event; ··· 276 249 #define MAX_MUX 4 /* 256 minors */ 277 250 static struct gsm_mux *gsm_mux[MAX_MUX]; /* GSM muxes */ 278 251 static spinlock_t gsm_mux_lock; 252 + 253 + static struct tty_driver *gsm_tty_driver; 279 254 280 255 /* 281 256 * This section of the driver logic implements the GSM encodings ··· 907 878 memcpy(dp, dlci->skb->data, len); 908 879 skb_pull(dlci->skb, len); 909 880 __gsm_data_queue(dlci, msg); 910 - if (last) 881 + if (last) { 882 + kfree_skb(dlci->skb); 911 883 dlci->skb = NULL; 884 + } 912 885 return size; 913 886 } 914 887 ··· 943 912 i++; 944 913 continue; 945 914 } 946 - if (dlci->adaption < 3) 915 + if (dlci->adaption < 3 && !dlci->net) 947 916 len = gsm_dlci_data_output(gsm, dlci); 948 917 else 949 918 len = gsm_dlci_data_output_framed(gsm, dlci); ··· 970 939 971 940 spin_lock_irqsave(&dlci->gsm->tx_lock, flags); 972 941 /* If we have nothing running then we need to fire up */ 973 - if (dlci->gsm->tx_bytes == 0) 974 - gsm_dlci_data_output(dlci->gsm, dlci); 975 - else if (dlci->gsm->tx_bytes < TX_THRESH_LO) 942 + if (dlci->gsm->tx_bytes == 0) { 943 + if (dlci->net) 944 + gsm_dlci_data_output_framed(dlci->gsm, dlci); 945 + else 946 + gsm_dlci_data_output(dlci->gsm, dlci); 947 + } else if (dlci->gsm->tx_bytes < TX_THRESH_LO) 976 948 gsm_dlci_data_sweep(dlci->gsm); 977 949 spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags); 978 950 } ··· 1622 1588 if (dlci == NULL) 1623 1589 return NULL; 1624 1590 spin_lock_init(&dlci->lock); 1591 + kref_init(&dlci->ref); 1592 + mutex_init(&dlci->mutex); 1625 1593 dlci->fifo = &dlci->_fifo; 1626 1594 if (kfifo_alloc(&dlci->_fifo, 4096, GFP_KERNEL) < 0) { 1627 1595 kfree(dlci); ··· 1649 1613 } 1650 1614 1651 1615 /** 1652 - * gsm_dlci_free - release DLCI 1653 - * @dlci: DLCI to destroy 1616 + * gsm_dlci_free - free DLCI 1617 + * @dlci: DLCI to free 1654 1618 * 1655 - * Free up a DLCI. Currently to keep the lifetime rules sane we only 1656 - * clean up DLCI objects when the MUX closes rather than as the port 1657 - * is closed down on both the tty and mux levels. 1619 + * Free up a DLCI. 1658 1620 * 1659 1621 * Can sleep. 1660 1622 */ 1661 - static void gsm_dlci_free(struct gsm_dlci *dlci) 1623 + static void gsm_dlci_free(struct kref *ref) 1624 + { 1625 + struct gsm_dlci *dlci = container_of(ref, struct gsm_dlci, ref); 1626 + 1627 + del_timer_sync(&dlci->t1); 1628 + dlci->gsm->dlci[dlci->addr] = NULL; 1629 + kfifo_free(dlci->fifo); 1630 + while ((dlci->skb = skb_dequeue(&dlci->skb_list))) 1631 + kfree_skb(dlci->skb); 1632 + kfree(dlci); 1633 + } 1634 + 1635 + static inline void dlci_get(struct gsm_dlci *dlci) 1636 + { 1637 + kref_get(&dlci->ref); 1638 + } 1639 + 1640 + static inline void dlci_put(struct gsm_dlci *dlci) 1641 + { 1642 + kref_put(&dlci->ref, gsm_dlci_free); 1643 + } 1644 + 1645 + /** 1646 + * gsm_dlci_release - release DLCI 1647 + * @dlci: DLCI to destroy 1648 + * 1649 + * Release a DLCI. Actual free is deferred until either 1650 + * mux is closed or tty is closed - whichever is last. 1651 + * 1652 + * Can sleep. 1653 + */ 1654 + static void gsm_dlci_release(struct gsm_dlci *dlci) 1662 1655 { 1663 1656 struct tty_struct *tty = tty_port_tty_get(&dlci->port); 1664 1657 if (tty) { 1665 1658 tty_vhangup(tty); 1666 1659 tty_kref_put(tty); 1667 1660 } 1668 - del_timer_sync(&dlci->t1); 1669 - dlci->gsm->dlci[dlci->addr] = NULL; 1670 - kfifo_free(dlci->fifo); 1671 - kfree(dlci); 1661 + dlci_put(dlci); 1672 1662 } 1673 1663 1674 1664 /* ··· 1885 1823 break; 1886 1824 case GSM_FCS: /* FCS follows the packet */ 1887 1825 gsm->received_fcs = c; 1888 - if (c == GSM0_SOF) { 1889 - gsm->state = GSM_SEARCH; 1890 - break; 1891 - } 1892 1826 gsm_queue(gsm); 1893 1827 gsm->state = GSM_SSOF; 1894 1828 break; ··· 2028 1970 /* Free up any link layer users */ 2029 1971 for (i = 0; i < NUM_DLCI; i++) 2030 1972 if (gsm->dlci[i]) 2031 - gsm_dlci_free(gsm->dlci[i]); 1973 + gsm_dlci_release(gsm->dlci[i]); 2032 1974 /* Now wipe the queues */ 2033 1975 for (txq = gsm->tx_head; txq != NULL; txq = gsm->tx_head) { 2034 1976 gsm->tx_head = txq->next; ··· 2068 2010 spin_lock(&gsm_mux_lock); 2069 2011 for (i = 0; i < MAX_MUX; i++) { 2070 2012 if (gsm_mux[i] == NULL) { 2013 + gsm->num = i; 2071 2014 gsm_mux[i] = gsm; 2072 2015 break; 2073 2016 } ··· 2089 2030 * gsm_free_mux - free up a mux 2090 2031 * @mux: mux to free 2091 2032 * 2092 - * Dispose of allocated resources for a dead mux. No refcounting 2093 - * at present so the mux must be truly dead. 2033 + * Dispose of allocated resources for a dead mux 2094 2034 */ 2095 2035 void gsm_free_mux(struct gsm_mux *gsm) 2096 2036 { ··· 2098 2040 kfree(gsm); 2099 2041 } 2100 2042 EXPORT_SYMBOL_GPL(gsm_free_mux); 2043 + 2044 + /** 2045 + * gsm_free_muxr - free up a mux 2046 + * @mux: mux to free 2047 + * 2048 + * Dispose of allocated resources for a dead mux 2049 + */ 2050 + static void gsm_free_muxr(struct kref *ref) 2051 + { 2052 + struct gsm_mux *gsm = container_of(ref, struct gsm_mux, ref); 2053 + gsm_free_mux(gsm); 2054 + } 2055 + 2056 + static inline void mux_get(struct gsm_mux *gsm) 2057 + { 2058 + kref_get(&gsm->ref); 2059 + } 2060 + 2061 + static inline void mux_put(struct gsm_mux *gsm) 2062 + { 2063 + kref_put(&gsm->ref, gsm_free_muxr); 2064 + } 2101 2065 2102 2066 /** 2103 2067 * gsm_alloc_mux - allocate a mux ··· 2144 2064 return NULL; 2145 2065 } 2146 2066 spin_lock_init(&gsm->lock); 2067 + kref_init(&gsm->ref); 2147 2068 2148 2069 gsm->t1 = T1; 2149 2070 gsm->t2 = T2; 2150 2071 gsm->n2 = N2; 2151 2072 gsm->ftype = UIH; 2152 - gsm->initiator = 0; 2153 2073 gsm->adaption = 1; 2154 2074 gsm->encoding = 1; 2155 2075 gsm->mru = 64; /* Default to encoding 1 so these should be 64 */ ··· 2195 2115 2196 2116 static int gsmld_attach_gsm(struct tty_struct *tty, struct gsm_mux *gsm) 2197 2117 { 2198 - int ret; 2118 + int ret, i; 2119 + int base = gsm->num << 6; /* Base for this MUX */ 2199 2120 2200 2121 gsm->tty = tty_kref_get(tty); 2201 2122 gsm->output = gsmld_output; 2202 2123 ret = gsm_activate_mux(gsm); 2203 2124 if (ret != 0) 2204 2125 tty_kref_put(gsm->tty); 2126 + else { 2127 + /* Don't register device 0 - this is the control channel and not 2128 + a usable tty interface */ 2129 + for (i = 1; i < NUM_DLCI; i++) 2130 + tty_register_device(gsm_tty_driver, base + i, NULL); 2131 + } 2205 2132 return ret; 2206 2133 } 2207 2134 ··· 2223 2136 2224 2137 static void gsmld_detach_gsm(struct tty_struct *tty, struct gsm_mux *gsm) 2225 2138 { 2139 + int i; 2140 + int base = gsm->num << 6; /* Base for this MUX */ 2141 + 2226 2142 WARN_ON(tty != gsm->tty); 2143 + for (i = 1; i < NUM_DLCI; i++) 2144 + tty_unregister_device(gsm_tty_driver, base + i); 2227 2145 gsm_cleanup_mux(gsm); 2228 2146 tty_kref_put(gsm->tty); 2229 2147 gsm->tty = NULL; ··· 2316 2224 2317 2225 gsmld_flush_buffer(tty); 2318 2226 /* Do other clean up here */ 2319 - gsm_free_mux(gsm); 2227 + mux_put(gsm); 2320 2228 } 2321 2229 2322 2230 /** ··· 2568 2476 } 2569 2477 } 2570 2478 2479 + /* 2480 + * Network interface 2481 + * 2482 + */ 2483 + 2484 + static int gsm_mux_net_open(struct net_device *net) 2485 + { 2486 + pr_debug("%s called\n", __func__); 2487 + netif_start_queue(net); 2488 + return 0; 2489 + } 2490 + 2491 + static int gsm_mux_net_close(struct net_device *net) 2492 + { 2493 + netif_stop_queue(net); 2494 + return 0; 2495 + } 2496 + 2497 + static struct net_device_stats *gsm_mux_net_get_stats(struct net_device *net) 2498 + { 2499 + return &((struct gsm_mux_net *)netdev_priv(net))->stats; 2500 + } 2501 + static void dlci_net_free(struct gsm_dlci *dlci) 2502 + { 2503 + if (!dlci->net) { 2504 + WARN_ON(1); 2505 + return; 2506 + } 2507 + dlci->adaption = dlci->prev_adaption; 2508 + dlci->data = dlci->prev_data; 2509 + free_netdev(dlci->net); 2510 + dlci->net = NULL; 2511 + } 2512 + static void net_free(struct kref *ref) 2513 + { 2514 + struct gsm_mux_net *mux_net; 2515 + struct gsm_dlci *dlci; 2516 + 2517 + mux_net = container_of(ref, struct gsm_mux_net, ref); 2518 + dlci = mux_net->dlci; 2519 + 2520 + if (dlci->net) { 2521 + unregister_netdev(dlci->net); 2522 + dlci_net_free(dlci); 2523 + } 2524 + } 2525 + 2526 + static inline void muxnet_get(struct gsm_mux_net *mux_net) 2527 + { 2528 + kref_get(&mux_net->ref); 2529 + } 2530 + 2531 + static inline void muxnet_put(struct gsm_mux_net *mux_net) 2532 + { 2533 + kref_put(&mux_net->ref, net_free); 2534 + } 2535 + 2536 + static int gsm_mux_net_start_xmit(struct sk_buff *skb, 2537 + struct net_device *net) 2538 + { 2539 + struct gsm_mux_net *mux_net = (struct gsm_mux_net *)netdev_priv(net); 2540 + struct gsm_dlci *dlci = mux_net->dlci; 2541 + muxnet_get(mux_net); 2542 + 2543 + skb_queue_head(&dlci->skb_list, skb); 2544 + STATS(net).tx_packets++; 2545 + STATS(net).tx_bytes += skb->len; 2546 + gsm_dlci_data_kick(dlci); 2547 + /* And tell the kernel when the last transmit started. */ 2548 + net->trans_start = jiffies; 2549 + muxnet_put(mux_net); 2550 + return NETDEV_TX_OK; 2551 + } 2552 + 2553 + /* called when a packet did not ack after watchdogtimeout */ 2554 + static void gsm_mux_net_tx_timeout(struct net_device *net) 2555 + { 2556 + /* Tell syslog we are hosed. */ 2557 + dev_dbg(&net->dev, "Tx timed out.\n"); 2558 + 2559 + /* Update statistics */ 2560 + STATS(net).tx_errors++; 2561 + } 2562 + 2563 + static void gsm_mux_rx_netchar(struct gsm_dlci *dlci, 2564 + unsigned char *in_buf, int size) 2565 + { 2566 + struct net_device *net = dlci->net; 2567 + struct sk_buff *skb; 2568 + struct gsm_mux_net *mux_net = (struct gsm_mux_net *)netdev_priv(net); 2569 + muxnet_get(mux_net); 2570 + 2571 + /* Allocate an sk_buff */ 2572 + skb = dev_alloc_skb(size + NET_IP_ALIGN); 2573 + if (!skb) { 2574 + /* We got no receive buffer. */ 2575 + STATS(net).rx_dropped++; 2576 + muxnet_put(mux_net); 2577 + return; 2578 + } 2579 + skb_reserve(skb, NET_IP_ALIGN); 2580 + memcpy(skb_put(skb, size), in_buf, size); 2581 + 2582 + skb->dev = net; 2583 + skb->protocol = __constant_htons(ETH_P_IP); 2584 + 2585 + /* Ship it off to the kernel */ 2586 + netif_rx(skb); 2587 + 2588 + /* update out statistics */ 2589 + STATS(net).rx_packets++; 2590 + STATS(net).rx_bytes += size; 2591 + muxnet_put(mux_net); 2592 + return; 2593 + } 2594 + 2595 + int gsm_change_mtu(struct net_device *net, int new_mtu) 2596 + { 2597 + struct gsm_mux_net *mux_net = (struct gsm_mux_net *)netdev_priv(net); 2598 + if ((new_mtu < 8) || (new_mtu > mux_net->dlci->gsm->mtu)) 2599 + return -EINVAL; 2600 + net->mtu = new_mtu; 2601 + return 0; 2602 + } 2603 + 2604 + static void gsm_mux_net_init(struct net_device *net) 2605 + { 2606 + static const struct net_device_ops gsm_netdev_ops = { 2607 + .ndo_open = gsm_mux_net_open, 2608 + .ndo_stop = gsm_mux_net_close, 2609 + .ndo_start_xmit = gsm_mux_net_start_xmit, 2610 + .ndo_tx_timeout = gsm_mux_net_tx_timeout, 2611 + .ndo_get_stats = gsm_mux_net_get_stats, 2612 + .ndo_change_mtu = gsm_change_mtu, 2613 + }; 2614 + 2615 + net->netdev_ops = &gsm_netdev_ops; 2616 + 2617 + /* fill in the other fields */ 2618 + net->watchdog_timeo = GSM_NET_TX_TIMEOUT; 2619 + net->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; 2620 + net->type = ARPHRD_NONE; 2621 + net->tx_queue_len = 10; 2622 + } 2623 + 2624 + 2625 + /* caller holds the dlci mutex */ 2626 + static void gsm_destroy_network(struct gsm_dlci *dlci) 2627 + { 2628 + struct gsm_mux_net *mux_net; 2629 + 2630 + pr_debug("destroy network interface"); 2631 + if (!dlci->net) 2632 + return; 2633 + mux_net = (struct gsm_mux_net *)netdev_priv(dlci->net); 2634 + muxnet_put(mux_net); 2635 + } 2636 + 2637 + 2638 + /* caller holds the dlci mutex */ 2639 + static int gsm_create_network(struct gsm_dlci *dlci, struct gsm_netconfig *nc) 2640 + { 2641 + char *netname; 2642 + int retval = 0; 2643 + struct net_device *net; 2644 + struct gsm_mux_net *mux_net; 2645 + 2646 + if (!capable(CAP_NET_ADMIN)) 2647 + return -EPERM; 2648 + 2649 + /* Already in a non tty mode */ 2650 + if (dlci->adaption > 2) 2651 + return -EBUSY; 2652 + 2653 + if (nc->protocol != htons(ETH_P_IP)) 2654 + return -EPROTONOSUPPORT; 2655 + 2656 + if (nc->adaption != 3 && nc->adaption != 4) 2657 + return -EPROTONOSUPPORT; 2658 + 2659 + pr_debug("create network interface"); 2660 + 2661 + netname = "gsm%d"; 2662 + if (nc->if_name[0] != '\0') 2663 + netname = nc->if_name; 2664 + net = alloc_netdev(sizeof(struct gsm_mux_net), 2665 + netname, 2666 + gsm_mux_net_init); 2667 + if (!net) { 2668 + pr_err("alloc_netdev failed"); 2669 + return -ENOMEM; 2670 + } 2671 + net->mtu = dlci->gsm->mtu; 2672 + mux_net = (struct gsm_mux_net *)netdev_priv(net); 2673 + mux_net->dlci = dlci; 2674 + kref_init(&mux_net->ref); 2675 + strncpy(nc->if_name, net->name, IFNAMSIZ); /* return net name */ 2676 + 2677 + /* reconfigure dlci for network */ 2678 + dlci->prev_adaption = dlci->adaption; 2679 + dlci->prev_data = dlci->data; 2680 + dlci->adaption = nc->adaption; 2681 + dlci->data = gsm_mux_rx_netchar; 2682 + dlci->net = net; 2683 + 2684 + pr_debug("register netdev"); 2685 + retval = register_netdev(net); 2686 + if (retval) { 2687 + pr_err("network register fail %d\n", retval); 2688 + dlci_net_free(dlci); 2689 + return retval; 2690 + } 2691 + return net->ifindex; /* return network index */ 2692 + } 2571 2693 2572 2694 /* Line discipline for real tty */ 2573 2695 struct tty_ldisc_ops tty_ldisc_packet = { ··· 2885 2579 port = &dlci->port; 2886 2580 port->count++; 2887 2581 tty->driver_data = dlci; 2582 + dlci_get(dlci); 2583 + dlci_get(dlci->gsm->dlci[0]); 2584 + mux_get(dlci->gsm); 2888 2585 tty_port_tty_set(port, tty); 2889 2586 2890 2587 dlci->modem_rx = 0; ··· 2903 2594 static void gsmtty_close(struct tty_struct *tty, struct file *filp) 2904 2595 { 2905 2596 struct gsm_dlci *dlci = tty->driver_data; 2597 + struct gsm_mux *gsm; 2598 + 2906 2599 if (dlci == NULL) 2907 2600 return; 2601 + mutex_lock(&dlci->mutex); 2602 + gsm_destroy_network(dlci); 2603 + mutex_unlock(&dlci->mutex); 2604 + gsm = dlci->gsm; 2908 2605 if (tty_port_close_start(&dlci->port, tty, filp) == 0) 2909 - return; 2606 + goto out; 2910 2607 gsm_dlci_begin_close(dlci); 2911 2608 tty_port_close_end(&dlci->port, tty); 2912 2609 tty_port_tty_set(&dlci->port, NULL); 2610 + out: 2611 + dlci_put(dlci); 2612 + dlci_put(gsm->dlci[0]); 2613 + mux_put(gsm); 2913 2614 } 2914 2615 2915 2616 static void gsmtty_hangup(struct tty_struct *tty) ··· 2996 2677 static int gsmtty_ioctl(struct tty_struct *tty, 2997 2678 unsigned int cmd, unsigned long arg) 2998 2679 { 2999 - return -ENOIOCTLCMD; 2680 + struct gsm_dlci *dlci = tty->driver_data; 2681 + struct gsm_netconfig nc; 2682 + int index; 2683 + 2684 + switch (cmd) { 2685 + case GSMIOC_ENABLE_NET: 2686 + if (copy_from_user(&nc, (void __user *)arg, sizeof(nc))) 2687 + return -EFAULT; 2688 + nc.if_name[IFNAMSIZ-1] = '\0'; 2689 + /* return net interface index or error code */ 2690 + mutex_lock(&dlci->mutex); 2691 + index = gsm_create_network(dlci, &nc); 2692 + mutex_unlock(&dlci->mutex); 2693 + if (copy_to_user((void __user *)arg, &nc, sizeof(nc))) 2694 + return -EFAULT; 2695 + return index; 2696 + case GSMIOC_DISABLE_NET: 2697 + if (!capable(CAP_NET_ADMIN)) 2698 + return -EPERM; 2699 + mutex_lock(&dlci->mutex); 2700 + gsm_destroy_network(dlci); 2701 + mutex_unlock(&dlci->mutex); 2702 + return 0; 2703 + default: 2704 + return -ENOIOCTLCMD; 2705 + } 3000 2706 } 3001 2707 3002 2708 static void gsmtty_set_termios(struct tty_struct *tty, struct ktermios *old) ··· 3070 2726 return gsmtty_modem_update(dlci, encode); 3071 2727 } 3072 2728 3073 - static struct tty_driver *gsm_tty_driver; 3074 2729 3075 2730 /* Virtual ttys for the demux */ 3076 2731 static const struct tty_operations gsmtty_ops = {
+1 -1
drivers/tty/n_tty.c
··· 185 185 tty->canon_head = tty->canon_data = tty->erasing = 0; 186 186 memset(&tty->read_flags, 0, sizeof tty->read_flags); 187 187 n_tty_set_room(tty); 188 - check_unthrottle(tty); 189 188 } 190 189 191 190 /** ··· 1586 1587 return -ENOMEM; 1587 1588 } 1588 1589 reset_buffer_flags(tty); 1590 + tty_unthrottle(tty); 1589 1591 tty->column = 0; 1590 1592 n_tty_set_termios(tty, NULL); 1591 1593 tty->minimum_to_wake = 1;
+2 -2
drivers/tty/serial/8250.c
··· 81 81 #define DEBUG_INTR(fmt...) do { } while (0) 82 82 #endif 83 83 84 - #define PASS_LIMIT 256 84 + #define PASS_LIMIT 512 85 85 86 86 #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) 87 87 ··· 1107 1107 */ 1108 1108 DEBUG_AUTOCONF("Xscale "); 1109 1109 up->port.type = PORT_XSCALE; 1110 - up->capabilities |= UART_CAP_UUE; 1110 + up->capabilities |= UART_CAP_UUE | UART_CAP_RTOIE; 1111 1111 return; 1112 1112 } 1113 1113 } else {
+182 -1
drivers/tty/serial/8250_pci.c
··· 39 39 u32 device; 40 40 u32 subvendor; 41 41 u32 subdevice; 42 + int (*probe)(struct pci_dev *dev); 42 43 int (*init)(struct pci_dev *dev); 43 44 int (*setup)(struct serial_private *, 44 45 const struct pciserial_board *, ··· 56 55 struct pci_serial_quirk *quirk; 57 56 int line[0]; 58 57 }; 58 + 59 + static int pci_default_setup(struct serial_private*, 60 + const struct pciserial_board*, struct uart_port*, int); 59 61 60 62 static void moan_device(const char *str, struct pci_dev *dev) 61 63 { ··· 575 571 { 8, timedia_eight_port } 576 572 }; 577 573 574 + /* 575 + * There are nearly 70 different Timedia/SUNIX PCI serial devices. Instead of 576 + * listing them individually, this driver merely grabs them all with 577 + * PCI_ANY_ID. Some of these devices, however, also feature a parallel port, 578 + * and should be left free to be claimed by parport_serial instead. 579 + */ 580 + static int pci_timedia_probe(struct pci_dev *dev) 581 + { 582 + /* 583 + * Check the third digit of the subdevice ID 584 + * (0,2,3,5,6: serial only -- 7,8,9: serial + parallel) 585 + */ 586 + if ((dev->subsystem_device & 0x00f0) >= 0x70) { 587 + dev_info(&dev->dev, 588 + "ignoring Timedia subdevice %04x for parport_serial\n", 589 + dev->subsystem_device); 590 + return -ENODEV; 591 + } 592 + 593 + return 0; 594 + } 595 + 578 596 static int pci_timedia_init(struct pci_dev *dev) 579 597 { 580 598 const unsigned short *ids; ··· 778 752 return setup_port(priv, port, bar, offset, board->reg_shift); 779 753 } 780 754 755 + static int pci_netmos_9900_setup(struct serial_private *priv, 756 + const struct pciserial_board *board, 757 + struct uart_port *port, int idx) 758 + { 759 + unsigned int bar; 760 + 761 + if ((priv->dev->subsystem_device & 0xff00) == 0x3000) { 762 + /* netmos apparently orders BARs by datasheet layout, so serial 763 + * ports get BARs 0 and 3 (or 1 and 4 for memmapped) 764 + */ 765 + bar = 3 * idx; 766 + 767 + return setup_port(priv, port, bar, 0, board->reg_shift); 768 + } else { 769 + return pci_default_setup(priv, board, port, idx); 770 + } 771 + } 772 + 773 + /* the 99xx series comes with a range of device IDs and a variety 774 + * of capabilities: 775 + * 776 + * 9900 has varying capabilities and can cascade to sub-controllers 777 + * (cascading should be purely internal) 778 + * 9904 is hardwired with 4 serial ports 779 + * 9912 and 9922 are hardwired with 2 serial ports 780 + */ 781 + static int pci_netmos_9900_numports(struct pci_dev *dev) 782 + { 783 + unsigned int c = dev->class; 784 + unsigned int pi; 785 + unsigned short sub_serports; 786 + 787 + pi = (c & 0xff); 788 + 789 + if (pi == 2) { 790 + return 1; 791 + } else if ((pi == 0) && 792 + (dev->device == PCI_DEVICE_ID_NETMOS_9900)) { 793 + /* two possibilities: 0x30ps encodes number of parallel and 794 + * serial ports, or 0x1000 indicates *something*. This is not 795 + * immediately obvious, since the 2s1p+4s configuration seems 796 + * to offer all functionality on functions 0..2, while still 797 + * advertising the same function 3 as the 4s+2s1p config. 798 + */ 799 + sub_serports = dev->subsystem_device & 0xf; 800 + if (sub_serports > 0) { 801 + return sub_serports; 802 + } else { 803 + printk(KERN_NOTICE "NetMos/Mostech serial driver ignoring port on ambiguous config.\n"); 804 + return 0; 805 + } 806 + } 807 + 808 + moan_device("unknown NetMos/Mostech program interface", dev); 809 + return 0; 810 + } 781 811 782 812 static int pci_netmos_init(struct pci_dev *dev) 783 813 { ··· 843 761 if ((dev->device == PCI_DEVICE_ID_NETMOS_9901) || 844 762 (dev->device == PCI_DEVICE_ID_NETMOS_9865)) 845 763 return 0; 764 + 846 765 if (dev->subsystem_vendor == PCI_VENDOR_ID_IBM && 847 766 dev->subsystem_device == 0x0299) 848 767 return 0; 849 768 769 + switch (dev->device) { /* FALLTHROUGH on all */ 770 + case PCI_DEVICE_ID_NETMOS_9904: 771 + case PCI_DEVICE_ID_NETMOS_9912: 772 + case PCI_DEVICE_ID_NETMOS_9922: 773 + case PCI_DEVICE_ID_NETMOS_9900: 774 + num_serial = pci_netmos_9900_numports(dev); 775 + break; 776 + 777 + default: 778 + if (num_serial == 0 ) { 779 + moan_device("unknown NetMos/Mostech device", dev); 780 + } 781 + } 782 + 850 783 if (num_serial == 0) 851 784 return -ENODEV; 785 + 852 786 return num_serial; 853 787 } 854 788 ··· 1494 1396 .device = PCI_DEVICE_ID_TIMEDIA_1889, 1495 1397 .subvendor = PCI_VENDOR_ID_TIMEDIA, 1496 1398 .subdevice = PCI_ANY_ID, 1399 + .probe = pci_timedia_probe, 1497 1400 .init = pci_timedia_init, 1498 1401 .setup = pci_timedia_setup, 1499 1402 }, ··· 1525 1426 .subvendor = PCI_ANY_ID, 1526 1427 .subdevice = PCI_ANY_ID, 1527 1428 .init = pci_netmos_init, 1528 - .setup = pci_default_setup, 1429 + .setup = pci_netmos_9900_setup, 1529 1430 }, 1530 1431 /* 1531 1432 * For Oxford Semiconductor Tornado based devices ··· 1802 1703 pbn_ADDIDATA_PCIe_8_3906250, 1803 1704 pbn_ce4100_1_115200, 1804 1705 pbn_omegapci, 1706 + pbn_NETMOS9900_2s_115200, 1805 1707 }; 1806 1708 1807 1709 /* ··· 2504 2404 .base_baud = 115200, 2505 2405 .uart_offset = 0x200, 2506 2406 }, 2407 + [pbn_NETMOS9900_2s_115200] = { 2408 + .flags = FL_BASE0, 2409 + .num_ports = 2, 2410 + .base_baud = 115200, 2411 + }, 2507 2412 }; 2508 2413 2509 2414 static const struct pci_device_id softmodem_blacklist[] = { ··· 2745 2640 static int __devinit 2746 2641 pciserial_init_one(struct pci_dev *dev, const struct pci_device_id *ent) 2747 2642 { 2643 + struct pci_serial_quirk *quirk; 2748 2644 struct serial_private *priv; 2749 2645 const struct pciserial_board *board; 2750 2646 struct pciserial_board tmp; 2751 2647 int rc; 2648 + 2649 + quirk = find_quirk(dev); 2650 + if (quirk->probe) { 2651 + rc = quirk->probe(dev); 2652 + if (rc) 2653 + return rc; 2654 + } 2752 2655 2753 2656 if (ent->driver_data >= ARRAY_SIZE(pci_boards)) { 2754 2657 printk(KERN_ERR "pci_init_one: invalid driver_data: %ld\n", ··· 2767 2654 board = &pci_boards[ent->driver_data]; 2768 2655 2769 2656 rc = pci_enable_device(dev); 2657 + pci_save_state(dev); 2770 2658 if (rc) 2771 2659 return rc; 2772 2660 ··· 3999 3885 0xA000, 0x1000, 4000 3886 0, 0, pbn_b0_1_115200 }, 4001 3887 3888 + /* the 9901 is a rebranded 9912 */ 3889 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9912, 3890 + 0xA000, 0x1000, 3891 + 0, 0, pbn_b0_1_115200 }, 3892 + 3893 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9922, 3894 + 0xA000, 0x1000, 3895 + 0, 0, pbn_b0_1_115200 }, 3896 + 3897 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9904, 3898 + 0xA000, 0x1000, 3899 + 0, 0, pbn_b0_1_115200 }, 3900 + 3901 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900, 3902 + 0xA000, 0x1000, 3903 + 0, 0, pbn_b0_1_115200 }, 3904 + 3905 + { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9900, 3906 + 0xA000, 0x3002, 3907 + 0, 0, pbn_NETMOS9900_2s_115200 }, 3908 + 4002 3909 /* 4003 3910 * Best Connectivity PCI Multi I/O cards 4004 3911 */ ··· 4062 3927 { 0, } 4063 3928 }; 4064 3929 3930 + static pci_ers_result_t serial8250_io_error_detected(struct pci_dev *dev, 3931 + pci_channel_state_t state) 3932 + { 3933 + struct serial_private *priv = pci_get_drvdata(dev); 3934 + 3935 + if (state == pci_channel_io_perm_failure) 3936 + return PCI_ERS_RESULT_DISCONNECT; 3937 + 3938 + if (priv) 3939 + pciserial_suspend_ports(priv); 3940 + 3941 + pci_disable_device(dev); 3942 + 3943 + return PCI_ERS_RESULT_NEED_RESET; 3944 + } 3945 + 3946 + static pci_ers_result_t serial8250_io_slot_reset(struct pci_dev *dev) 3947 + { 3948 + int rc; 3949 + 3950 + rc = pci_enable_device(dev); 3951 + 3952 + if (rc) 3953 + return PCI_ERS_RESULT_DISCONNECT; 3954 + 3955 + pci_restore_state(dev); 3956 + pci_save_state(dev); 3957 + 3958 + return PCI_ERS_RESULT_RECOVERED; 3959 + } 3960 + 3961 + static void serial8250_io_resume(struct pci_dev *dev) 3962 + { 3963 + struct serial_private *priv = pci_get_drvdata(dev); 3964 + 3965 + if (priv) 3966 + pciserial_resume_ports(priv); 3967 + } 3968 + 3969 + static struct pci_error_handlers serial8250_err_handler = { 3970 + .error_detected = serial8250_io_error_detected, 3971 + .slot_reset = serial8250_io_slot_reset, 3972 + .resume = serial8250_io_resume, 3973 + }; 3974 + 4065 3975 static struct pci_driver serial_pci_driver = { 4066 3976 .name = "serial", 4067 3977 .probe = pciserial_init_one, ··· 4116 3936 .resume = pciserial_resume_one, 4117 3937 #endif 4118 3938 .id_table = serial_pci_tbl, 3939 + .err_handler = &serial8250_err_handler, 4119 3940 }; 4120 3941 4121 3942 static int __init serial8250_pci_init(void)
+1 -1
drivers/tty/serial/Kconfig
··· 1404 1404 1405 1405 config SERIAL_SC26XX_CONSOLE 1406 1406 bool "Console on SC2681/SC2692 serial port" 1407 - depends on SERIAL_SC26XX 1407 + depends on SERIAL_SC26XX=y 1408 1408 select SERIAL_CORE_CONSOLE 1409 1409 help 1410 1410 Support for Console on SC2681/SC2692 serial ports.
+8 -3
drivers/tty/serial/pch_uart.c
··· 14 14 *along with this program; if not, write to the Free Software 15 15 *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 16 16 */ 17 + #include <linux/kernel.h> 17 18 #include <linux/serial_reg.h> 18 19 #include <linux/slab.h> 19 20 #include <linux/module.h> ··· 45 44 /* Set the max number of UART port 46 45 * Intel EG20T PCH: 4 port 47 46 * OKI SEMICONDUCTOR ML7213 IOH: 3 port 47 + * OKI SEMICONDUCTOR ML7223 IOH: 2 port 48 48 */ 49 49 #define PCH_UART_NR 4 50 50 ··· 138 136 139 137 #define PCH_UART_DLL 0x00 140 138 #define PCH_UART_DLM 0x01 141 - 142 - #define DIV_ROUND(a, b) (((a) + ((b)/2)) / (b)) 143 139 144 140 #define PCH_UART_IID_RLS (PCH_UART_IIR_REI) 145 141 #define PCH_UART_IID_RDR (PCH_UART_IIR_RRI) ··· 316 316 unsigned int dll, dlm, lcr; 317 317 int div; 318 318 319 - div = DIV_ROUND(priv->base_baud / 16, baud); 319 + div = DIV_ROUND_CLOSEST(priv->base_baud / 16, baud); 320 320 if (div < 0 || USHRT_MAX <= div) { 321 321 dev_err(priv->port.dev, "Invalid Baud(div=0x%x)\n", div); 322 322 return -EINVAL; ··· 1429 1429 goto init_port_hal_free; 1430 1430 } 1431 1431 1432 + pci_enable_msi(pdev); 1433 + 1432 1434 iobase = pci_resource_start(pdev, 0); 1433 1435 mapbase = pci_resource_start(pdev, 1); 1434 1436 priv->mapbase = mapbase; ··· 1487 1485 struct eg20t_port *priv; 1488 1486 1489 1487 priv = (struct eg20t_port *)pci_get_drvdata(pdev); 1488 + 1489 + pci_disable_msi(pdev); 1490 1490 pch_uart_exit_port(priv); 1491 1491 pci_disable_device(pdev); 1492 1492 kfree(priv); ··· 1572 1568 return ret; 1573 1569 1574 1570 probe_disable_device: 1571 + pci_disable_msi(pdev); 1575 1572 pci_disable_device(pdev); 1576 1573 probe_error: 1577 1574 return ret;
+4
drivers/tty/serial/s5pv210.c
··· 18 18 #include <linux/init.h> 19 19 #include <linux/serial_core.h> 20 20 #include <linux/serial.h> 21 + #include <linux/delay.h> 21 22 22 23 #include <asm/irq.h> 23 24 #include <mach/hardware.h> ··· 83 82 /* reset both fifos */ 84 83 wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 85 84 wr_regl(port, S3C2410_UFCON, cfg->ufcon); 85 + 86 + /* It is need to delay When reset FIFO register */ 87 + udelay(1); 86 88 87 89 return 0; 88 90 }
+14 -13
drivers/tty/serial/samsung.c
··· 1194 1194 EXPORT_SYMBOL_GPL(s3c24xx_serial_remove); 1195 1195 1196 1196 /* UART power management code */ 1197 - 1198 - #ifdef CONFIG_PM 1199 - 1200 - static int s3c24xx_serial_suspend(struct platform_device *dev, pm_message_t state) 1197 + #ifdef CONFIG_PM_SLEEP 1198 + static int s3c24xx_serial_suspend(struct device *dev) 1201 1199 { 1202 - struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); 1200 + struct uart_port *port = s3c24xx_dev_to_port(dev); 1203 1201 1204 1202 if (port) 1205 1203 uart_suspend_port(&s3c24xx_uart_drv, port); ··· 1205 1207 return 0; 1206 1208 } 1207 1209 1208 - static int s3c24xx_serial_resume(struct platform_device *dev) 1210 + static int s3c24xx_serial_resume(struct device *dev) 1209 1211 { 1210 - struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); 1212 + struct uart_port *port = s3c24xx_dev_to_port(dev); 1211 1213 struct s3c24xx_uart_port *ourport = to_ourport(port); 1212 1214 1213 1215 if (port) { ··· 1220 1222 1221 1223 return 0; 1222 1224 } 1223 - #endif 1225 + 1226 + static const struct dev_pm_ops s3c24xx_serial_pm_ops = { 1227 + .suspend = s3c24xx_serial_suspend, 1228 + .resume = s3c24xx_serial_resume, 1229 + }; 1230 + #else /* !CONFIG_PM_SLEEP */ 1231 + #define s3c24xx_serial_pm_ops NULL 1232 + #endif /* CONFIG_PM_SLEEP */ 1224 1233 1225 1234 int s3c24xx_serial_init(struct platform_driver *drv, 1226 1235 struct s3c24xx_uart_info *info) 1227 1236 { 1228 1237 dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); 1229 - 1230 - #ifdef CONFIG_PM 1231 - drv->suspend = s3c24xx_serial_suspend; 1232 - drv->resume = s3c24xx_serial_resume; 1233 - #endif 1238 + drv->driver.pm = &s3c24xx_serial_pm_ops; 1234 1239 1235 1240 return platform_driver_register(drv); 1236 1241 }
+2 -2
drivers/tty/tty_io.c
··· 94 94 #include <linux/delay.h> 95 95 #include <linux/seq_file.h> 96 96 #include <linux/serial.h> 97 + #include <linux/ratelimit.h> 97 98 98 99 #include <linux/uaccess.h> 99 100 #include <asm/system.h> ··· 1421 1420 1422 1421 /* call the tty release_tty routine to clean out this slot */ 1423 1422 err_release_tty: 1424 - if (printk_ratelimit()) 1425 - printk(KERN_INFO "tty_init_dev: ldisc open failed, " 1423 + printk_ratelimited(KERN_INFO "tty_init_dev: ldisc open failed, " 1426 1424 "clearing slot %d\n", idx); 1427 1425 release_tty(tty, idx); 1428 1426 return ERR_PTR(retval);
+11
include/linux/gsmmux.h
··· 21 21 #define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config) 22 22 #define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config) 23 23 24 + struct gsm_netconfig { 25 + unsigned int adaption; /* Adaption to use in network mode */ 26 + unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */ 27 + unsigned short unused2; 28 + char if_name[IFNAMSIZ]; /* interface name format string */ 29 + __u8 unused[28]; /* For future use */ 30 + }; 31 + 32 + #define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig) 33 + #define GSMIOC_DISABLE_NET _IO('G', 3) 34 + 24 35 25 36 #endif
+4
include/linux/pci_ids.h
··· 2832 2832 #define PCI_DEVICE_ID_NETMOS_9845 0x9845 2833 2833 #define PCI_DEVICE_ID_NETMOS_9855 0x9855 2834 2834 #define PCI_DEVICE_ID_NETMOS_9865 0x9865 2835 + #define PCI_DEVICE_ID_NETMOS_9900 0x9900 2835 2836 #define PCI_DEVICE_ID_NETMOS_9901 0x9901 2837 + #define PCI_DEVICE_ID_NETMOS_9904 0x9904 2838 + #define PCI_DEVICE_ID_NETMOS_9912 0x9912 2839 + #define PCI_DEVICE_ID_NETMOS_9922 0x9922 2836 2840 2837 2841 #define PCI_VENDOR_ID_3COM_2 0xa727 2838 2842
+2 -1
include/linux/pti.h
··· 36 36 37 37 /* the following functions are defined in misc/pti.c */ 38 38 void pti_writedata(struct pti_masterchannel *mc, u8 *buf, int count); 39 - struct pti_masterchannel *pti_request_masterchannel(u8 type); 39 + struct pti_masterchannel *pti_request_masterchannel(u8 type, 40 + const char *thread_name); 40 41 void pti_release_masterchannel(struct pti_masterchannel *mc); 41 42 42 43 #endif /*PTI_H_*/
+19 -18
include/linux/tty.h
··· 5 5 * 'tty.h' defines some structures used by tty_io.c and some defines. 6 6 */ 7 7 8 - #ifdef __KERNEL__ 9 - #include <linux/fs.h> 10 - #include <linux/major.h> 11 - #include <linux/termios.h> 12 - #include <linux/workqueue.h> 13 - #include <linux/tty_driver.h> 14 - #include <linux/tty_ldisc.h> 15 - #include <linux/mutex.h> 16 - 17 - #include <asm/system.h> 18 - 19 - 20 - /* 21 - * (Note: the *_driver.minor_start values 1, 64, 128, 192 are 22 - * hardcoded at present.) 23 - */ 24 - #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ 25 - #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ 26 8 #define NR_LDISCS 30 27 9 28 10 /* line disciplines */ ··· 34 52 #define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ 35 53 #define N_TRACESINK 23 /* Trace data routing for MIPI P1149.7 */ 36 54 #define N_TRACEROUTER 24 /* Trace data routing for MIPI P1149.7 */ 55 + 56 + #ifdef __KERNEL__ 57 + #include <linux/fs.h> 58 + #include <linux/major.h> 59 + #include <linux/termios.h> 60 + #include <linux/workqueue.h> 61 + #include <linux/tty_driver.h> 62 + #include <linux/tty_ldisc.h> 63 + #include <linux/mutex.h> 64 + 65 + #include <asm/system.h> 66 + 67 + 68 + /* 69 + * (Note: the *_driver.minor_start values 1, 64, 128, 192 are 70 + * hardcoded at present.) 71 + */ 72 + #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ 73 + #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ 37 74 38 75 /* 39 76 * This character is the same as _POSIX_VDISABLE: it cannot be used as