diff options
Diffstat (limited to 'drivers')
104 files changed, 1642 insertions, 1194 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index f621168f38ae..8ea70625f7ea 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -457,10 +457,6 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, | |||
457 | } | 457 | } |
458 | 458 | ||
459 | vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); | 459 | vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0)); |
460 | if ((vendor & 0xFFFF) == 0xFFFF) { | ||
461 | rc = -ENODEV; | ||
462 | goto out_err; | ||
463 | } | ||
464 | 460 | ||
465 | /* Default timeouts */ | 461 | /* Default timeouts */ |
466 | chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT); | 462 | chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT); |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index f07637a8f88f..a88b94a82b14 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -398,7 +398,7 @@ int tty_insert_flip_string_flags(struct tty_struct *tty, | |||
398 | while (unlikely(size > copied)); | 398 | while (unlikely(size > copied)); |
399 | return copied; | 399 | return copied; |
400 | } | 400 | } |
401 | EXPORT_SYMBOL_GPL(tty_insert_flip_string_flags); | 401 | EXPORT_SYMBOL(tty_insert_flip_string_flags); |
402 | 402 | ||
403 | void tty_schedule_flip(struct tty_struct *tty) | 403 | void tty_schedule_flip(struct tty_struct *tty) |
404 | { | 404 | { |
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index a140e4536a4e..766cc969c4d0 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -491,7 +491,7 @@ static struct pci_device_id divil_pci[] = { | |||
491 | 491 | ||
492 | #define MSR_LBAR_SMB 0x5140000B | 492 | #define MSR_LBAR_SMB 0x5140000B |
493 | 493 | ||
494 | static int scx200_add_cs553x(void) | 494 | static __init int scx200_add_cs553x(void) |
495 | { | 495 | { |
496 | u32 low, hi; | 496 | u32 low, hi; |
497 | u32 smb_base; | 497 | u32 smb_base; |
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index 3697edafd6d2..dddcdae736ac 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c | |||
@@ -1905,19 +1905,19 @@ static void __exit infinipath_cleanup(void) | |||
1905 | } else | 1905 | } else |
1906 | ipath_dbg("irq is 0, not doing free_irq " | 1906 | ipath_dbg("irq is 0, not doing free_irq " |
1907 | "for unit %u\n", dd->ipath_unit); | 1907 | "for unit %u\n", dd->ipath_unit); |
1908 | dd->pcidev = NULL; | ||
1909 | } | ||
1910 | 1908 | ||
1911 | /* | 1909 | /* |
1912 | * we check for NULL here, because it's outside the kregbase | 1910 | * we check for NULL here, because it's outside |
1913 | * check, and we need to call it after the free_irq. Thus | 1911 | * the kregbase check, and we need to call it |
1914 | * it's possible that the function pointers were never | 1912 | * after the free_irq. Thus it's possible that |
1915 | * initialized. | 1913 | * the function pointers were never initialized. |
1916 | */ | 1914 | */ |
1917 | if (dd->ipath_f_cleanup) | 1915 | if (dd->ipath_f_cleanup) |
1918 | /* clean up chip-specific stuff */ | 1916 | /* clean up chip-specific stuff */ |
1919 | dd->ipath_f_cleanup(dd); | 1917 | dd->ipath_f_cleanup(dd); |
1920 | 1918 | ||
1919 | dd->pcidev = NULL; | ||
1920 | } | ||
1921 | spin_lock_irqsave(&ipath_devs_lock, flags); | 1921 | spin_lock_irqsave(&ipath_devs_lock, flags); |
1922 | } | 1922 | } |
1923 | 1923 | ||
diff --git a/drivers/infiniband/hw/ipath/ipath_eeprom.c b/drivers/infiniband/hw/ipath/ipath_eeprom.c index f11a900e8cd7..a2f1ceafcca9 100644 --- a/drivers/infiniband/hw/ipath/ipath_eeprom.c +++ b/drivers/infiniband/hw/ipath/ipath_eeprom.c | |||
@@ -505,11 +505,10 @@ static u8 flash_csum(struct ipath_flash *ifp, int adjust) | |||
505 | * ipath_get_guid - get the GUID from the i2c device | 505 | * ipath_get_guid - get the GUID from the i2c device |
506 | * @dd: the infinipath device | 506 | * @dd: the infinipath device |
507 | * | 507 | * |
508 | * When we add the multi-chip support, we will probably have to add | 508 | * We have the capability to use the ipath_nguid field, and get |
509 | * the ability to use the number of guids field, and get the guid from | 509 | * the guid from the first chip's flash, to use for all of them. |
510 | * the first chip's flash, to use for all of them. | ||
511 | */ | 510 | */ |
512 | void ipath_get_guid(struct ipath_devdata *dd) | 511 | void ipath_get_eeprom_info(struct ipath_devdata *dd) |
513 | { | 512 | { |
514 | void *buf; | 513 | void *buf; |
515 | struct ipath_flash *ifp; | 514 | struct ipath_flash *ifp; |
diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c index c347191f02bf..ada267e41f6c 100644 --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c | |||
@@ -139,7 +139,7 @@ static int ipath_get_base_info(struct ipath_portdata *pd, | |||
139 | kinfo->spi_piosize = dd->ipath_ibmaxlen; | 139 | kinfo->spi_piosize = dd->ipath_ibmaxlen; |
140 | kinfo->spi_mtu = dd->ipath_ibmaxlen; /* maxlen, not ibmtu */ | 140 | kinfo->spi_mtu = dd->ipath_ibmaxlen; /* maxlen, not ibmtu */ |
141 | kinfo->spi_port = pd->port_port; | 141 | kinfo->spi_port = pd->port_port; |
142 | kinfo->spi_sw_version = IPATH_USER_SWVERSION; | 142 | kinfo->spi_sw_version = IPATH_KERN_SWVERSION; |
143 | kinfo->spi_hw_version = dd->ipath_revision; | 143 | kinfo->spi_hw_version = dd->ipath_revision; |
144 | 144 | ||
145 | if (copy_to_user(ubase, kinfo, sizeof(*kinfo))) | 145 | if (copy_to_user(ubase, kinfo, sizeof(*kinfo))) |
@@ -1224,6 +1224,10 @@ static unsigned int ipath_poll(struct file *fp, | |||
1224 | 1224 | ||
1225 | if (tail == head) { | 1225 | if (tail == head) { |
1226 | set_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag); | 1226 | set_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag); |
1227 | if(dd->ipath_rhdrhead_intr_off) /* arm rcv interrupt */ | ||
1228 | (void)ipath_write_ureg(dd, ur_rcvhdrhead, | ||
1229 | dd->ipath_rhdrhead_intr_off | ||
1230 | | head, pd->port_port); | ||
1227 | poll_wait(fp, &pd->port_wait, pt); | 1231 | poll_wait(fp, &pd->port_wait, pt); |
1228 | 1232 | ||
1229 | if (test_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag)) { | 1233 | if (test_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag)) { |
diff --git a/drivers/infiniband/hw/ipath/ipath_ht400.c b/drivers/infiniband/hw/ipath/ipath_ht400.c index 4652435998f3..fac0a2b74de2 100644 --- a/drivers/infiniband/hw/ipath/ipath_ht400.c +++ b/drivers/infiniband/hw/ipath/ipath_ht400.c | |||
@@ -607,7 +607,12 @@ static int ipath_ht_boardname(struct ipath_devdata *dd, char *name, | |||
607 | case 4: /* Ponderosa is one of the bringup boards */ | 607 | case 4: /* Ponderosa is one of the bringup boards */ |
608 | n = "Ponderosa"; | 608 | n = "Ponderosa"; |
609 | break; | 609 | break; |
610 | case 5: /* HT-460 original production board */ | 610 | case 5: |
611 | /* | ||
612 | * HT-460 original production board; two production levels, with | ||
613 | * different serial number ranges. See ipath_ht_early_init() for | ||
614 | * case where we enable IPATH_GPIO_INTR for later serial # range. | ||
615 | */ | ||
611 | n = "InfiniPath_HT-460"; | 616 | n = "InfiniPath_HT-460"; |
612 | break; | 617 | break; |
613 | case 6: | 618 | case 6: |
@@ -642,7 +647,7 @@ static int ipath_ht_boardname(struct ipath_devdata *dd, char *name, | |||
642 | if (n) | 647 | if (n) |
643 | snprintf(name, namelen, "%s", n); | 648 | snprintf(name, namelen, "%s", n); |
644 | 649 | ||
645 | if (dd->ipath_majrev != 3 || dd->ipath_minrev != 2) { | 650 | if (dd->ipath_majrev != 3 || (dd->ipath_minrev < 2 || dd->ipath_minrev > 3)) { |
646 | /* | 651 | /* |
647 | * This version of the driver only supports the HT-400 | 652 | * This version of the driver only supports the HT-400 |
648 | * Rev 3.2 | 653 | * Rev 3.2 |
@@ -1520,6 +1525,18 @@ static int ipath_ht_early_init(struct ipath_devdata *dd) | |||
1520 | */ | 1525 | */ |
1521 | ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, | 1526 | ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl, |
1522 | INFINIPATH_S_ABORT); | 1527 | INFINIPATH_S_ABORT); |
1528 | |||
1529 | ipath_get_eeprom_info(dd); | ||
1530 | if(dd->ipath_boardrev == 5 && dd->ipath_serial[0] == '1' && | ||
1531 | dd->ipath_serial[1] == '2' && dd->ipath_serial[2] == '8') { | ||
1532 | /* | ||
1533 | * Later production HT-460 has same changes as HT-465, so | ||
1534 | * can use GPIO interrupts. They have serial #'s starting | ||
1535 | * with 128, rather than 112. | ||
1536 | */ | ||
1537 | dd->ipath_flags |= IPATH_GPIO_INTR; | ||
1538 | dd->ipath_flags &= ~IPATH_POLL_RX_INTR; | ||
1539 | } | ||
1523 | return 0; | 1540 | return 0; |
1524 | } | 1541 | } |
1525 | 1542 | ||
diff --git a/drivers/infiniband/hw/ipath/ipath_init_chip.c b/drivers/infiniband/hw/ipath/ipath_init_chip.c index 16f640e1c16e..dc83250d26a6 100644 --- a/drivers/infiniband/hw/ipath/ipath_init_chip.c +++ b/drivers/infiniband/hw/ipath/ipath_init_chip.c | |||
@@ -879,7 +879,6 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit) | |||
879 | 879 | ||
880 | done: | 880 | done: |
881 | if (!ret) { | 881 | if (!ret) { |
882 | ipath_get_guid(dd); | ||
883 | *dd->ipath_statusp |= IPATH_STATUS_CHIP_PRESENT; | 882 | *dd->ipath_statusp |= IPATH_STATUS_CHIP_PRESENT; |
884 | if (!dd->ipath_f_intrsetup(dd)) { | 883 | if (!dd->ipath_f_intrsetup(dd)) { |
885 | /* now we can enable all interrupts from the chip */ | 884 | /* now we can enable all interrupts from the chip */ |
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index e6507f8115bc..5d92d57b6f54 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -650,7 +650,7 @@ u32 __iomem *ipath_getpiobuf(struct ipath_devdata *, u32 *); | |||
650 | void ipath_init_pe800_funcs(struct ipath_devdata *); | 650 | void ipath_init_pe800_funcs(struct ipath_devdata *); |
651 | /* init HT-400-specific func */ | 651 | /* init HT-400-specific func */ |
652 | void ipath_init_ht400_funcs(struct ipath_devdata *); | 652 | void ipath_init_ht400_funcs(struct ipath_devdata *); |
653 | void ipath_get_guid(struct ipath_devdata *); | 653 | void ipath_get_eeprom_info(struct ipath_devdata *); |
654 | u64 ipath_snap_cntr(struct ipath_devdata *, ipath_creg); | 654 | u64 ipath_snap_cntr(struct ipath_devdata *, ipath_creg); |
655 | 655 | ||
656 | /* | 656 | /* |
diff --git a/drivers/infiniband/hw/ipath/ipath_keys.c b/drivers/infiniband/hw/ipath/ipath_keys.c index aa33b0e9f2f6..5ae8761f9dd2 100644 --- a/drivers/infiniband/hw/ipath/ipath_keys.c +++ b/drivers/infiniband/hw/ipath/ipath_keys.c | |||
@@ -136,9 +136,7 @@ int ipath_lkey_ok(struct ipath_lkey_table *rkt, struct ipath_sge *isge, | |||
136 | ret = 1; | 136 | ret = 1; |
137 | goto bail; | 137 | goto bail; |
138 | } | 138 | } |
139 | spin_lock(&rkt->lock); | ||
140 | mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))]; | 139 | mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))]; |
141 | spin_unlock(&rkt->lock); | ||
142 | if (unlikely(mr == NULL || mr->lkey != sge->lkey)) { | 140 | if (unlikely(mr == NULL || mr->lkey != sge->lkey)) { |
143 | ret = 0; | 141 | ret = 0; |
144 | goto bail; | 142 | goto bail; |
@@ -184,8 +182,6 @@ bail: | |||
184 | * @acc: access flags | 182 | * @acc: access flags |
185 | * | 183 | * |
186 | * Return 1 if successful, otherwise 0. | 184 | * Return 1 if successful, otherwise 0. |
187 | * | ||
188 | * The QP r_rq.lock should be held. | ||
189 | */ | 185 | */ |
190 | int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, | 186 | int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, |
191 | u32 len, u64 vaddr, u32 rkey, int acc) | 187 | u32 len, u64 vaddr, u32 rkey, int acc) |
@@ -196,9 +192,7 @@ int ipath_rkey_ok(struct ipath_ibdev *dev, struct ipath_sge_state *ss, | |||
196 | size_t off; | 192 | size_t off; |
197 | int ret; | 193 | int ret; |
198 | 194 | ||
199 | spin_lock(&rkt->lock); | ||
200 | mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))]; | 195 | mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))]; |
201 | spin_unlock(&rkt->lock); | ||
202 | if (unlikely(mr == NULL || mr->lkey != rkey)) { | 196 | if (unlikely(mr == NULL || mr->lkey != rkey)) { |
203 | ret = 0; | 197 | ret = 0; |
204 | goto bail; | 198 | goto bail; |
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.c b/drivers/infiniband/hw/ipath/ipath_layer.c index 9cb5258ffed9..9ec4ac77b87f 100644 --- a/drivers/infiniband/hw/ipath/ipath_layer.c +++ b/drivers/infiniband/hw/ipath/ipath_layer.c | |||
@@ -872,12 +872,13 @@ static void copy_io(u32 __iomem *piobuf, struct ipath_sge_state *ss, | |||
872 | update_sge(ss, len); | 872 | update_sge(ss, len); |
873 | length -= len; | 873 | length -= len; |
874 | } | 874 | } |
875 | /* Update address before sending packet. */ | ||
876 | update_sge(ss, length); | ||
875 | /* must flush early everything before trigger word */ | 877 | /* must flush early everything before trigger word */ |
876 | ipath_flush_wc(); | 878 | ipath_flush_wc(); |
877 | __raw_writel(last, piobuf); | 879 | __raw_writel(last, piobuf); |
878 | /* be sure trigger word is written */ | 880 | /* be sure trigger word is written */ |
879 | ipath_flush_wc(); | 881 | ipath_flush_wc(); |
880 | update_sge(ss, length); | ||
881 | } | 882 | } |
882 | 883 | ||
883 | /** | 884 | /** |
@@ -943,17 +944,18 @@ int ipath_verbs_send(struct ipath_devdata *dd, u32 hdrwords, | |||
943 | if (likely(ss->num_sge == 1 && len <= ss->sge.length && | 944 | if (likely(ss->num_sge == 1 && len <= ss->sge.length && |
944 | !((unsigned long)ss->sge.vaddr & (sizeof(u32) - 1)))) { | 945 | !((unsigned long)ss->sge.vaddr & (sizeof(u32) - 1)))) { |
945 | u32 w; | 946 | u32 w; |
947 | u32 *addr = (u32 *) ss->sge.vaddr; | ||
946 | 948 | ||
949 | /* Update address before sending packet. */ | ||
950 | update_sge(ss, len); | ||
947 | /* Need to round up for the last dword in the packet. */ | 951 | /* Need to round up for the last dword in the packet. */ |
948 | w = (len + 3) >> 2; | 952 | w = (len + 3) >> 2; |
949 | __iowrite32_copy(piobuf, ss->sge.vaddr, w - 1); | 953 | __iowrite32_copy(piobuf, addr, w - 1); |
950 | /* must flush early everything before trigger word */ | 954 | /* must flush early everything before trigger word */ |
951 | ipath_flush_wc(); | 955 | ipath_flush_wc(); |
952 | __raw_writel(((u32 *) ss->sge.vaddr)[w - 1], | 956 | __raw_writel(addr[w - 1], piobuf + w - 1); |
953 | piobuf + w - 1); | ||
954 | /* be sure trigger word is written */ | 957 | /* be sure trigger word is written */ |
955 | ipath_flush_wc(); | 958 | ipath_flush_wc(); |
956 | update_sge(ss, len); | ||
957 | ret = 0; | 959 | ret = 0; |
958 | goto bail; | 960 | goto bail; |
959 | } | 961 | } |
diff --git a/drivers/infiniband/hw/ipath/ipath_pe800.c b/drivers/infiniband/hw/ipath/ipath_pe800.c index 6318067ab5ec..02e8c75b24f6 100644 --- a/drivers/infiniband/hw/ipath/ipath_pe800.c +++ b/drivers/infiniband/hw/ipath/ipath_pe800.c | |||
@@ -1180,6 +1180,8 @@ static int ipath_pe_early_init(struct ipath_devdata *dd) | |||
1180 | */ | 1180 | */ |
1181 | dd->ipath_rhdrhead_intr_off = 1ULL<<32; | 1181 | dd->ipath_rhdrhead_intr_off = 1ULL<<32; |
1182 | 1182 | ||
1183 | ipath_get_eeprom_info(dd); | ||
1184 | |||
1183 | return 0; | 1185 | return 0; |
1184 | } | 1186 | } |
1185 | 1187 | ||
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c index 18890716db1e..9f8855d970c8 100644 --- a/drivers/infiniband/hw/ipath/ipath_qp.c +++ b/drivers/infiniband/hw/ipath/ipath_qp.c | |||
@@ -375,10 +375,10 @@ static void ipath_error_qp(struct ipath_qp *qp) | |||
375 | 375 | ||
376 | spin_lock(&dev->pending_lock); | 376 | spin_lock(&dev->pending_lock); |
377 | /* XXX What if its already removed by the timeout code? */ | 377 | /* XXX What if its already removed by the timeout code? */ |
378 | if (qp->timerwait.next != LIST_POISON1) | 378 | if (!list_empty(&qp->timerwait)) |
379 | list_del(&qp->timerwait); | 379 | list_del_init(&qp->timerwait); |
380 | if (qp->piowait.next != LIST_POISON1) | 380 | if (!list_empty(&qp->piowait)) |
381 | list_del(&qp->piowait); | 381 | list_del_init(&qp->piowait); |
382 | spin_unlock(&dev->pending_lock); | 382 | spin_unlock(&dev->pending_lock); |
383 | 383 | ||
384 | wc.status = IB_WC_WR_FLUSH_ERR; | 384 | wc.status = IB_WC_WR_FLUSH_ERR; |
@@ -427,6 +427,7 @@ static void ipath_error_qp(struct ipath_qp *qp) | |||
427 | int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | 427 | int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, |
428 | int attr_mask) | 428 | int attr_mask) |
429 | { | 429 | { |
430 | struct ipath_ibdev *dev = to_idev(ibqp->device); | ||
430 | struct ipath_qp *qp = to_iqp(ibqp); | 431 | struct ipath_qp *qp = to_iqp(ibqp); |
431 | enum ib_qp_state cur_state, new_state; | 432 | enum ib_qp_state cur_state, new_state; |
432 | unsigned long flags; | 433 | unsigned long flags; |
@@ -443,6 +444,19 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
443 | attr_mask)) | 444 | attr_mask)) |
444 | goto inval; | 445 | goto inval; |
445 | 446 | ||
447 | if (attr_mask & IB_QP_AV) | ||
448 | if (attr->ah_attr.dlid == 0 || | ||
449 | attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE) | ||
450 | goto inval; | ||
451 | |||
452 | if (attr_mask & IB_QP_PKEY_INDEX) | ||
453 | if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd)) | ||
454 | goto inval; | ||
455 | |||
456 | if (attr_mask & IB_QP_MIN_RNR_TIMER) | ||
457 | if (attr->min_rnr_timer > 31) | ||
458 | goto inval; | ||
459 | |||
446 | switch (new_state) { | 460 | switch (new_state) { |
447 | case IB_QPS_RESET: | 461 | case IB_QPS_RESET: |
448 | ipath_reset_qp(qp); | 462 | ipath_reset_qp(qp); |
@@ -457,13 +471,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
457 | 471 | ||
458 | } | 472 | } |
459 | 473 | ||
460 | if (attr_mask & IB_QP_PKEY_INDEX) { | 474 | if (attr_mask & IB_QP_PKEY_INDEX) |
461 | struct ipath_ibdev *dev = to_idev(ibqp->device); | ||
462 | |||
463 | if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd)) | ||
464 | goto inval; | ||
465 | qp->s_pkey_index = attr->pkey_index; | 475 | qp->s_pkey_index = attr->pkey_index; |
466 | } | ||
467 | 476 | ||
468 | if (attr_mask & IB_QP_DEST_QPN) | 477 | if (attr_mask & IB_QP_DEST_QPN) |
469 | qp->remote_qpn = attr->dest_qp_num; | 478 | qp->remote_qpn = attr->dest_qp_num; |
@@ -479,12 +488,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
479 | if (attr_mask & IB_QP_ACCESS_FLAGS) | 488 | if (attr_mask & IB_QP_ACCESS_FLAGS) |
480 | qp->qp_access_flags = attr->qp_access_flags; | 489 | qp->qp_access_flags = attr->qp_access_flags; |
481 | 490 | ||
482 | if (attr_mask & IB_QP_AV) { | 491 | if (attr_mask & IB_QP_AV) |
483 | if (attr->ah_attr.dlid == 0 || | ||
484 | attr->ah_attr.dlid >= IPS_MULTICAST_LID_BASE) | ||
485 | goto inval; | ||
486 | qp->remote_ah_attr = attr->ah_attr; | 492 | qp->remote_ah_attr = attr->ah_attr; |
487 | } | ||
488 | 493 | ||
489 | if (attr_mask & IB_QP_PATH_MTU) | 494 | if (attr_mask & IB_QP_PATH_MTU) |
490 | qp->path_mtu = attr->path_mtu; | 495 | qp->path_mtu = attr->path_mtu; |
@@ -499,11 +504,8 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, | |||
499 | qp->s_rnr_retry_cnt = qp->s_rnr_retry; | 504 | qp->s_rnr_retry_cnt = qp->s_rnr_retry; |
500 | } | 505 | } |
501 | 506 | ||
502 | if (attr_mask & IB_QP_MIN_RNR_TIMER) { | 507 | if (attr_mask & IB_QP_MIN_RNR_TIMER) |
503 | if (attr->min_rnr_timer > 31) | ||
504 | goto inval; | ||
505 | qp->s_min_rnr_timer = attr->min_rnr_timer; | 508 | qp->s_min_rnr_timer = attr->min_rnr_timer; |
506 | } | ||
507 | 509 | ||
508 | if (attr_mask & IB_QP_QKEY) | 510 | if (attr_mask & IB_QP_QKEY) |
509 | qp->qkey = attr->qkey; | 511 | qp->qkey = attr->qkey; |
@@ -710,10 +712,8 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, | |||
710 | init_attr->qp_type == IB_QPT_RC ? | 712 | init_attr->qp_type == IB_QPT_RC ? |
711 | ipath_do_rc_send : ipath_do_uc_send, | 713 | ipath_do_rc_send : ipath_do_uc_send, |
712 | (unsigned long)qp); | 714 | (unsigned long)qp); |
713 | qp->piowait.next = LIST_POISON1; | 715 | INIT_LIST_HEAD(&qp->piowait); |
714 | qp->piowait.prev = LIST_POISON2; | 716 | INIT_LIST_HEAD(&qp->timerwait); |
715 | qp->timerwait.next = LIST_POISON1; | ||
716 | qp->timerwait.prev = LIST_POISON2; | ||
717 | qp->state = IB_QPS_RESET; | 717 | qp->state = IB_QPS_RESET; |
718 | qp->s_wq = swq; | 718 | qp->s_wq = swq; |
719 | qp->s_size = init_attr->cap.max_send_wr + 1; | 719 | qp->s_size = init_attr->cap.max_send_wr + 1; |
@@ -734,7 +734,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd, | |||
734 | ipath_reset_qp(qp); | 734 | ipath_reset_qp(qp); |
735 | 735 | ||
736 | /* Tell the core driver that the kernel SMA is present. */ | 736 | /* Tell the core driver that the kernel SMA is present. */ |
737 | if (qp->ibqp.qp_type == IB_QPT_SMI) | 737 | if (init_attr->qp_type == IB_QPT_SMI) |
738 | ipath_layer_set_verbs_flags(dev->dd, | 738 | ipath_layer_set_verbs_flags(dev->dd, |
739 | IPATH_VERBS_KERNEL_SMA); | 739 | IPATH_VERBS_KERNEL_SMA); |
740 | break; | 740 | break; |
@@ -783,10 +783,10 @@ int ipath_destroy_qp(struct ib_qp *ibqp) | |||
783 | 783 | ||
784 | /* Make sure the QP isn't on the timeout list. */ | 784 | /* Make sure the QP isn't on the timeout list. */ |
785 | spin_lock_irqsave(&dev->pending_lock, flags); | 785 | spin_lock_irqsave(&dev->pending_lock, flags); |
786 | if (qp->timerwait.next != LIST_POISON1) | 786 | if (!list_empty(&qp->timerwait)) |
787 | list_del(&qp->timerwait); | 787 | list_del_init(&qp->timerwait); |
788 | if (qp->piowait.next != LIST_POISON1) | 788 | if (!list_empty(&qp->piowait)) |
789 | list_del(&qp->piowait); | 789 | list_del_init(&qp->piowait); |
790 | spin_unlock_irqrestore(&dev->pending_lock, flags); | 790 | spin_unlock_irqrestore(&dev->pending_lock, flags); |
791 | 791 | ||
792 | /* | 792 | /* |
@@ -855,10 +855,10 @@ void ipath_sqerror_qp(struct ipath_qp *qp, struct ib_wc *wc) | |||
855 | 855 | ||
856 | spin_lock(&dev->pending_lock); | 856 | spin_lock(&dev->pending_lock); |
857 | /* XXX What if its already removed by the timeout code? */ | 857 | /* XXX What if its already removed by the timeout code? */ |
858 | if (qp->timerwait.next != LIST_POISON1) | 858 | if (!list_empty(&qp->timerwait)) |
859 | list_del(&qp->timerwait); | 859 | list_del_init(&qp->timerwait); |
860 | if (qp->piowait.next != LIST_POISON1) | 860 | if (!list_empty(&qp->piowait)) |
861 | list_del(&qp->piowait); | 861 | list_del_init(&qp->piowait); |
862 | spin_unlock(&dev->pending_lock); | 862 | spin_unlock(&dev->pending_lock); |
863 | 863 | ||
864 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1); | 864 | ipath_cq_enter(to_icq(qp->ibqp.send_cq), wc, 1); |
diff --git a/drivers/infiniband/hw/ipath/ipath_rc.c b/drivers/infiniband/hw/ipath/ipath_rc.c index a4055ca00614..493b1821a934 100644 --- a/drivers/infiniband/hw/ipath/ipath_rc.c +++ b/drivers/infiniband/hw/ipath/ipath_rc.c | |||
@@ -57,7 +57,7 @@ static void ipath_init_restart(struct ipath_qp *qp, struct ipath_swqe *wqe) | |||
57 | qp->s_len = wqe->length - len; | 57 | qp->s_len = wqe->length - len; |
58 | dev = to_idev(qp->ibqp.device); | 58 | dev = to_idev(qp->ibqp.device); |
59 | spin_lock(&dev->pending_lock); | 59 | spin_lock(&dev->pending_lock); |
60 | if (qp->timerwait.next == LIST_POISON1) | 60 | if (list_empty(&qp->timerwait)) |
61 | list_add_tail(&qp->timerwait, | 61 | list_add_tail(&qp->timerwait, |
62 | &dev->pending[dev->pending_index]); | 62 | &dev->pending[dev->pending_index]); |
63 | spin_unlock(&dev->pending_lock); | 63 | spin_unlock(&dev->pending_lock); |
@@ -356,7 +356,7 @@ static inline int ipath_make_rc_req(struct ipath_qp *qp, | |||
356 | if ((int)(qp->s_psn - qp->s_next_psn) > 0) | 356 | if ((int)(qp->s_psn - qp->s_next_psn) > 0) |
357 | qp->s_next_psn = qp->s_psn; | 357 | qp->s_next_psn = qp->s_psn; |
358 | spin_lock(&dev->pending_lock); | 358 | spin_lock(&dev->pending_lock); |
359 | if (qp->timerwait.next == LIST_POISON1) | 359 | if (list_empty(&qp->timerwait)) |
360 | list_add_tail(&qp->timerwait, | 360 | list_add_tail(&qp->timerwait, |
361 | &dev->pending[dev->pending_index]); | 361 | &dev->pending[dev->pending_index]); |
362 | spin_unlock(&dev->pending_lock); | 362 | spin_unlock(&dev->pending_lock); |
@@ -726,8 +726,8 @@ void ipath_restart_rc(struct ipath_qp *qp, u32 psn, struct ib_wc *wc) | |||
726 | */ | 726 | */ |
727 | dev = to_idev(qp->ibqp.device); | 727 | dev = to_idev(qp->ibqp.device); |
728 | spin_lock(&dev->pending_lock); | 728 | spin_lock(&dev->pending_lock); |
729 | if (qp->timerwait.next != LIST_POISON1) | 729 | if (!list_empty(&qp->timerwait)) |
730 | list_del(&qp->timerwait); | 730 | list_del_init(&qp->timerwait); |
731 | spin_unlock(&dev->pending_lock); | 731 | spin_unlock(&dev->pending_lock); |
732 | 732 | ||
733 | if (wqe->wr.opcode == IB_WR_RDMA_READ) | 733 | if (wqe->wr.opcode == IB_WR_RDMA_READ) |
@@ -886,8 +886,8 @@ static int do_rc_ack(struct ipath_qp *qp, u32 aeth, u32 psn, int opcode) | |||
886 | * just won't find anything to restart if we ACK everything. | 886 | * just won't find anything to restart if we ACK everything. |
887 | */ | 887 | */ |
888 | spin_lock(&dev->pending_lock); | 888 | spin_lock(&dev->pending_lock); |
889 | if (qp->timerwait.next != LIST_POISON1) | 889 | if (!list_empty(&qp->timerwait)) |
890 | list_del(&qp->timerwait); | 890 | list_del_init(&qp->timerwait); |
891 | spin_unlock(&dev->pending_lock); | 891 | spin_unlock(&dev->pending_lock); |
892 | 892 | ||
893 | /* | 893 | /* |
@@ -1194,8 +1194,7 @@ static inline void ipath_rc_rcv_resp(struct ipath_ibdev *dev, | |||
1194 | IB_WR_RDMA_READ)) | 1194 | IB_WR_RDMA_READ)) |
1195 | goto ack_done; | 1195 | goto ack_done; |
1196 | spin_lock(&dev->pending_lock); | 1196 | spin_lock(&dev->pending_lock); |
1197 | if (qp->s_rnr_timeout == 0 && | 1197 | if (qp->s_rnr_timeout == 0 && !list_empty(&qp->timerwait)) |
1198 | qp->timerwait.next != LIST_POISON1) | ||
1199 | list_move_tail(&qp->timerwait, | 1198 | list_move_tail(&qp->timerwait, |
1200 | &dev->pending[dev->pending_index]); | 1199 | &dev->pending[dev->pending_index]); |
1201 | spin_unlock(&dev->pending_lock); | 1200 | spin_unlock(&dev->pending_lock); |
diff --git a/drivers/infiniband/hw/ipath/ipath_ruc.c b/drivers/infiniband/hw/ipath/ipath_ruc.c index eb81424b3c5b..d38f4f3cfd1d 100644 --- a/drivers/infiniband/hw/ipath/ipath_ruc.c +++ b/drivers/infiniband/hw/ipath/ipath_ruc.c | |||
@@ -435,7 +435,7 @@ void ipath_no_bufs_available(struct ipath_qp *qp, struct ipath_ibdev *dev) | |||
435 | unsigned long flags; | 435 | unsigned long flags; |
436 | 436 | ||
437 | spin_lock_irqsave(&dev->pending_lock, flags); | 437 | spin_lock_irqsave(&dev->pending_lock, flags); |
438 | if (qp->piowait.next == LIST_POISON1) | 438 | if (list_empty(&qp->piowait)) |
439 | list_add_tail(&qp->piowait, &dev->piowait); | 439 | list_add_tail(&qp->piowait, &dev->piowait); |
440 | spin_unlock_irqrestore(&dev->pending_lock, flags); | 440 | spin_unlock_irqrestore(&dev->pending_lock, flags); |
441 | /* | 441 | /* |
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c index cb9e387c301f..28fdbdaa789d 100644 --- a/drivers/infiniband/hw/ipath/ipath_verbs.c +++ b/drivers/infiniband/hw/ipath/ipath_verbs.c | |||
@@ -464,7 +464,7 @@ static void ipath_ib_timer(void *arg) | |||
464 | last = &dev->pending[dev->pending_index]; | 464 | last = &dev->pending[dev->pending_index]; |
465 | while (!list_empty(last)) { | 465 | while (!list_empty(last)) { |
466 | qp = list_entry(last->next, struct ipath_qp, timerwait); | 466 | qp = list_entry(last->next, struct ipath_qp, timerwait); |
467 | list_del(&qp->timerwait); | 467 | list_del_init(&qp->timerwait); |
468 | qp->timer_next = resend; | 468 | qp->timer_next = resend; |
469 | resend = qp; | 469 | resend = qp; |
470 | atomic_inc(&qp->refcount); | 470 | atomic_inc(&qp->refcount); |
@@ -474,7 +474,7 @@ static void ipath_ib_timer(void *arg) | |||
474 | qp = list_entry(last->next, struct ipath_qp, timerwait); | 474 | qp = list_entry(last->next, struct ipath_qp, timerwait); |
475 | if (--qp->s_rnr_timeout == 0) { | 475 | if (--qp->s_rnr_timeout == 0) { |
476 | do { | 476 | do { |
477 | list_del(&qp->timerwait); | 477 | list_del_init(&qp->timerwait); |
478 | tasklet_hi_schedule(&qp->s_task); | 478 | tasklet_hi_schedule(&qp->s_task); |
479 | if (list_empty(last)) | 479 | if (list_empty(last)) |
480 | break; | 480 | break; |
@@ -554,7 +554,7 @@ static int ipath_ib_piobufavail(void *arg) | |||
554 | while (!list_empty(&dev->piowait)) { | 554 | while (!list_empty(&dev->piowait)) { |
555 | qp = list_entry(dev->piowait.next, struct ipath_qp, | 555 | qp = list_entry(dev->piowait.next, struct ipath_qp, |
556 | piowait); | 556 | piowait); |
557 | list_del(&qp->piowait); | 557 | list_del_init(&qp->piowait); |
558 | tasklet_hi_schedule(&qp->s_task); | 558 | tasklet_hi_schedule(&qp->s_task); |
559 | } | 559 | } |
560 | spin_unlock_irqrestore(&dev->pending_lock, flags); | 560 | spin_unlock_irqrestore(&dev->pending_lock, flags); |
@@ -951,6 +951,7 @@ static void *ipath_register_ib_device(int unit, struct ipath_devdata *dd) | |||
951 | idev->dd = dd; | 951 | idev->dd = dd; |
952 | 952 | ||
953 | strlcpy(dev->name, "ipath%d", IB_DEVICE_NAME_MAX); | 953 | strlcpy(dev->name, "ipath%d", IB_DEVICE_NAME_MAX); |
954 | dev->owner = THIS_MODULE; | ||
954 | dev->node_guid = ipath_layer_get_guid(dd); | 955 | dev->node_guid = ipath_layer_get_guid(dd); |
955 | dev->uverbs_abi_ver = IPATH_UVERBS_ABI_VERSION; | 956 | dev->uverbs_abi_ver = IPATH_UVERBS_ABI_VERSION; |
956 | dev->uverbs_cmd_mask = | 957 | dev->uverbs_cmd_mask = |
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index 1ea433291fa7..b292fefa3b41 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c | |||
@@ -490,26 +490,7 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, | |||
490 | 490 | ||
491 | first_ind = srq->first_free; | 491 | first_ind = srq->first_free; |
492 | 492 | ||
493 | for (nreq = 0; wr; ++nreq, wr = wr->next) { | 493 | for (nreq = 0; wr; wr = wr->next) { |
494 | if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { | ||
495 | nreq = 0; | ||
496 | |||
497 | doorbell[0] = cpu_to_be32(first_ind << srq->wqe_shift); | ||
498 | doorbell[1] = cpu_to_be32(srq->srqn << 8); | ||
499 | |||
500 | /* | ||
501 | * Make sure that descriptors are written | ||
502 | * before doorbell is rung. | ||
503 | */ | ||
504 | wmb(); | ||
505 | |||
506 | mthca_write64(doorbell, | ||
507 | dev->kar + MTHCA_RECEIVE_DOORBELL, | ||
508 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | ||
509 | |||
510 | first_ind = srq->first_free; | ||
511 | } | ||
512 | |||
513 | ind = srq->first_free; | 494 | ind = srq->first_free; |
514 | 495 | ||
515 | if (ind < 0) { | 496 | if (ind < 0) { |
@@ -569,6 +550,26 @@ int mthca_tavor_post_srq_recv(struct ib_srq *ibsrq, struct ib_recv_wr *wr, | |||
569 | 550 | ||
570 | srq->wrid[ind] = wr->wr_id; | 551 | srq->wrid[ind] = wr->wr_id; |
571 | srq->first_free = next_ind; | 552 | srq->first_free = next_ind; |
553 | |||
554 | ++nreq; | ||
555 | if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { | ||
556 | nreq = 0; | ||
557 | |||
558 | doorbell[0] = cpu_to_be32(first_ind << srq->wqe_shift); | ||
559 | doorbell[1] = cpu_to_be32(srq->srqn << 8); | ||
560 | |||
561 | /* | ||
562 | * Make sure that descriptors are written | ||
563 | * before doorbell is rung. | ||
564 | */ | ||
565 | wmb(); | ||
566 | |||
567 | mthca_write64(doorbell, | ||
568 | dev->kar + MTHCA_RECEIVE_DOORBELL, | ||
569 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | ||
570 | |||
571 | first_ind = srq->first_free; | ||
572 | } | ||
572 | } | 573 | } |
573 | 574 | ||
574 | if (likely(nreq)) { | 575 | if (likely(nreq)) { |
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c index 2b2ec1057dee..95c0de7964a0 100644 --- a/drivers/input/joystick/sidewinder.c +++ b/drivers/input/joystick/sidewinder.c | |||
@@ -589,7 +589,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
589 | struct sw *sw; | 589 | struct sw *sw; |
590 | struct input_dev *input_dev; | 590 | struct input_dev *input_dev; |
591 | int i, j, k, l; | 591 | int i, j, k, l; |
592 | int err; | 592 | int err = 0; |
593 | unsigned char *buf = NULL; /* [SW_LENGTH] */ | 593 | unsigned char *buf = NULL; /* [SW_LENGTH] */ |
594 | unsigned char *idbuf = NULL; /* [SW_LENGTH] */ | 594 | unsigned char *idbuf = NULL; /* [SW_LENGTH] */ |
595 | unsigned char m = 1; | 595 | unsigned char m = 1; |
@@ -776,7 +776,10 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
776 | goto fail4; | 776 | goto fail4; |
777 | } | 777 | } |
778 | 778 | ||
779 | return 0; | 779 | out: kfree(buf); |
780 | kfree(idbuf); | ||
781 | |||
782 | return err; | ||
780 | 783 | ||
781 | fail4: input_free_device(sw->dev[i]); | 784 | fail4: input_free_device(sw->dev[i]); |
782 | fail3: while (--i >= 0) | 785 | fail3: while (--i >= 0) |
@@ -784,9 +787,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv) | |||
784 | fail2: gameport_close(gameport); | 787 | fail2: gameport_close(gameport); |
785 | fail1: gameport_set_drvdata(gameport, NULL); | 788 | fail1: gameport_set_drvdata(gameport, NULL); |
786 | kfree(sw); | 789 | kfree(sw); |
787 | kfree(buf); | 790 | goto out; |
788 | kfree(idbuf); | ||
789 | return err; | ||
790 | } | 791 | } |
791 | 792 | ||
792 | static void sw_disconnect(struct gameport *gameport) | 793 | static void sw_disconnect(struct gameport *gameport) |
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index 96c6bf77248a..1f0e720267d7 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c | |||
@@ -245,9 +245,9 @@ static void corgikbd_hinge_timer(unsigned long data) | |||
245 | if (hinge_count >= HINGE_STABLE_COUNT) { | 245 | if (hinge_count >= HINGE_STABLE_COUNT) { |
246 | spin_lock_irqsave(&corgikbd_data->lock, flags); | 246 | spin_lock_irqsave(&corgikbd_data->lock, flags); |
247 | 247 | ||
248 | input_report_switch(corgikbd_data->input, SW_0, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); | 248 | input_report_switch(corgikbd_data->input, SW_LID, ((sharpsl_hinge_state & CORGI_SCP_SWA) != 0)); |
249 | input_report_switch(corgikbd_data->input, SW_1, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); | 249 | input_report_switch(corgikbd_data->input, SW_TABLET_MODE, ((sharpsl_hinge_state & CORGI_SCP_SWB) != 0)); |
250 | input_report_switch(corgikbd_data->input, SW_2, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); | 250 | input_report_switch(corgikbd_data->input, SW_HEADPHONE_INSERT, (READ_GPIO_BIT(CORGI_GPIO_AK_INT) != 0)); |
251 | input_sync(corgikbd_data->input); | 251 | input_sync(corgikbd_data->input); |
252 | 252 | ||
253 | spin_unlock_irqrestore(&corgikbd_data->lock, flags); | 253 | spin_unlock_irqrestore(&corgikbd_data->lock, flags); |
@@ -340,9 +340,9 @@ static int __init corgikbd_probe(struct platform_device *pdev) | |||
340 | for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++) | 340 | for (i = 0; i < ARRAY_SIZE(corgikbd_keycode); i++) |
341 | set_bit(corgikbd->keycode[i], input_dev->keybit); | 341 | set_bit(corgikbd->keycode[i], input_dev->keybit); |
342 | clear_bit(0, input_dev->keybit); | 342 | clear_bit(0, input_dev->keybit); |
343 | set_bit(SW_0, input_dev->swbit); | 343 | set_bit(SW_LID, input_dev->swbit); |
344 | set_bit(SW_1, input_dev->swbit); | 344 | set_bit(SW_TABLET_MODE, input_dev->swbit); |
345 | set_bit(SW_2, input_dev->swbit); | 345 | set_bit(SW_HEADPHONE_INSERT, input_dev->swbit); |
346 | 346 | ||
347 | input_register_device(corgikbd->input); | 347 | input_register_device(corgikbd->input); |
348 | 348 | ||
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index 1d238a9d52d6..c5d03fb77bcb 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c | |||
@@ -299,9 +299,9 @@ static void spitzkbd_hinge_timer(unsigned long data) | |||
299 | if (hinge_count >= HINGE_STABLE_COUNT) { | 299 | if (hinge_count >= HINGE_STABLE_COUNT) { |
300 | spin_lock_irqsave(&spitzkbd_data->lock, flags); | 300 | spin_lock_irqsave(&spitzkbd_data->lock, flags); |
301 | 301 | ||
302 | input_report_switch(spitzkbd_data->input, SW_0, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); | 302 | input_report_switch(spitzkbd_data->input, SW_LID, ((GPLR(SPITZ_GPIO_SWA) & GPIO_bit(SPITZ_GPIO_SWA)) != 0)); |
303 | input_report_switch(spitzkbd_data->input, SW_1, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); | 303 | input_report_switch(spitzkbd_data->input, SW_TABLET_MODE, ((GPLR(SPITZ_GPIO_SWB) & GPIO_bit(SPITZ_GPIO_SWB)) != 0)); |
304 | input_report_switch(spitzkbd_data->input, SW_2, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); | 304 | input_report_switch(spitzkbd_data->input, SW_HEADPHONE_INSERT, ((GPLR(SPITZ_GPIO_AK_INT) & GPIO_bit(SPITZ_GPIO_AK_INT)) != 0)); |
305 | input_sync(spitzkbd_data->input); | 305 | input_sync(spitzkbd_data->input); |
306 | 306 | ||
307 | spin_unlock_irqrestore(&spitzkbd_data->lock, flags); | 307 | spin_unlock_irqrestore(&spitzkbd_data->lock, flags); |
@@ -398,9 +398,9 @@ static int __init spitzkbd_probe(struct platform_device *dev) | |||
398 | for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++) | 398 | for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++) |
399 | set_bit(spitzkbd->keycode[i], input_dev->keybit); | 399 | set_bit(spitzkbd->keycode[i], input_dev->keybit); |
400 | clear_bit(0, input_dev->keybit); | 400 | clear_bit(0, input_dev->keybit); |
401 | set_bit(SW_0, input_dev->swbit); | 401 | set_bit(SW_LID, input_dev->swbit); |
402 | set_bit(SW_1, input_dev->swbit); | 402 | set_bit(SW_TABLET_MODE, input_dev->swbit); |
403 | set_bit(SW_2, input_dev->swbit); | 403 | set_bit(SW_HEADPHONE_INSERT, input_dev->swbit); |
404 | 404 | ||
405 | input_register_device(input_dev); | 405 | input_register_device(input_dev); |
406 | 406 | ||
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c index 36cd2e07fce8..e4e5be111c96 100644 --- a/drivers/input/misc/wistron_btns.c +++ b/drivers/input/misc/wistron_btns.c | |||
@@ -318,6 +318,16 @@ static struct key_entry keymap_acer_travelmate_240[] = { | |||
318 | { KE_END, 0 } | 318 | { KE_END, 0 } |
319 | }; | 319 | }; |
320 | 320 | ||
321 | static struct key_entry keymap_aopen_1559as[] = { | ||
322 | { KE_KEY, 0x01, KEY_HELP }, | ||
323 | { KE_KEY, 0x06, KEY_PROG3 }, | ||
324 | { KE_KEY, 0x11, KEY_PROG1 }, | ||
325 | { KE_KEY, 0x12, KEY_PROG2 }, | ||
326 | { KE_WIFI, 0x30, 0 }, | ||
327 | { KE_KEY, 0x31, KEY_MAIL }, | ||
328 | { KE_KEY, 0x36, KEY_WWW }, | ||
329 | }; | ||
330 | |||
321 | /* | 331 | /* |
322 | * If your machine is not here (which is currently rather likely), please send | 332 | * If your machine is not here (which is currently rather likely), please send |
323 | * a list of buttons and their key codes (reported when loading this module | 333 | * a list of buttons and their key codes (reported when loading this module |
@@ -369,6 +379,15 @@ static struct dmi_system_id dmi_ids[] = { | |||
369 | }, | 379 | }, |
370 | .driver_data = keymap_acer_travelmate_240 | 380 | .driver_data = keymap_acer_travelmate_240 |
371 | }, | 381 | }, |
382 | { | ||
383 | .callback = dmi_matched, | ||
384 | .ident = "AOpen 1559AS", | ||
385 | .matches = { | ||
386 | DMI_MATCH(DMI_PRODUCT_NAME, "E2U"), | ||
387 | DMI_MATCH(DMI_BOARD_NAME, "E2U"), | ||
388 | }, | ||
389 | .driver_data = keymap_aopen_1559as | ||
390 | }, | ||
372 | { NULL, } | 391 | { NULL, } |
373 | }; | 392 | }; |
374 | 393 | ||
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 2141501e9f2e..a0e2e797c6d5 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -100,8 +100,8 @@ static void alps_process_packet(struct psmouse *psmouse, struct pt_regs *regs) | |||
100 | } | 100 | } |
101 | 101 | ||
102 | if (priv->i->flags & ALPS_OLDPROTO) { | 102 | if (priv->i->flags & ALPS_OLDPROTO) { |
103 | left = packet[2] & 0x08; | 103 | left = packet[2] & 0x10; |
104 | right = packet[2] & 0x10; | 104 | right = packet[2] & 0x08; |
105 | middle = 0; | 105 | middle = 0; |
106 | x = packet[1] | ((packet[0] & 0x07) << 7); | 106 | x = packet[1] | ((packet[0] & 0x07) << 7); |
107 | y = packet[4] | ((packet[3] & 0x07) << 7); | 107 | y = packet[4] | ((packet[3] & 0x07) << 7); |
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 5ccc3ef3b89e..c14395ba7980 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
@@ -22,12 +22,36 @@ | |||
22 | 22 | ||
23 | static struct dmi_system_id lifebook_dmi_table[] = { | 23 | static struct dmi_system_id lifebook_dmi_table[] = { |
24 | { | 24 | { |
25 | .ident = "LifeBook B", | ||
26 | .matches = { | ||
27 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B Series"), | ||
28 | }, | ||
29 | }, | ||
30 | { | ||
25 | .ident = "Lifebook B", | 31 | .ident = "Lifebook B", |
26 | .matches = { | 32 | .matches = { |
27 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), | 33 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"), |
28 | }, | 34 | }, |
29 | }, | 35 | }, |
30 | { | 36 | { |
37 | .ident = "Lifebook B213x/B2150", | ||
38 | .matches = { | ||
39 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B2131/B2133/B2150"), | ||
40 | }, | ||
41 | }, | ||
42 | { | ||
43 | .ident = "Zephyr", | ||
44 | .matches = { | ||
45 | DMI_MATCH(DMI_PRODUCT_NAME, "ZEPHYR"), | ||
46 | }, | ||
47 | }, | ||
48 | { | ||
49 | .ident = "CF-18", | ||
50 | .matches = { | ||
51 | DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), | ||
52 | }, | ||
53 | }, | ||
54 | { | ||
31 | .ident = "Lifebook B142", | 55 | .ident = "Lifebook B142", |
32 | .matches = { | 56 | .matches = { |
33 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), | 57 | DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook B142"), |
diff --git a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c index 40333d61093c..2f0d28840810 100644 --- a/drivers/input/mouse/logips2pp.c +++ b/drivers/input/mouse/logips2pp.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #define PS2PP_KIND_WHEEL 1 | 19 | #define PS2PP_KIND_WHEEL 1 |
20 | #define PS2PP_KIND_MX 2 | 20 | #define PS2PP_KIND_MX 2 |
21 | #define PS2PP_KIND_TP3 3 | 21 | #define PS2PP_KIND_TP3 3 |
22 | #define PS2PP_KIND_TRACKMAN 4 | ||
22 | 23 | ||
23 | /* Logitech mouse features */ | 24 | /* Logitech mouse features */ |
24 | #define PS2PP_WHEEL 0x01 | 25 | #define PS2PP_WHEEL 0x01 |
@@ -223,6 +224,7 @@ static struct ps2pp_info *get_model_info(unsigned char model) | |||
223 | { 73, 0, PS2PP_SIDE_BTN }, | 224 | { 73, 0, PS2PP_SIDE_BTN }, |
224 | { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 225 | { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
225 | { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 226 | { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
227 | { 79, PS2PP_KIND_TRACKMAN, PS2PP_WHEEL }, /* TrackMan with wheel */ | ||
226 | { 80, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, | 228 | { 80, PS2PP_KIND_WHEEL, PS2PP_SIDE_BTN | PS2PP_WHEEL }, |
227 | { 81, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 229 | { 81, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
228 | { 83, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, | 230 | { 83, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, |
@@ -298,6 +300,10 @@ static void ps2pp_set_model_properties(struct psmouse *psmouse, struct ps2pp_inf | |||
298 | psmouse->name = "TouchPad 3"; | 300 | psmouse->name = "TouchPad 3"; |
299 | break; | 301 | break; |
300 | 302 | ||
303 | case PS2PP_KIND_TRACKMAN: | ||
304 | psmouse->name = "TrackMan"; | ||
305 | break; | ||
306 | |||
301 | default: | 307 | default: |
302 | /* | 308 | /* |
303 | * Set name to "Mouse" only when using PS2++, | 309 | * Set name to "Mouse" only when using PS2++, |
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 1494175ac6fe..161afddd0f44 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -36,13 +36,10 @@ | |||
36 | 36 | ||
37 | 37 | ||
38 | /* | 38 | /* |
39 | * This code has been tested on an ads7846 / N770 device. | 39 | * This code has been heavily tested on a Nokia 770, and lightly |
40 | * tested on other ads7846 devices (OSK/Mistral, Lubbock). | ||
40 | * Support for ads7843 and ads7845 has only been stubbed in. | 41 | * Support for ads7843 and ads7845 has only been stubbed in. |
41 | * | 42 | * |
42 | * Not yet done: How accurate are the temperature and voltage | ||
43 | * readings? (System-specific calibration should support | ||
44 | * accuracy of 0.3 degrees C; otherwise it's 2.0 degrees.) | ||
45 | * | ||
46 | * IRQ handling needs a workaround because of a shortcoming in handling | 43 | * IRQ handling needs a workaround because of a shortcoming in handling |
47 | * edge triggered IRQs on some platforms like the OMAP1/2. These | 44 | * edge triggered IRQs on some platforms like the OMAP1/2. These |
48 | * platforms don't handle the ARM lazy IRQ disabling properly, thus we | 45 | * platforms don't handle the ARM lazy IRQ disabling properly, thus we |
@@ -248,10 +245,13 @@ static int ads7846_read12_ser(struct device *dev, unsigned command) | |||
248 | 245 | ||
249 | if (req->msg.status) | 246 | if (req->msg.status) |
250 | status = req->msg.status; | 247 | status = req->msg.status; |
248 | |||
249 | /* on-wire is a must-ignore bit, a BE12 value, then padding */ | ||
251 | sample = be16_to_cpu(req->sample); | 250 | sample = be16_to_cpu(req->sample); |
252 | sample = sample >> 4; | 251 | sample = sample >> 3; |
253 | kfree(req); | 252 | sample &= 0x0fff; |
254 | 253 | ||
254 | kfree(req); | ||
255 | return status ? status : sample; | 255 | return status ? status : sample; |
256 | } | 256 | } |
257 | 257 | ||
@@ -336,13 +336,13 @@ static void ads7846_rx(void *ads) | |||
336 | u16 x, y, z1, z2; | 336 | u16 x, y, z1, z2; |
337 | unsigned long flags; | 337 | unsigned long flags; |
338 | 338 | ||
339 | /* adjust: 12 bit samples (left aligned), built from | 339 | /* adjust: on-wire is a must-ignore bit, a BE12 value, then padding; |
340 | * two 8 bit values writen msb-first. | 340 | * built from two 8 bit values written msb-first. |
341 | */ | 341 | */ |
342 | x = be16_to_cpu(ts->tc.x) >> 4; | 342 | x = (be16_to_cpu(ts->tc.x) >> 3) & 0x0fff; |
343 | y = be16_to_cpu(ts->tc.y) >> 4; | 343 | y = (be16_to_cpu(ts->tc.y) >> 3) & 0x0fff; |
344 | z1 = be16_to_cpu(ts->tc.z1) >> 4; | 344 | z1 = (be16_to_cpu(ts->tc.z1) >> 3) & 0x0fff; |
345 | z2 = be16_to_cpu(ts->tc.z2) >> 4; | 345 | z2 = (be16_to_cpu(ts->tc.z2) >> 3) & 0x0fff; |
346 | 346 | ||
347 | /* range filtering */ | 347 | /* range filtering */ |
348 | if (x == MAX_12BIT) | 348 | if (x == MAX_12BIT) |
@@ -420,7 +420,7 @@ static void ads7846_debounce(void *ads) | |||
420 | 420 | ||
421 | m = &ts->msg[ts->msg_idx]; | 421 | m = &ts->msg[ts->msg_idx]; |
422 | t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list); | 422 | t = list_entry(m->transfers.prev, struct spi_transfer, transfer_list); |
423 | val = (*(u16 *)t->rx_buf) >> 3; | 423 | val = (be16_to_cpu(*(__be16 *)t->rx_buf) >> 3) & 0x0fff; |
424 | if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) { | 424 | if (!ts->read_cnt || (abs(ts->last_read - val) > ts->debounce_tol)) { |
425 | /* Repeat it, if this was the first read or the read | 425 | /* Repeat it, if this was the first read or the read |
426 | * wasn't consistent enough. */ | 426 | * wasn't consistent enough. */ |
@@ -469,7 +469,7 @@ static void ads7846_timer(unsigned long handle) | |||
469 | spin_lock_irq(&ts->lock); | 469 | spin_lock_irq(&ts->lock); |
470 | 470 | ||
471 | if (unlikely(ts->msg_idx && !ts->pendown)) { | 471 | if (unlikely(ts->msg_idx && !ts->pendown)) { |
472 | /* measurment cycle ended */ | 472 | /* measurement cycle ended */ |
473 | if (!device_suspended(&ts->spi->dev)) { | 473 | if (!device_suspended(&ts->spi->dev)) { |
474 | ts->irq_disabled = 0; | 474 | ts->irq_disabled = 0; |
475 | enable_irq(ts->spi->irq); | 475 | enable_irq(ts->spi->irq); |
@@ -495,11 +495,10 @@ static irqreturn_t ads7846_irq(int irq, void *handle, struct pt_regs *regs) | |||
495 | spin_lock_irqsave(&ts->lock, flags); | 495 | spin_lock_irqsave(&ts->lock, flags); |
496 | if (likely(ts->get_pendown_state())) { | 496 | if (likely(ts->get_pendown_state())) { |
497 | if (!ts->irq_disabled) { | 497 | if (!ts->irq_disabled) { |
498 | /* REVISIT irq logic for many ARM chips has cloned a | 498 | /* The ARM do_simple_IRQ() dispatcher doesn't act |
499 | * bug wherein disabling an irq in its handler won't | 499 | * like the other dispatchers: it will report IRQs |
500 | * work;(it's disabled lazily, and too late to work. | 500 | * even after they've been disabled. We work around |
501 | * until all their irq logic is fixed, we must shadow | 501 | * that here. (The "generic irq" framework may help...) |
502 | * that state here. | ||
503 | */ | 502 | */ |
504 | ts->irq_disabled = 1; | 503 | ts->irq_disabled = 1; |
505 | disable_irq(ts->spi->irq); | 504 | disable_irq(ts->spi->irq); |
@@ -609,16 +608,20 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
609 | return -EINVAL; | 608 | return -EINVAL; |
610 | } | 609 | } |
611 | 610 | ||
611 | /* REVISIT when the irq can be triggered active-low, or if for some | ||
612 | * reason the touchscreen isn't hooked up, we don't need to access | ||
613 | * the pendown state. | ||
614 | */ | ||
612 | if (pdata->get_pendown_state == NULL) { | 615 | if (pdata->get_pendown_state == NULL) { |
613 | dev_dbg(&spi->dev, "no get_pendown_state function?\n"); | 616 | dev_dbg(&spi->dev, "no get_pendown_state function?\n"); |
614 | return -EINVAL; | 617 | return -EINVAL; |
615 | } | 618 | } |
616 | 619 | ||
617 | /* We'd set the wordsize to 12 bits ... except that some controllers | 620 | /* We'd set TX wordsize 8 bits and RX wordsize to 13 bits ... except |
618 | * will then treat the 8 bit command words as 12 bits (and drop the | 621 | * that even if the hardware can do that, the SPI controller driver |
619 | * four MSBs of the 12 bit result). Result: inputs must be shifted | 622 | * may not. So we stick to very-portable 8 bit words, both RX and TX. |
620 | * to discard the four garbage LSBs. | ||
621 | */ | 623 | */ |
624 | spi->bits_per_word = 8; | ||
622 | 625 | ||
623 | ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL); | 626 | ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL); |
624 | input_dev = input_allocate_device(); | 627 | input_dev = input_allocate_device(); |
@@ -772,7 +775,7 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
772 | 775 | ||
773 | if (request_irq(spi->irq, ads7846_irq, | 776 | if (request_irq(spi->irq, ads7846_irq, |
774 | SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING, | 777 | SA_SAMPLE_RANDOM | SA_TRIGGER_FALLING, |
775 | spi->dev.bus_id, ts)) { | 778 | spi->dev.driver->name, ts)) { |
776 | dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); | 779 | dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); |
777 | err = -EBUSY; | 780 | err = -EBUSY; |
778 | goto err_free_mem; | 781 | goto err_free_mem; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 3ca3cfb03a7e..ec802913f977 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -5028,8 +5028,10 @@ static int md_notify_reboot(struct notifier_block *this, | |||
5028 | printk(KERN_INFO "md: stopping all md devices.\n"); | 5028 | printk(KERN_INFO "md: stopping all md devices.\n"); |
5029 | 5029 | ||
5030 | ITERATE_MDDEV(mddev,tmp) | 5030 | ITERATE_MDDEV(mddev,tmp) |
5031 | if (mddev_trylock(mddev)) | 5031 | if (mddev_trylock(mddev)) { |
5032 | do_md_stop (mddev, 1); | 5032 | do_md_stop (mddev, 1); |
5033 | mddev_unlock(mddev); | ||
5034 | } | ||
5033 | /* | 5035 | /* |
5034 | * certain more exotic SCSI devices are known to be | 5036 | * certain more exotic SCSI devices are known to be |
5035 | * volatile wrt too early system reboots. While the | 5037 | * volatile wrt too early system reboots. While the |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 678f4dbbea1d..cb8c6317e4e5 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -331,13 +331,14 @@ static int raid0_run (mddev_t *mddev) | |||
331 | goto out_free_conf; | 331 | goto out_free_conf; |
332 | size = conf->strip_zone[cur].size; | 332 | size = conf->strip_zone[cur].size; |
333 | 333 | ||
334 | for (i=0; i< nb_zone; i++) { | 334 | conf->hash_table[0] = conf->strip_zone + cur; |
335 | conf->hash_table[i] = conf->strip_zone + cur; | 335 | for (i=1; i< nb_zone; i++) { |
336 | while (size <= conf->hash_spacing) { | 336 | while (size <= conf->hash_spacing) { |
337 | cur++; | 337 | cur++; |
338 | size += conf->strip_zone[cur].size; | 338 | size += conf->strip_zone[cur].size; |
339 | } | 339 | } |
340 | size -= conf->hash_spacing; | 340 | size -= conf->hash_spacing; |
341 | conf->hash_table[i] = conf->strip_zone + cur; | ||
341 | } | 342 | } |
342 | if (conf->preshift) { | 343 | if (conf->preshift) { |
343 | conf->hash_spacing >>= conf->preshift; | 344 | conf->hash_spacing >>= conf->preshift; |
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig index fffc711c260c..344d83aae3ec 100644 --- a/drivers/media/Kconfig +++ b/drivers/media/Kconfig | |||
@@ -8,22 +8,54 @@ config VIDEO_DEV | |||
8 | tristate "Video For Linux" | 8 | tristate "Video For Linux" |
9 | ---help--- | 9 | ---help--- |
10 | Support for audio/video capture and overlay devices and FM radio | 10 | Support for audio/video capture and overlay devices and FM radio |
11 | cards. The exact capabilities of each device vary. User tools for | 11 | cards. The exact capabilities of each device vary. |
12 | this are available from | ||
13 | <ftp://ftp.uk.linux.org/pub/linux/video4linux/>. | ||
14 | 12 | ||
15 | This kernel includes support for the new Video for Linux Two API, | 13 | This kernel includes support for the new Video for Linux Two API, |
16 | (V4L2) as well as the original system. Drivers and applications | 14 | (V4L2) as well as the original system. Drivers and applications |
17 | need to be rewritten to use V4L2, but drivers for popular cards | 15 | need to be rewritten to use V4L2, but drivers for popular cards |
18 | and applications for most video capture functions already exist. | 16 | and applications for most video capture functions already exist. |
19 | 17 | ||
20 | Documentation for the original API is included in the file | 18 | Additional info and docs are available on the web at |
21 | <file:Documentation/video4linux/API.html>. Documentation for V4L2 is | 19 | <http://linuxtv.org> |
22 | available on the web at <http://bytesex.org/v4l/>. | 20 | |
21 | Documentation for V4L2 is also available on the web at | ||
22 | <http://bytesex.org/v4l/>. | ||
23 | 23 | ||
24 | To compile this driver as a module, choose M here: the | 24 | To compile this driver as a module, choose M here: the |
25 | module will be called videodev. | 25 | module will be called videodev. |
26 | 26 | ||
27 | config VIDEO_V4L1 | ||
28 | boolean "Enable Video For Linux API 1 (DEPRECATED)" | ||
29 | depends on VIDEO_DEV | ||
30 | select VIDEO_V4L1_COMPAT | ||
31 | default y | ||
32 | ---help--- | ||
33 | Enables a compatibility API used by most V4L2 devices to allow | ||
34 | its usage with legacy applications that supports only V4L1 api. | ||
35 | |||
36 | If you are unsure as to whether this is required, answer Y. | ||
37 | |||
38 | config VIDEO_V4L1_COMPAT | ||
39 | boolean "Enable Video For Linux API 1 compatible Layer" | ||
40 | depends on VIDEO_DEV | ||
41 | default y | ||
42 | ---help--- | ||
43 | This api were developed to be used at Kernel 2.2 and 2.4, but | ||
44 | lacks support for several video standards. There are several | ||
45 | drivers at kernel that still depends on it. | ||
46 | |||
47 | Documentation for the original API is included in the file | ||
48 | <Documentation/video4linux/API.html>. | ||
49 | |||
50 | User tools for this are available from | ||
51 | <ftp://ftp.uk.linux.org/pub/linux/video4linux/>. | ||
52 | |||
53 | If you are unsure as to whether this is required, answer Y. | ||
54 | |||
55 | config VIDEO_V4L2 | ||
56 | tristate | ||
57 | default y | ||
58 | |||
27 | source "drivers/media/video/Kconfig" | 59 | source "drivers/media/video/Kconfig" |
28 | 60 | ||
29 | source "drivers/media/radio/Kconfig" | 61 | source "drivers/media/radio/Kconfig" |
@@ -65,4 +97,3 @@ config USB_DABUSB | |||
65 | module will be called dabusb. | 97 | module will be called dabusb. |
66 | 98 | ||
67 | endmenu | 99 | endmenu |
68 | |||
diff --git a/drivers/media/common/Kconfig b/drivers/media/common/Kconfig index 6a901a0268e1..1a04db4552da 100644 --- a/drivers/media/common/Kconfig +++ b/drivers/media/common/Kconfig | |||
@@ -1,9 +1,10 @@ | |||
1 | config VIDEO_SAA7146 | 1 | config VIDEO_SAA7146 |
2 | tristate | 2 | tristate |
3 | select I2C | 3 | depends on I2C |
4 | 4 | ||
5 | config VIDEO_SAA7146_VV | 5 | config VIDEO_SAA7146_VV |
6 | tristate | 6 | tristate |
7 | select VIDEO_V4L2 | ||
7 | select VIDEO_BUF | 8 | select VIDEO_BUF |
8 | select VIDEO_VIDEOBUF | 9 | select VIDEO_VIDEOBUF |
9 | select VIDEO_SAA7146 | 10 | select VIDEO_SAA7146 |
diff --git a/drivers/media/dvb/Kconfig b/drivers/media/dvb/Kconfig index 3f0ec6be03ae..a97c8f5e9a5d 100644 --- a/drivers/media/dvb/Kconfig +++ b/drivers/media/dvb/Kconfig | |||
@@ -22,26 +22,26 @@ config DVB | |||
22 | source "drivers/media/dvb/dvb-core/Kconfig" | 22 | source "drivers/media/dvb/dvb-core/Kconfig" |
23 | 23 | ||
24 | comment "Supported SAA7146 based PCI Adapters" | 24 | comment "Supported SAA7146 based PCI Adapters" |
25 | depends on DVB_CORE && PCI | 25 | depends on DVB_CORE && PCI && I2C |
26 | source "drivers/media/dvb/ttpci/Kconfig" | 26 | source "drivers/media/dvb/ttpci/Kconfig" |
27 | 27 | ||
28 | comment "Supported USB Adapters" | 28 | comment "Supported USB Adapters" |
29 | depends on DVB_CORE && USB | 29 | depends on DVB_CORE && USB && I2C |
30 | source "drivers/media/dvb/dvb-usb/Kconfig" | 30 | source "drivers/media/dvb/dvb-usb/Kconfig" |
31 | source "drivers/media/dvb/ttusb-budget/Kconfig" | 31 | source "drivers/media/dvb/ttusb-budget/Kconfig" |
32 | source "drivers/media/dvb/ttusb-dec/Kconfig" | 32 | source "drivers/media/dvb/ttusb-dec/Kconfig" |
33 | source "drivers/media/dvb/cinergyT2/Kconfig" | 33 | source "drivers/media/dvb/cinergyT2/Kconfig" |
34 | 34 | ||
35 | comment "Supported FlexCopII (B2C2) Adapters" | 35 | comment "Supported FlexCopII (B2C2) Adapters" |
36 | depends on DVB_CORE && (PCI || USB) | 36 | depends on DVB_CORE && (PCI || USB) && I2C |
37 | source "drivers/media/dvb/b2c2/Kconfig" | 37 | source "drivers/media/dvb/b2c2/Kconfig" |
38 | 38 | ||
39 | comment "Supported BT878 Adapters" | 39 | comment "Supported BT878 Adapters" |
40 | depends on DVB_CORE && PCI | 40 | depends on DVB_CORE && PCI && I2C |
41 | source "drivers/media/dvb/bt8xx/Kconfig" | 41 | source "drivers/media/dvb/bt8xx/Kconfig" |
42 | 42 | ||
43 | comment "Supported Pluto2 Adapters" | 43 | comment "Supported Pluto2 Adapters" |
44 | depends on DVB_CORE && PCI | 44 | depends on DVB_CORE && PCI && I2C |
45 | source "drivers/media/dvb/pluto2/Kconfig" | 45 | source "drivers/media/dvb/pluto2/Kconfig" |
46 | 46 | ||
47 | comment "Supported DVB Frontends" | 47 | comment "Supported DVB Frontends" |
diff --git a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig index 2963605c0ecc..d7f1fd5b7b02 100644 --- a/drivers/media/dvb/b2c2/Kconfig +++ b/drivers/media/dvb/b2c2/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DVB_B2C2_FLEXCOP | 1 | config DVB_B2C2_FLEXCOP |
2 | tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters" | 2 | tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters" |
3 | depends on DVB_CORE | 3 | depends on DVB_CORE && I2C |
4 | select DVB_STV0299 | 4 | select DVB_STV0299 |
5 | select DVB_MT352 | 5 | select DVB_MT352 |
6 | select DVB_MT312 | 6 | select DVB_MT312 |
@@ -16,7 +16,7 @@ config DVB_B2C2_FLEXCOP | |||
16 | 16 | ||
17 | config DVB_B2C2_FLEXCOP_PCI | 17 | config DVB_B2C2_FLEXCOP_PCI |
18 | tristate "Technisat/B2C2 Air/Sky/Cable2PC PCI" | 18 | tristate "Technisat/B2C2 Air/Sky/Cable2PC PCI" |
19 | depends on DVB_B2C2_FLEXCOP && PCI | 19 | depends on DVB_B2C2_FLEXCOP && PCI && I2C |
20 | help | 20 | help |
21 | Support for the Air/Sky/CableStar2 PCI card (DVB/ATSC) by Technisat/B2C2. | 21 | Support for the Air/Sky/CableStar2 PCI card (DVB/ATSC) by Technisat/B2C2. |
22 | 22 | ||
@@ -24,7 +24,7 @@ config DVB_B2C2_FLEXCOP_PCI | |||
24 | 24 | ||
25 | config DVB_B2C2_FLEXCOP_USB | 25 | config DVB_B2C2_FLEXCOP_USB |
26 | tristate "Technisat/B2C2 Air/Sky/Cable2PC USB" | 26 | tristate "Technisat/B2C2 Air/Sky/Cable2PC USB" |
27 | depends on DVB_B2C2_FLEXCOP && USB | 27 | depends on DVB_B2C2_FLEXCOP && USB && I2C |
28 | help | 28 | help |
29 | Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2, | 29 | Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2, |
30 | 30 | ||
diff --git a/drivers/media/dvb/bt8xx/Kconfig b/drivers/media/dvb/bt8xx/Kconfig index 376ca48f1d1d..f394002118f8 100644 --- a/drivers/media/dvb/bt8xx/Kconfig +++ b/drivers/media/dvb/bt8xx/Kconfig | |||
@@ -1,12 +1,13 @@ | |||
1 | config DVB_BT8XX | 1 | config DVB_BT8XX |
2 | tristate "BT8xx based PCI cards" | 2 | tristate "BT8xx based PCI cards" |
3 | depends on DVB_CORE && PCI && VIDEO_BT848 | 3 | depends on DVB_CORE && PCI && I2C && VIDEO_BT848 |
4 | select DVB_MT352 | 4 | select DVB_MT352 |
5 | select DVB_SP887X | 5 | select DVB_SP887X |
6 | select DVB_NXT6000 | 6 | select DVB_NXT6000 |
7 | select DVB_CX24110 | 7 | select DVB_CX24110 |
8 | select DVB_OR51211 | 8 | select DVB_OR51211 |
9 | select DVB_LGDT330X | 9 | select DVB_LGDT330X |
10 | select DVB_ZL10353 | ||
10 | select FW_LOADER | 11 | select FW_LOADER |
11 | help | 12 | help |
12 | Support for PCI cards based on the Bt8xx PCI bridge. Examples are | 13 | Support for PCI cards based on the Bt8xx PCI bridge. Examples are |
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index baa8227ef87c..ccc7b2eb4a2d 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -115,7 +115,7 @@ static int is_pci_slot_eq(struct pci_dev* adev, struct pci_dev* bdev) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static struct bt878 __init *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) | 118 | static struct bt878 __devinit *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) |
119 | { | 119 | { |
120 | unsigned int card_nr; | 120 | unsigned int card_nr; |
121 | 121 | ||
@@ -709,7 +709,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
709 | } | 709 | } |
710 | } | 710 | } |
711 | 711 | ||
712 | static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | 712 | static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) |
713 | { | 713 | { |
714 | int result; | 714 | int result; |
715 | 715 | ||
@@ -794,7 +794,7 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
794 | return 0; | 794 | return 0; |
795 | } | 795 | } |
796 | 796 | ||
797 | static int dvb_bt8xx_probe(struct bttv_sub_device *sub) | 797 | static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) |
798 | { | 798 | { |
799 | struct dvb_bt8xx_card *card; | 799 | struct dvb_bt8xx_card *card; |
800 | struct pci_dev* bttv_pci_dev; | 800 | struct pci_dev* bttv_pci_dev; |
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c index 71b575dc22bd..9325d039ea65 100644 --- a/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/drivers/media/dvb/cinergyT2/cinergyT2.c | |||
@@ -902,7 +902,10 @@ static int cinergyt2_probe (struct usb_interface *intf, | |||
902 | return -ENOMEM; | 902 | return -ENOMEM; |
903 | } | 903 | } |
904 | 904 | ||
905 | dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE); | 905 | if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE)) < 0) { |
906 | kfree(cinergyt2); | ||
907 | return err; | ||
908 | } | ||
906 | 909 | ||
907 | cinergyt2->demux.priv = cinergyt2; | 910 | cinergyt2->demux.priv = cinergyt2; |
908 | cinergyt2->demux.filternum = 256; | 911 | cinergyt2->demux.filternum = 256; |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 4f8f257e6795..a051790161b0 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -106,6 +106,8 @@ struct dvb_frontend_private { | |||
106 | unsigned long tune_mode_flags; | 106 | unsigned long tune_mode_flags; |
107 | unsigned int delay; | 107 | unsigned int delay; |
108 | unsigned int reinitialise; | 108 | unsigned int reinitialise; |
109 | int tone; | ||
110 | int voltage; | ||
109 | 111 | ||
110 | /* swzigzag values */ | 112 | /* swzigzag values */ |
111 | unsigned int state; | 113 | unsigned int state; |
@@ -537,6 +539,12 @@ static int dvb_frontend_thread(void *data) | |||
537 | 539 | ||
538 | if (fepriv->reinitialise) { | 540 | if (fepriv->reinitialise) { |
539 | dvb_frontend_init(fe); | 541 | dvb_frontend_init(fe); |
542 | if (fepriv->tone != -1) { | ||
543 | fe->ops->set_tone(fe, fepriv->tone); | ||
544 | } | ||
545 | if (fepriv->voltage != -1) { | ||
546 | fe->ops->set_voltage(fe, fepriv->voltage); | ||
547 | } | ||
540 | fepriv->reinitialise = 0; | 548 | fepriv->reinitialise = 0; |
541 | } | 549 | } |
542 | 550 | ||
@@ -788,6 +796,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
788 | case FE_SET_TONE: | 796 | case FE_SET_TONE: |
789 | if (fe->ops->set_tone) { | 797 | if (fe->ops->set_tone) { |
790 | err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); | 798 | err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); |
799 | fepriv->tone = (fe_sec_tone_mode_t) parg; | ||
791 | fepriv->state = FESTATE_DISEQC; | 800 | fepriv->state = FESTATE_DISEQC; |
792 | fepriv->status = 0; | 801 | fepriv->status = 0; |
793 | } | 802 | } |
@@ -796,6 +805,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
796 | case FE_SET_VOLTAGE: | 805 | case FE_SET_VOLTAGE: |
797 | if (fe->ops->set_voltage) { | 806 | if (fe->ops->set_voltage) { |
798 | err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg); | 807 | err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg); |
808 | fepriv->voltage = (fe_sec_voltage_t) parg; | ||
799 | fepriv->state = FESTATE_DISEQC; | 809 | fepriv->state = FESTATE_DISEQC; |
800 | fepriv->status = 0; | 810 | fepriv->status = 0; |
801 | } | 811 | } |
@@ -995,6 +1005,8 @@ static int dvb_frontend_open(struct inode *inode, struct file *file) | |||
995 | 1005 | ||
996 | /* normal tune mode when opened R/W */ | 1006 | /* normal tune mode when opened R/W */ |
997 | fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT; | 1007 | fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT; |
1008 | fepriv->tone = -1; | ||
1009 | fepriv->voltage = -1; | ||
998 | } | 1010 | } |
999 | 1011 | ||
1000 | return ret; | 1012 | return ret; |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 96fe0ecae250..3852430d0260 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -219,8 +219,6 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
219 | return -ENOMEM; | 219 | return -ENOMEM; |
220 | } | 220 | } |
221 | 221 | ||
222 | mutex_unlock(&dvbdev_register_lock); | ||
223 | |||
224 | memcpy(dvbdev, template, sizeof(struct dvb_device)); | 222 | memcpy(dvbdev, template, sizeof(struct dvb_device)); |
225 | dvbdev->type = type; | 223 | dvbdev->type = type; |
226 | dvbdev->id = id; | 224 | dvbdev->id = id; |
@@ -231,6 +229,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
231 | 229 | ||
232 | list_add_tail (&dvbdev->list_head, &adap->device_list); | 230 | list_add_tail (&dvbdev->list_head, &adap->device_list); |
233 | 231 | ||
232 | mutex_unlock(&dvbdev_register_lock); | ||
233 | |||
234 | devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), | 234 | devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), |
235 | S_IFCHR | S_IRUSR | S_IWUSR, | 235 | S_IFCHR | S_IRUSR | S_IWUSR, |
236 | "dvb/adapter%d/%s%d", adap->num, dnames[type], id); | 236 | "dvb/adapter%d/%s%d", adap->num, dnames[type], id); |
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index d3df12039b06..e388fb1567d6 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DVB_USB | 1 | config DVB_USB |
2 | tristate "Support for various USB DVB devices" | 2 | tristate "Support for various USB DVB devices" |
3 | depends on DVB_CORE && USB | 3 | depends on DVB_CORE && USB && I2C |
4 | select FW_LOADER | 4 | select FW_LOADER |
5 | help | 5 | help |
6 | By enabling this you will be able to choose the various supported | 6 | By enabling this you will be able to choose the various supported |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 7edd6362b9cc..1f0d3e995c8d 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -150,6 +150,15 @@ static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff) | |||
150 | return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0); | 150 | return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0); |
151 | } | 151 | } |
152 | 152 | ||
153 | static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff) | ||
154 | { | ||
155 | u8 b = 0; | ||
156 | if (onoff) | ||
157 | return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0); | ||
158 | else | ||
159 | return 0; | ||
160 | } | ||
161 | |||
153 | static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) | 162 | static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) |
154 | { | 163 | { |
155 | u8 buf[2] = { 0x03, 0x00 }; | 164 | u8 buf[2] = { 0x03, 0x00 }; |
@@ -544,7 +553,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { | |||
544 | .size_of_priv = sizeof(struct cxusb_state), | 553 | .size_of_priv = sizeof(struct cxusb_state), |
545 | 554 | ||
546 | .streaming_ctrl = cxusb_streaming_ctrl, | 555 | .streaming_ctrl = cxusb_streaming_ctrl, |
547 | .power_ctrl = cxusb_power_ctrl, | 556 | .power_ctrl = cxusb_bluebird_power_ctrl, |
548 | .frontend_attach = cxusb_lgdt3303_frontend_attach, | 557 | .frontend_attach = cxusb_lgdt3303_frontend_attach, |
549 | .tuner_attach = cxusb_lgh064f_tuner_attach, | 558 | .tuner_attach = cxusb_lgh064f_tuner_attach, |
550 | 559 | ||
@@ -589,7 +598,7 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { | |||
589 | .size_of_priv = sizeof(struct cxusb_state), | 598 | .size_of_priv = sizeof(struct cxusb_state), |
590 | 599 | ||
591 | .streaming_ctrl = cxusb_streaming_ctrl, | 600 | .streaming_ctrl = cxusb_streaming_ctrl, |
592 | .power_ctrl = cxusb_power_ctrl, | 601 | .power_ctrl = cxusb_bluebird_power_ctrl, |
593 | .frontend_attach = cxusb_dee1601_frontend_attach, | 602 | .frontend_attach = cxusb_dee1601_frontend_attach, |
594 | .tuner_attach = cxusb_dee1601_tuner_attach, | 603 | .tuner_attach = cxusb_dee1601_tuner_attach, |
595 | 604 | ||
@@ -638,7 +647,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = { | |||
638 | .size_of_priv = sizeof(struct cxusb_state), | 647 | .size_of_priv = sizeof(struct cxusb_state), |
639 | 648 | ||
640 | .streaming_ctrl = cxusb_streaming_ctrl, | 649 | .streaming_ctrl = cxusb_streaming_ctrl, |
641 | .power_ctrl = cxusb_power_ctrl, | 650 | .power_ctrl = cxusb_bluebird_power_ctrl, |
642 | .frontend_attach = cxusb_mt352_frontend_attach, | 651 | .frontend_attach = cxusb_mt352_frontend_attach, |
643 | .tuner_attach = cxusb_lgz201_tuner_attach, | 652 | .tuner_attach = cxusb_lgz201_tuner_attach, |
644 | 653 | ||
@@ -683,7 +692,7 @@ static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = { | |||
683 | .size_of_priv = sizeof(struct cxusb_state), | 692 | .size_of_priv = sizeof(struct cxusb_state), |
684 | 693 | ||
685 | .streaming_ctrl = cxusb_streaming_ctrl, | 694 | .streaming_ctrl = cxusb_streaming_ctrl, |
686 | .power_ctrl = cxusb_power_ctrl, | 695 | .power_ctrl = cxusb_bluebird_power_ctrl, |
687 | .frontend_attach = cxusb_mt352_frontend_attach, | 696 | .frontend_attach = cxusb_mt352_frontend_attach, |
688 | .tuner_attach = cxusb_dtt7579_tuner_attach, | 697 | .tuner_attach = cxusb_dtt7579_tuner_attach, |
689 | 698 | ||
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c index d661c6f9cbe5..691dc840dcc0 100644 --- a/drivers/media/dvb/frontends/cx24123.c +++ b/drivers/media/dvb/frontends/cx24123.c | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "dvb_frontend.h" | 29 | #include "dvb_frontend.h" |
30 | #include "cx24123.h" | 30 | #include "cx24123.h" |
31 | 31 | ||
32 | #define XTAL 10111000 | ||
33 | |||
34 | static int force_band; | ||
32 | static int debug; | 35 | static int debug; |
33 | #define dprintk(args...) \ | 36 | #define dprintk(args...) \ |
34 | do { \ | 37 | do { \ |
@@ -52,6 +55,7 @@ struct cx24123_state | |||
52 | u32 VGAarg; | 55 | u32 VGAarg; |
53 | u32 bandselectarg; | 56 | u32 bandselectarg; |
54 | u32 pllarg; | 57 | u32 pllarg; |
58 | u32 FILTune; | ||
55 | 59 | ||
56 | /* The Demod/Tuner can't easily provide these, we cache them */ | 60 | /* The Demod/Tuner can't easily provide these, we cache them */ |
57 | u32 currentfreq; | 61 | u32 currentfreq; |
@@ -63,43 +67,33 @@ static struct | |||
63 | { | 67 | { |
64 | u32 symbolrate_low; | 68 | u32 symbolrate_low; |
65 | u32 symbolrate_high; | 69 | u32 symbolrate_high; |
66 | u32 VCAslope; | ||
67 | u32 VCAoffset; | ||
68 | u32 VGA1offset; | ||
69 | u32 VGA2offset; | ||
70 | u32 VCAprogdata; | 70 | u32 VCAprogdata; |
71 | u32 VGAprogdata; | 71 | u32 VGAprogdata; |
72 | u32 FILTune; | ||
72 | } cx24123_AGC_vals[] = | 73 | } cx24123_AGC_vals[] = |
73 | { | 74 | { |
74 | { | 75 | { |
75 | .symbolrate_low = 1000000, | 76 | .symbolrate_low = 1000000, |
76 | .symbolrate_high = 4999999, | 77 | .symbolrate_high = 4999999, |
77 | .VCAslope = 0x07, | 78 | /* the specs recommend other values for VGA offsets, |
78 | .VCAoffset = 0x0f, | 79 | but tests show they are wrong */ |
79 | .VGA1offset = 0x1f8, | 80 | .VGAprogdata = (1 << 19) | (0x180 << 9) | 0x1e0, |
80 | .VGA2offset = 0x1f8, | 81 | .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x07, |
81 | .VGAprogdata = (2 << 18) | (0x1f8 << 9) | 0x1f8, | 82 | .FILTune = 0x27f /* 0.41 V */ |
82 | .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x07, | ||
83 | }, | 83 | }, |
84 | { | 84 | { |
85 | .symbolrate_low = 5000000, | 85 | .symbolrate_low = 5000000, |
86 | .symbolrate_high = 14999999, | 86 | .symbolrate_high = 14999999, |
87 | .VCAslope = 0x1f, | 87 | .VGAprogdata = (1 << 19) | (0x180 << 9) | 0x1e0, |
88 | .VCAoffset = 0x1f, | 88 | .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x1f, |
89 | .VGA1offset = 0x1e0, | 89 | .FILTune = 0x317 /* 0.90 V */ |
90 | .VGA2offset = 0x180, | ||
91 | .VGAprogdata = (2 << 18) | (0x180 << 9) | 0x1e0, | ||
92 | .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x1f, | ||
93 | }, | 90 | }, |
94 | { | 91 | { |
95 | .symbolrate_low = 15000000, | 92 | .symbolrate_low = 15000000, |
96 | .symbolrate_high = 45000000, | 93 | .symbolrate_high = 45000000, |
97 | .VCAslope = 0x3f, | 94 | .VGAprogdata = (1 << 19) | (0x100 << 9) | 0x180, |
98 | .VCAoffset = 0x3f, | 95 | .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x3f, |
99 | .VGA1offset = 0x180, | 96 | .FILTune = 0x145 /* 2.70 V */ |
100 | .VGA2offset = 0x100, | ||
101 | .VGAprogdata = (2 << 18) | (0x100 << 9) | 0x180, | ||
102 | .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x3f, | ||
103 | }, | 97 | }, |
104 | }; | 98 | }; |
105 | 99 | ||
@@ -112,91 +106,80 @@ static struct | |||
112 | { | 106 | { |
113 | u32 freq_low; | 107 | u32 freq_low; |
114 | u32 freq_high; | 108 | u32 freq_high; |
115 | u32 bandselect; | ||
116 | u32 VCOdivider; | 109 | u32 VCOdivider; |
117 | u32 VCOnumber; | ||
118 | u32 progdata; | 110 | u32 progdata; |
119 | } cx24123_bandselect_vals[] = | 111 | } cx24123_bandselect_vals[] = |
120 | { | 112 | { |
113 | /* band 1 */ | ||
121 | { | 114 | { |
122 | .freq_low = 950000, | 115 | .freq_low = 950000, |
123 | .freq_high = 1018999, | ||
124 | .bandselect = 0x40, | ||
125 | .VCOdivider = 4, | ||
126 | .VCOnumber = 7, | ||
127 | .progdata = (0 << 18) | (0 << 9) | 0x40, | ||
128 | }, | ||
129 | { | ||
130 | .freq_low = 1019000, | ||
131 | .freq_high = 1074999, | 116 | .freq_high = 1074999, |
132 | .bandselect = 0x80, | ||
133 | .VCOdivider = 4, | 117 | .VCOdivider = 4, |
134 | .VCOnumber = 8, | 118 | .progdata = (0 << 19) | (0 << 9) | 0x40, |
135 | .progdata = (0 << 18) | (0 << 9) | 0x80, | ||
136 | }, | 119 | }, |
120 | |||
121 | /* band 2 */ | ||
137 | { | 122 | { |
138 | .freq_low = 1075000, | 123 | .freq_low = 1075000, |
139 | .freq_high = 1227999, | 124 | .freq_high = 1177999, |
140 | .bandselect = 0x01, | 125 | .VCOdivider = 4, |
141 | .VCOdivider = 2, | 126 | .progdata = (0 << 19) | (0 << 9) | 0x80, |
142 | .VCOnumber = 1, | ||
143 | .progdata = (0 << 18) | (1 << 9) | 0x01, | ||
144 | }, | 127 | }, |
128 | |||
129 | /* band 3 */ | ||
145 | { | 130 | { |
146 | .freq_low = 1228000, | 131 | .freq_low = 1178000, |
147 | .freq_high = 1349999, | 132 | .freq_high = 1295999, |
148 | .bandselect = 0x02, | ||
149 | .VCOdivider = 2, | 133 | .VCOdivider = 2, |
150 | .VCOnumber = 2, | 134 | .progdata = (0 << 19) | (1 << 9) | 0x01, |
151 | .progdata = (0 << 18) | (1 << 9) | 0x02, | ||
152 | }, | 135 | }, |
136 | |||
137 | /* band 4 */ | ||
153 | { | 138 | { |
154 | .freq_low = 1350000, | 139 | .freq_low = 1296000, |
155 | .freq_high = 1481999, | 140 | .freq_high = 1431999, |
156 | .bandselect = 0x04, | ||
157 | .VCOdivider = 2, | 141 | .VCOdivider = 2, |
158 | .VCOnumber = 3, | 142 | .progdata = (0 << 19) | (1 << 9) | 0x02, |
159 | .progdata = (0 << 18) | (1 << 9) | 0x04, | ||
160 | }, | 143 | }, |
144 | |||
145 | /* band 5 */ | ||
161 | { | 146 | { |
162 | .freq_low = 1482000, | 147 | .freq_low = 1432000, |
163 | .freq_high = 1595999, | 148 | .freq_high = 1575999, |
164 | .bandselect = 0x08, | ||
165 | .VCOdivider = 2, | 149 | .VCOdivider = 2, |
166 | .VCOnumber = 4, | 150 | .progdata = (0 << 19) | (1 << 9) | 0x04, |
167 | .progdata = (0 << 18) | (1 << 9) | 0x08, | ||
168 | }, | 151 | }, |
152 | |||
153 | /* band 6 */ | ||
169 | { | 154 | { |
170 | .freq_low = 1596000, | 155 | .freq_low = 1576000, |
171 | .freq_high = 1717999, | 156 | .freq_high = 1717999, |
172 | .bandselect = 0x10, | ||
173 | .VCOdivider = 2, | 157 | .VCOdivider = 2, |
174 | .VCOnumber = 5, | 158 | .progdata = (0 << 19) | (1 << 9) | 0x08, |
175 | .progdata = (0 << 18) | (1 << 9) | 0x10, | ||
176 | }, | 159 | }, |
160 | |||
161 | /* band 7 */ | ||
177 | { | 162 | { |
178 | .freq_low = 1718000, | 163 | .freq_low = 1718000, |
179 | .freq_high = 1855999, | 164 | .freq_high = 1855999, |
180 | .bandselect = 0x20, | ||
181 | .VCOdivider = 2, | 165 | .VCOdivider = 2, |
182 | .VCOnumber = 6, | 166 | .progdata = (0 << 19) | (1 << 9) | 0x10, |
183 | .progdata = (0 << 18) | (1 << 9) | 0x20, | ||
184 | }, | 167 | }, |
168 | |||
169 | /* band 8 */ | ||
185 | { | 170 | { |
186 | .freq_low = 1856000, | 171 | .freq_low = 1856000, |
187 | .freq_high = 2035999, | 172 | .freq_high = 2035999, |
188 | .bandselect = 0x40, | ||
189 | .VCOdivider = 2, | 173 | .VCOdivider = 2, |
190 | .VCOnumber = 7, | 174 | .progdata = (0 << 19) | (1 << 9) | 0x20, |
191 | .progdata = (0 << 18) | (1 << 9) | 0x40, | ||
192 | }, | 175 | }, |
176 | |||
177 | /* band 9 */ | ||
193 | { | 178 | { |
194 | .freq_low = 2036000, | 179 | .freq_low = 2036000, |
195 | .freq_high = 2149999, | 180 | .freq_high = 2150000, |
196 | .bandselect = 0x80, | ||
197 | .VCOdivider = 2, | 181 | .VCOdivider = 2, |
198 | .VCOnumber = 8, | 182 | .progdata = (0 << 19) | (1 << 9) | 0x40, |
199 | .progdata = (0 << 18) | (1 << 9) | 0x80, | ||
200 | }, | 183 | }, |
201 | }; | 184 | }; |
202 | 185 | ||
@@ -207,49 +190,44 @@ static struct { | |||
207 | { | 190 | { |
208 | {0x00, 0x03}, /* Reset system */ | 191 | {0x00, 0x03}, /* Reset system */ |
209 | {0x00, 0x00}, /* Clear reset */ | 192 | {0x00, 0x00}, /* Clear reset */ |
210 | {0x01, 0x3b}, /* Apply sensible defaults, from an i2c sniffer */ | 193 | {0x03, 0x07}, /* QPSK, DVB, Auto Acquisition (default) */ |
211 | {0x03, 0x07}, | 194 | {0x04, 0x10}, /* MPEG */ |
212 | {0x04, 0x10}, | 195 | {0x05, 0x04}, /* MPEG */ |
213 | {0x05, 0x04}, | 196 | {0x06, 0x31}, /* MPEG (default) */ |
214 | {0x06, 0x31}, | 197 | {0x0b, 0x00}, /* Freq search start point (default) */ |
215 | {0x0d, 0x02}, | 198 | {0x0c, 0x00}, /* Demodulator sample gain (default) */ |
216 | {0x0e, 0x03}, | 199 | {0x0d, 0x02}, /* Frequency search range = Fsymbol / 4 (default) */ |
217 | {0x0f, 0xfe}, | 200 | {0x0e, 0x03}, /* Default non-inverted, FEC 3/4 (default) */ |
218 | {0x10, 0x01}, | 201 | {0x0f, 0xfe}, /* FEC search mask (all supported codes) */ |
219 | {0x14, 0x01}, | 202 | {0x10, 0x01}, /* Default search inversion, no repeat (default) */ |
220 | {0x15, 0x98}, | 203 | {0x16, 0x00}, /* Enable reading of frequency */ |
221 | {0x16, 0x00}, | 204 | {0x17, 0x01}, /* Enable EsNO Ready Counter */ |
222 | {0x17, 0x01}, | 205 | {0x1c, 0x80}, /* Enable error counter */ |
223 | {0x1b, 0x05}, | 206 | {0x20, 0x00}, /* Tuner burst clock rate = 500KHz */ |
224 | {0x1c, 0x80}, | 207 | {0x21, 0x15}, /* Tuner burst mode, word length = 0x15 */ |
225 | {0x1d, 0x00}, | 208 | {0x28, 0x00}, /* Enable FILTERV with positive pol., DiSEqC 2.x off */ |
226 | {0x1e, 0x00}, | 209 | {0x29, 0x00}, /* DiSEqC LNB_DC off */ |
227 | {0x20, 0x41}, | 210 | {0x2a, 0xb0}, /* DiSEqC Parameters (default) */ |
228 | {0x21, 0x15}, | 211 | {0x2b, 0x73}, /* DiSEqC Tone Frequency (default) */ |
229 | {0x27, 0x14}, | 212 | {0x2c, 0x00}, /* DiSEqC Message (0x2c - 0x31) */ |
230 | {0x28, 0x46}, | ||
231 | {0x29, 0x00}, | ||
232 | {0x2a, 0xb0}, | ||
233 | {0x2b, 0x73}, | ||
234 | {0x2c, 0x00}, | ||
235 | {0x2d, 0x00}, | 213 | {0x2d, 0x00}, |
236 | {0x2e, 0x00}, | 214 | {0x2e, 0x00}, |
237 | {0x2f, 0x00}, | 215 | {0x2f, 0x00}, |
238 | {0x30, 0x00}, | 216 | {0x30, 0x00}, |
239 | {0x31, 0x00}, | 217 | {0x31, 0x00}, |
240 | {0x32, 0x8c}, | 218 | {0x32, 0x8c}, /* DiSEqC Parameters (default) */ |
241 | {0x33, 0x00}, | 219 | {0x33, 0x00}, /* Interrupts off (0x33 - 0x34) */ |
242 | {0x34, 0x00}, | 220 | {0x34, 0x00}, |
243 | {0x35, 0x03}, | 221 | {0x35, 0x03}, /* DiSEqC Tone Amplitude (default) */ |
244 | {0x36, 0x02}, | 222 | {0x36, 0x02}, /* DiSEqC Parameters (default) */ |
245 | {0x37, 0x3a}, | 223 | {0x37, 0x3a}, /* DiSEqC Parameters (default) */ |
246 | {0x3a, 0x00}, /* Enable AGC accumulator */ | 224 | {0x3a, 0x00}, /* Enable AGC accumulator (for signal strength) */ |
247 | {0x44, 0x00}, | 225 | {0x44, 0x00}, /* Constellation (default) */ |
248 | {0x45, 0x00}, | 226 | {0x45, 0x00}, /* Symbol count (default) */ |
249 | {0x46, 0x05}, | 227 | {0x46, 0x0d}, /* Symbol rate estimator on (default) */ |
250 | {0x56, 0x41}, | 228 | {0x56, 0x41}, /* Various (default) */ |
251 | {0x57, 0xff}, | 229 | {0x57, 0xff}, /* Error Counter Window (default) */ |
252 | {0x67, 0x83}, | 230 | {0x67, 0x83}, /* Non-DCII symbol clock */ |
253 | }; | 231 | }; |
254 | 232 | ||
255 | static int cx24123_writereg(struct cx24123_state* state, int reg, int data) | 233 | static int cx24123_writereg(struct cx24123_state* state, int reg, int data) |
@@ -258,6 +236,10 @@ static int cx24123_writereg(struct cx24123_state* state, int reg, int data) | |||
258 | struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; | 236 | struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; |
259 | int err; | 237 | int err; |
260 | 238 | ||
239 | if (debug>1) | ||
240 | printk("cx24123: %s: write reg 0x%02x, value 0x%02x\n", | ||
241 | __FUNCTION__,reg, data); | ||
242 | |||
261 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | 243 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { |
262 | printk("%s: writereg error(err == %i, reg == 0x%02x," | 244 | printk("%s: writereg error(err == %i, reg == 0x%02x," |
263 | " data == 0x%02x)\n", __FUNCTION__, err, reg, data); | 245 | " data == 0x%02x)\n", __FUNCTION__, err, reg, data); |
@@ -274,6 +256,10 @@ static int cx24123_writelnbreg(struct cx24123_state* state, int reg, int data) | |||
274 | struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = buf, .len = 2 }; | 256 | struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = buf, .len = 2 }; |
275 | int err; | 257 | int err; |
276 | 258 | ||
259 | if (debug>1) | ||
260 | printk("cx24123: %s: writeln addr=0x08, reg 0x%02x, value 0x%02x\n", | ||
261 | __FUNCTION__,reg, data); | ||
262 | |||
277 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | 263 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { |
278 | printk("%s: writelnbreg error (err == %i, reg == 0x%02x," | 264 | printk("%s: writelnbreg error (err == %i, reg == 0x%02x," |
279 | " data == 0x%02x)\n", __FUNCTION__, err, reg, data); | 265 | " data == 0x%02x)\n", __FUNCTION__, err, reg, data); |
@@ -303,6 +289,9 @@ static int cx24123_readreg(struct cx24123_state* state, u8 reg) | |||
303 | return ret; | 289 | return ret; |
304 | } | 290 | } |
305 | 291 | ||
292 | if (debug>1) | ||
293 | printk("cx24123: read reg 0x%02x, value 0x%02x\n",reg, ret); | ||
294 | |||
306 | return b1[0]; | 295 | return b1[0]; |
307 | } | 296 | } |
308 | 297 | ||
@@ -313,17 +302,23 @@ static int cx24123_readlnbreg(struct cx24123_state* state, u8 reg) | |||
313 | 302 | ||
314 | static int cx24123_set_inversion(struct cx24123_state* state, fe_spectral_inversion_t inversion) | 303 | static int cx24123_set_inversion(struct cx24123_state* state, fe_spectral_inversion_t inversion) |
315 | { | 304 | { |
305 | u8 nom_reg = cx24123_readreg(state, 0x0e); | ||
306 | u8 auto_reg = cx24123_readreg(state, 0x10); | ||
307 | |||
316 | switch (inversion) { | 308 | switch (inversion) { |
317 | case INVERSION_OFF: | 309 | case INVERSION_OFF: |
318 | cx24123_writereg(state, 0x0e, cx24123_readreg(state, 0x0e) & 0x7f); | 310 | dprintk("%s: inversion off\n",__FUNCTION__); |
319 | cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) | 0x80); | 311 | cx24123_writereg(state, 0x0e, nom_reg & ~0x80); |
312 | cx24123_writereg(state, 0x10, auto_reg | 0x80); | ||
320 | break; | 313 | break; |
321 | case INVERSION_ON: | 314 | case INVERSION_ON: |
322 | cx24123_writereg(state, 0x0e, cx24123_readreg(state, 0x0e) | 0x80); | 315 | dprintk("%s: inversion on\n",__FUNCTION__); |
323 | cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) | 0x80); | 316 | cx24123_writereg(state, 0x0e, nom_reg | 0x80); |
317 | cx24123_writereg(state, 0x10, auto_reg | 0x80); | ||
324 | break; | 318 | break; |
325 | case INVERSION_AUTO: | 319 | case INVERSION_AUTO: |
326 | cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) & 0x7f); | 320 | dprintk("%s: inversion auto\n",__FUNCTION__); |
321 | cx24123_writereg(state, 0x10, auto_reg & ~0x80); | ||
327 | break; | 322 | break; |
328 | default: | 323 | default: |
329 | return -EINVAL; | 324 | return -EINVAL; |
@@ -338,92 +333,191 @@ static int cx24123_get_inversion(struct cx24123_state* state, fe_spectral_invers | |||
338 | 333 | ||
339 | val = cx24123_readreg(state, 0x1b) >> 7; | 334 | val = cx24123_readreg(state, 0x1b) >> 7; |
340 | 335 | ||
341 | if (val == 0) | 336 | if (val == 0) { |
337 | dprintk("%s: read inversion off\n",__FUNCTION__); | ||
342 | *inversion = INVERSION_OFF; | 338 | *inversion = INVERSION_OFF; |
343 | else | 339 | } else { |
340 | dprintk("%s: read inversion on\n",__FUNCTION__); | ||
344 | *inversion = INVERSION_ON; | 341 | *inversion = INVERSION_ON; |
342 | } | ||
345 | 343 | ||
346 | return 0; | 344 | return 0; |
347 | } | 345 | } |
348 | 346 | ||
349 | static int cx24123_set_fec(struct cx24123_state* state, fe_code_rate_t fec) | 347 | static int cx24123_set_fec(struct cx24123_state* state, fe_code_rate_t fec) |
350 | { | 348 | { |
349 | u8 nom_reg = cx24123_readreg(state, 0x0e) & ~0x07; | ||
350 | |||
351 | if ( (fec < FEC_NONE) || (fec > FEC_AUTO) ) | 351 | if ( (fec < FEC_NONE) || (fec > FEC_AUTO) ) |
352 | fec = FEC_AUTO; | 352 | fec = FEC_AUTO; |
353 | 353 | ||
354 | /* Hardware has 5/11 and 3/5 but are never unused */ | ||
355 | switch (fec) { | 354 | switch (fec) { |
356 | case FEC_NONE: | ||
357 | return cx24123_writereg(state, 0x0f, 0x01); | ||
358 | case FEC_1_2: | 355 | case FEC_1_2: |
359 | return cx24123_writereg(state, 0x0f, 0x02); | 356 | dprintk("%s: set FEC to 1/2\n",__FUNCTION__); |
357 | cx24123_writereg(state, 0x0e, nom_reg | 0x01); | ||
358 | cx24123_writereg(state, 0x0f, 0x02); | ||
359 | break; | ||
360 | case FEC_2_3: | 360 | case FEC_2_3: |
361 | return cx24123_writereg(state, 0x0f, 0x04); | 361 | dprintk("%s: set FEC to 2/3\n",__FUNCTION__); |
362 | cx24123_writereg(state, 0x0e, nom_reg | 0x02); | ||
363 | cx24123_writereg(state, 0x0f, 0x04); | ||
364 | break; | ||
362 | case FEC_3_4: | 365 | case FEC_3_4: |
363 | return cx24123_writereg(state, 0x0f, 0x08); | 366 | dprintk("%s: set FEC to 3/4\n",__FUNCTION__); |
367 | cx24123_writereg(state, 0x0e, nom_reg | 0x03); | ||
368 | cx24123_writereg(state, 0x0f, 0x08); | ||
369 | break; | ||
370 | case FEC_4_5: | ||
371 | dprintk("%s: set FEC to 4/5\n",__FUNCTION__); | ||
372 | cx24123_writereg(state, 0x0e, nom_reg | 0x04); | ||
373 | cx24123_writereg(state, 0x0f, 0x10); | ||
374 | break; | ||
364 | case FEC_5_6: | 375 | case FEC_5_6: |
365 | return cx24123_writereg(state, 0x0f, 0x20); | 376 | dprintk("%s: set FEC to 5/6\n",__FUNCTION__); |
377 | cx24123_writereg(state, 0x0e, nom_reg | 0x05); | ||
378 | cx24123_writereg(state, 0x0f, 0x20); | ||
379 | break; | ||
380 | case FEC_6_7: | ||
381 | dprintk("%s: set FEC to 6/7\n",__FUNCTION__); | ||
382 | cx24123_writereg(state, 0x0e, nom_reg | 0x06); | ||
383 | cx24123_writereg(state, 0x0f, 0x40); | ||
384 | break; | ||
366 | case FEC_7_8: | 385 | case FEC_7_8: |
367 | return cx24123_writereg(state, 0x0f, 0x80); | 386 | dprintk("%s: set FEC to 7/8\n",__FUNCTION__); |
387 | cx24123_writereg(state, 0x0e, nom_reg | 0x07); | ||
388 | cx24123_writereg(state, 0x0f, 0x80); | ||
389 | break; | ||
368 | case FEC_AUTO: | 390 | case FEC_AUTO: |
369 | return cx24123_writereg(state, 0x0f, 0xae); | 391 | dprintk("%s: set FEC to auto\n",__FUNCTION__); |
392 | cx24123_writereg(state, 0x0f, 0xfe); | ||
393 | break; | ||
370 | default: | 394 | default: |
371 | return -EOPNOTSUPP; | 395 | return -EOPNOTSUPP; |
372 | } | 396 | } |
397 | |||
398 | return 0; | ||
373 | } | 399 | } |
374 | 400 | ||
375 | static int cx24123_get_fec(struct cx24123_state* state, fe_code_rate_t *fec) | 401 | static int cx24123_get_fec(struct cx24123_state* state, fe_code_rate_t *fec) |
376 | { | 402 | { |
377 | int ret; | 403 | int ret; |
378 | u8 val; | ||
379 | 404 | ||
380 | ret = cx24123_readreg (state, 0x1b); | 405 | ret = cx24123_readreg (state, 0x1b); |
381 | if (ret < 0) | 406 | if (ret < 0) |
382 | return ret; | 407 | return ret; |
383 | val = ret & 0x07; | 408 | ret = ret & 0x07; |
384 | switch (val) { | 409 | |
410 | switch (ret) { | ||
385 | case 1: | 411 | case 1: |
386 | *fec = FEC_1_2; | 412 | *fec = FEC_1_2; |
387 | break; | 413 | break; |
388 | case 3: | 414 | case 2: |
389 | *fec = FEC_2_3; | 415 | *fec = FEC_2_3; |
390 | break; | 416 | break; |
391 | case 4: | 417 | case 3: |
392 | *fec = FEC_3_4; | 418 | *fec = FEC_3_4; |
393 | break; | 419 | break; |
394 | case 5: | 420 | case 4: |
395 | *fec = FEC_4_5; | 421 | *fec = FEC_4_5; |
396 | break; | 422 | break; |
397 | case 6: | 423 | case 5: |
398 | *fec = FEC_5_6; | 424 | *fec = FEC_5_6; |
399 | break; | 425 | break; |
426 | case 6: | ||
427 | *fec = FEC_6_7; | ||
428 | break; | ||
400 | case 7: | 429 | case 7: |
401 | *fec = FEC_7_8; | 430 | *fec = FEC_7_8; |
402 | break; | 431 | break; |
403 | case 2: /* *fec = FEC_3_5; break; */ | ||
404 | case 0: /* *fec = FEC_5_11; break; */ | ||
405 | *fec = FEC_AUTO; | ||
406 | break; | ||
407 | default: | 432 | default: |
408 | *fec = FEC_NONE; // can't happen | 433 | /* this can happen when there's no lock */ |
434 | *fec = FEC_NONE; | ||
409 | } | 435 | } |
410 | 436 | ||
411 | return 0; | 437 | return 0; |
412 | } | 438 | } |
413 | 439 | ||
414 | /* fixme: Symbol rates < 3MSps may not work because of precision loss */ | 440 | /* Approximation of closest integer of log2(a/b). It actually gives the |
441 | lowest integer i such that 2^i >= round(a/b) */ | ||
442 | static u32 cx24123_int_log2(u32 a, u32 b) | ||
443 | { | ||
444 | u32 exp, nearest = 0; | ||
445 | u32 div = a / b; | ||
446 | if(a % b >= b / 2) ++div; | ||
447 | if(div < (1 << 31)) | ||
448 | { | ||
449 | for(exp = 1; div > exp; nearest++) | ||
450 | exp += exp; | ||
451 | } | ||
452 | return nearest; | ||
453 | } | ||
454 | |||
415 | static int cx24123_set_symbolrate(struct cx24123_state* state, u32 srate) | 455 | static int cx24123_set_symbolrate(struct cx24123_state* state, u32 srate) |
416 | { | 456 | { |
417 | u32 val; | 457 | u32 tmp, sample_rate, ratio, sample_gain; |
458 | u8 pll_mult; | ||
459 | |||
460 | /* check if symbol rate is within limits */ | ||
461 | if ((srate > state->ops.info.symbol_rate_max) || | ||
462 | (srate < state->ops.info.symbol_rate_min)) | ||
463 | return -EOPNOTSUPP;; | ||
464 | |||
465 | /* choose the sampling rate high enough for the required operation, | ||
466 | while optimizing the power consumed by the demodulator */ | ||
467 | if (srate < (XTAL*2)/2) | ||
468 | pll_mult = 2; | ||
469 | else if (srate < (XTAL*3)/2) | ||
470 | pll_mult = 3; | ||
471 | else if (srate < (XTAL*4)/2) | ||
472 | pll_mult = 4; | ||
473 | else if (srate < (XTAL*5)/2) | ||
474 | pll_mult = 5; | ||
475 | else if (srate < (XTAL*6)/2) | ||
476 | pll_mult = 6; | ||
477 | else if (srate < (XTAL*7)/2) | ||
478 | pll_mult = 7; | ||
479 | else if (srate < (XTAL*8)/2) | ||
480 | pll_mult = 8; | ||
481 | else | ||
482 | pll_mult = 9; | ||
483 | |||
484 | |||
485 | sample_rate = pll_mult * XTAL; | ||
486 | |||
487 | /* | ||
488 | SYSSymbolRate[21:0] = (srate << 23) / sample_rate | ||
489 | |||
490 | We have to use 32 bit unsigned arithmetic without precision loss. | ||
491 | The maximum srate is 45000000 or 0x02AEA540. This number has | ||
492 | only 6 clear bits on top, hence we can shift it left only 6 bits | ||
493 | at a time. Borrowed from cx24110.c | ||
494 | */ | ||
495 | |||
496 | tmp = srate << 6; | ||
497 | ratio = tmp / sample_rate; | ||
498 | |||
499 | tmp = (tmp % sample_rate) << 6; | ||
500 | ratio = (ratio << 6) + (tmp / sample_rate); | ||
501 | |||
502 | tmp = (tmp % sample_rate) << 6; | ||
503 | ratio = (ratio << 6) + (tmp / sample_rate); | ||
504 | |||
505 | tmp = (tmp % sample_rate) << 5; | ||
506 | ratio = (ratio << 5) + (tmp / sample_rate); | ||
507 | |||
508 | |||
509 | cx24123_writereg(state, 0x01, pll_mult * 6); | ||
418 | 510 | ||
419 | val = (srate / 1185) * 100; | 511 | cx24123_writereg(state, 0x08, (ratio >> 16) & 0x3f ); |
512 | cx24123_writereg(state, 0x09, (ratio >> 8) & 0xff ); | ||
513 | cx24123_writereg(state, 0x0a, (ratio ) & 0xff ); | ||
420 | 514 | ||
421 | /* Compensate for scaling up, by removing 17 symbols per 1Msps */ | 515 | /* also set the demodulator sample gain */ |
422 | val = val - (17 * (srate / 1000000)); | 516 | sample_gain = cx24123_int_log2(sample_rate, srate); |
517 | tmp = cx24123_readreg(state, 0x0c) & ~0xe0; | ||
518 | cx24123_writereg(state, 0x0c, tmp | sample_gain << 5); | ||
423 | 519 | ||
424 | cx24123_writereg(state, 0x08, (val >> 16) & 0xff ); | 520 | dprintk("%s: srate=%d, ratio=0x%08x, sample_rate=%i sample_gain=%d\n", __FUNCTION__, srate, ratio, sample_rate, sample_gain); |
425 | cx24123_writereg(state, 0x09, (val >> 8) & 0xff ); | ||
426 | cx24123_writereg(state, 0x0a, (val ) & 0xff ); | ||
427 | 521 | ||
428 | return 0; | 522 | return 0; |
429 | } | 523 | } |
@@ -437,6 +531,9 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
437 | struct cx24123_state *state = fe->demodulator_priv; | 531 | struct cx24123_state *state = fe->demodulator_priv; |
438 | u32 ndiv = 0, adiv = 0, vco_div = 0; | 532 | u32 ndiv = 0, adiv = 0, vco_div = 0; |
439 | int i = 0; | 533 | int i = 0; |
534 | int pump = 2; | ||
535 | int band = 0; | ||
536 | int num_bands = sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]); | ||
440 | 537 | ||
441 | /* Defaults for low freq, low rate */ | 538 | /* Defaults for low freq, low rate */ |
442 | state->VCAarg = cx24123_AGC_vals[0].VCAprogdata; | 539 | state->VCAarg = cx24123_AGC_vals[0].VCAprogdata; |
@@ -444,38 +541,49 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
444 | state->bandselectarg = cx24123_bandselect_vals[0].progdata; | 541 | state->bandselectarg = cx24123_bandselect_vals[0].progdata; |
445 | vco_div = cx24123_bandselect_vals[0].VCOdivider; | 542 | vco_div = cx24123_bandselect_vals[0].VCOdivider; |
446 | 543 | ||
447 | /* For the given symbolerate, determine the VCA and VGA programming bits */ | 544 | /* For the given symbol rate, determine the VCA, VGA and FILTUNE programming bits */ |
448 | for (i = 0; i < sizeof(cx24123_AGC_vals) / sizeof(cx24123_AGC_vals[0]); i++) | 545 | for (i = 0; i < sizeof(cx24123_AGC_vals) / sizeof(cx24123_AGC_vals[0]); i++) |
449 | { | 546 | { |
450 | if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) && | 547 | if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) && |
451 | (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { | 548 | (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { |
452 | state->VCAarg = cx24123_AGC_vals[i].VCAprogdata; | 549 | state->VCAarg = cx24123_AGC_vals[i].VCAprogdata; |
453 | state->VGAarg = cx24123_AGC_vals[i].VGAprogdata; | 550 | state->VGAarg = cx24123_AGC_vals[i].VGAprogdata; |
551 | state->FILTune = cx24123_AGC_vals[i].FILTune; | ||
454 | } | 552 | } |
455 | } | 553 | } |
456 | 554 | ||
457 | /* For the given frequency, determine the bandselect programming bits */ | 555 | /* determine the band to use */ |
458 | for (i = 0; i < sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]); i++) | 556 | if(force_band < 1 || force_band > num_bands) |
459 | { | 557 | { |
460 | if ((cx24123_bandselect_vals[i].freq_low <= p->frequency) && | 558 | for (i = 0; i < num_bands; i++) |
461 | (cx24123_bandselect_vals[i].freq_high >= p->frequency) ) { | 559 | { |
462 | state->bandselectarg = cx24123_bandselect_vals[i].progdata; | 560 | if ((cx24123_bandselect_vals[i].freq_low <= p->frequency) && |
463 | vco_div = cx24123_bandselect_vals[i].VCOdivider; | 561 | (cx24123_bandselect_vals[i].freq_high >= p->frequency) ) |
562 | band = i; | ||
464 | } | 563 | } |
465 | } | 564 | } |
565 | else | ||
566 | band = force_band - 1; | ||
567 | |||
568 | state->bandselectarg = cx24123_bandselect_vals[band].progdata; | ||
569 | vco_div = cx24123_bandselect_vals[band].VCOdivider; | ||
570 | |||
571 | /* determine the charge pump current */ | ||
572 | if ( p->frequency < (cx24123_bandselect_vals[band].freq_low + cx24123_bandselect_vals[band].freq_high)/2 ) | ||
573 | pump = 0x01; | ||
574 | else | ||
575 | pump = 0x02; | ||
466 | 576 | ||
467 | /* Determine the N/A dividers for the requested lband freq (in kHz). */ | 577 | /* Determine the N/A dividers for the requested lband freq (in kHz). */ |
468 | /* Note: 10111 (kHz) is the Crystal Freq and divider of 10. */ | 578 | /* Note: the reference divider R=10, frequency is in KHz, XTAL is in Hz */ |
469 | ndiv = ( ((p->frequency * vco_div) / (10111 / 10) / 2) / 32) & 0x1ff; | 579 | ndiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) / 32) & 0x1ff; |
470 | adiv = ( ((p->frequency * vco_div) / (10111 / 10) / 2) % 32) & 0x1f; | 580 | adiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) % 32) & 0x1f; |
471 | 581 | ||
472 | if (adiv == 0) | 582 | if (adiv == 0) |
473 | adiv++; | 583 | ndiv++; |
474 | 584 | ||
475 | /* determine the correct pll frequency values. */ | 585 | /* control bits 11, refdiv 11, charge pump polarity 1, charge pump current, ndiv, adiv */ |
476 | /* Command 11, refdiv 11, cpump polarity 1, cpump current 3mA 10. */ | 586 | state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (pump << 14) | (ndiv << 5) | adiv; |
477 | state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (2 << 14); | ||
478 | state->pllarg |= (ndiv << 5) | adiv; | ||
479 | 587 | ||
480 | return 0; | 588 | return 0; |
481 | } | 589 | } |
@@ -489,6 +597,8 @@ static int cx24123_pll_writereg(struct dvb_frontend* fe, struct dvb_frontend_par | |||
489 | struct cx24123_state *state = fe->demodulator_priv; | 597 | struct cx24123_state *state = fe->demodulator_priv; |
490 | unsigned long timeout; | 598 | unsigned long timeout; |
491 | 599 | ||
600 | dprintk("%s: pll writereg called, data=0x%08x\n",__FUNCTION__,data); | ||
601 | |||
492 | /* align the 21 bytes into to bit23 boundary */ | 602 | /* align the 21 bytes into to bit23 boundary */ |
493 | data = data << 3; | 603 | data = data << 3; |
494 | 604 | ||
@@ -538,6 +648,9 @@ static int cx24123_pll_writereg(struct dvb_frontend* fe, struct dvb_frontend_par | |||
538 | static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 648 | static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
539 | { | 649 | { |
540 | struct cx24123_state *state = fe->demodulator_priv; | 650 | struct cx24123_state *state = fe->demodulator_priv; |
651 | u8 val; | ||
652 | |||
653 | dprintk("frequency=%i\n", p->frequency); | ||
541 | 654 | ||
542 | if (cx24123_pll_calculate(fe, p) != 0) { | 655 | if (cx24123_pll_calculate(fe, p) != 0) { |
543 | printk("%s: cx24123_pll_calcutate failed\n",__FUNCTION__); | 656 | printk("%s: cx24123_pll_calcutate failed\n",__FUNCTION__); |
@@ -552,6 +665,14 @@ static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_paramet | |||
552 | cx24123_pll_writereg(fe, p, state->bandselectarg); | 665 | cx24123_pll_writereg(fe, p, state->bandselectarg); |
553 | cx24123_pll_writereg(fe, p, state->pllarg); | 666 | cx24123_pll_writereg(fe, p, state->pllarg); |
554 | 667 | ||
668 | /* set the FILTUNE voltage */ | ||
669 | val = cx24123_readreg(state, 0x28) & ~0x3; | ||
670 | cx24123_writereg(state, 0x27, state->FILTune >> 2); | ||
671 | cx24123_writereg(state, 0x28, val | (state->FILTune & 0x3)); | ||
672 | |||
673 | dprintk("%s: pll tune VCA=%d, band=%d, pll=%d\n",__FUNCTION__,state->VCAarg, | ||
674 | state->bandselectarg,state->pllarg); | ||
675 | |||
555 | return 0; | 676 | return 0; |
556 | } | 677 | } |
557 | 678 | ||
@@ -560,6 +681,8 @@ static int cx24123_initfe(struct dvb_frontend* fe) | |||
560 | struct cx24123_state *state = fe->demodulator_priv; | 681 | struct cx24123_state *state = fe->demodulator_priv; |
561 | int i; | 682 | int i; |
562 | 683 | ||
684 | dprintk("%s: init frontend\n",__FUNCTION__); | ||
685 | |||
563 | /* Configure the demod to a good set of defaults */ | 686 | /* Configure the demod to a good set of defaults */ |
564 | for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++) | 687 | for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++) |
565 | cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data); | 688 | cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data); |
@@ -587,10 +710,13 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage | |||
587 | 710 | ||
588 | switch (voltage) { | 711 | switch (voltage) { |
589 | case SEC_VOLTAGE_13: | 712 | case SEC_VOLTAGE_13: |
713 | dprintk("%s: isl6421 voltage = 13V\n",__FUNCTION__); | ||
590 | return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */ | 714 | return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */ |
591 | case SEC_VOLTAGE_18: | 715 | case SEC_VOLTAGE_18: |
716 | dprintk("%s: isl6421 voltage = 18V\n",__FUNCTION__); | ||
592 | return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */ | 717 | return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */ |
593 | case SEC_VOLTAGE_OFF: | 718 | case SEC_VOLTAGE_OFF: |
719 | dprintk("%s: isl5421 voltage off\n",__FUNCTION__); | ||
594 | return cx24123_writelnbreg(state, 0x0, val & 0x30); | 720 | return cx24123_writelnbreg(state, 0x0, val & 0x30); |
595 | default: | 721 | default: |
596 | return -EINVAL; | 722 | return -EINVAL; |
@@ -624,13 +750,93 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage | |||
624 | return 0; | 750 | return 0; |
625 | } | 751 | } |
626 | 752 | ||
627 | static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, | 753 | /* wait for diseqc queue to become ready (or timeout) */ |
628 | struct dvb_diseqc_master_cmd *cmd) | 754 | static void cx24123_wait_for_diseqc(struct cx24123_state *state) |
755 | { | ||
756 | unsigned long timeout = jiffies + msecs_to_jiffies(200); | ||
757 | while (!(cx24123_readreg(state, 0x29) & 0x40)) { | ||
758 | if(time_after(jiffies, timeout)) { | ||
759 | printk("%s: diseqc queue not ready, command may be lost.\n", __FUNCTION__); | ||
760 | break; | ||
761 | } | ||
762 | msleep(10); | ||
763 | } | ||
764 | } | ||
765 | |||
766 | static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) | ||
629 | { | 767 | { |
630 | /* fixme: Implement diseqc */ | 768 | struct cx24123_state *state = fe->demodulator_priv; |
631 | printk("%s: No support yet\n",__FUNCTION__); | 769 | int i, val; |
770 | |||
771 | dprintk("%s:\n",__FUNCTION__); | ||
772 | |||
773 | /* check if continuous tone has been stopped */ | ||
774 | if (state->config->use_isl6421) | ||
775 | val = cx24123_readlnbreg(state, 0x00) & 0x10; | ||
776 | else | ||
777 | val = cx24123_readreg(state, 0x29) & 0x10; | ||
632 | 778 | ||
633 | return -ENOTSUPP; | 779 | |
780 | if (val) { | ||
781 | printk("%s: ERROR: attempt to send diseqc command before tone is off\n", __FUNCTION__); | ||
782 | return -ENOTSUPP; | ||
783 | } | ||
784 | |||
785 | /* wait for diseqc queue ready */ | ||
786 | cx24123_wait_for_diseqc(state); | ||
787 | |||
788 | /* select tone mode */ | ||
789 | cx24123_writereg(state, 0x2a, cx24123_readreg(state, 0x2a) & 0xf8); | ||
790 | |||
791 | for (i = 0; i < cmd->msg_len; i++) | ||
792 | cx24123_writereg(state, 0x2C + i, cmd->msg[i]); | ||
793 | |||
794 | val = cx24123_readreg(state, 0x29); | ||
795 | cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40) | ((cmd->msg_len-3) & 3)); | ||
796 | |||
797 | /* wait for diseqc message to finish sending */ | ||
798 | cx24123_wait_for_diseqc(state); | ||
799 | |||
800 | return 0; | ||
801 | } | ||
802 | |||
803 | static int cx24123_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) | ||
804 | { | ||
805 | struct cx24123_state *state = fe->demodulator_priv; | ||
806 | int val; | ||
807 | |||
808 | dprintk("%s:\n", __FUNCTION__); | ||
809 | |||
810 | /* check if continuous tone has been stoped */ | ||
811 | if (state->config->use_isl6421) | ||
812 | val = cx24123_readlnbreg(state, 0x00) & 0x10; | ||
813 | else | ||
814 | val = cx24123_readreg(state, 0x29) & 0x10; | ||
815 | |||
816 | |||
817 | if (val) { | ||
818 | printk("%s: ERROR: attempt to send diseqc command before tone is off\n", __FUNCTION__); | ||
819 | return -ENOTSUPP; | ||
820 | } | ||
821 | |||
822 | cx24123_wait_for_diseqc(state); | ||
823 | |||
824 | /* select tone mode */ | ||
825 | val = cx24123_readreg(state, 0x2a) & 0xf8; | ||
826 | cx24123_writereg(state, 0x2a, val | 0x04); | ||
827 | |||
828 | val = cx24123_readreg(state, 0x29); | ||
829 | |||
830 | if (burst == SEC_MINI_A) | ||
831 | cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40 | 0x00)); | ||
832 | else if (burst == SEC_MINI_B) | ||
833 | cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40 | 0x08)); | ||
834 | else | ||
835 | return -EINVAL; | ||
836 | |||
837 | cx24123_wait_for_diseqc(state); | ||
838 | |||
839 | return 0; | ||
634 | } | 840 | } |
635 | 841 | ||
636 | static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) | 842 | static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) |
@@ -642,13 +848,15 @@ static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
642 | 848 | ||
643 | *status = 0; | 849 | *status = 0; |
644 | if (lock & 0x01) | 850 | if (lock & 0x01) |
645 | *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL; | 851 | *status |= FE_HAS_SIGNAL; |
852 | if (sync & 0x02) | ||
853 | *status |= FE_HAS_CARRIER; | ||
646 | if (sync & 0x04) | 854 | if (sync & 0x04) |
647 | *status |= FE_HAS_VITERBI; | 855 | *status |= FE_HAS_VITERBI; |
648 | if (sync & 0x08) | 856 | if (sync & 0x08) |
649 | *status |= FE_HAS_CARRIER; | 857 | *status |= FE_HAS_SYNC; |
650 | if (sync & 0x80) | 858 | if (sync & 0x80) |
651 | *status |= FE_HAS_SYNC | FE_HAS_LOCK; | 859 | *status |= FE_HAS_LOCK; |
652 | 860 | ||
653 | return 0; | 861 | return 0; |
654 | } | 862 | } |
@@ -681,6 +889,8 @@ static int cx24123_read_ber(struct dvb_frontend* fe, u32* ber) | |||
681 | else | 889 | else |
682 | state->snr = 0; | 890 | state->snr = 0; |
683 | 891 | ||
892 | dprintk("%s: BER = %d, S/N index = %d\n",__FUNCTION__,state->lastber, state->snr); | ||
893 | |||
684 | *ber = state->lastber; | 894 | *ber = state->lastber; |
685 | 895 | ||
686 | return 0; | 896 | return 0; |
@@ -691,6 +901,8 @@ static int cx24123_read_signal_strength(struct dvb_frontend* fe, u16* signal_str | |||
691 | struct cx24123_state *state = fe->demodulator_priv; | 901 | struct cx24123_state *state = fe->demodulator_priv; |
692 | *signal_strength = cx24123_readreg(state, 0x3b) << 8; /* larger = better */ | 902 | *signal_strength = cx24123_readreg(state, 0x3b) << 8; /* larger = better */ |
693 | 903 | ||
904 | dprintk("%s: Signal strength = %d\n",__FUNCTION__,*signal_strength); | ||
905 | |||
694 | return 0; | 906 | return 0; |
695 | } | 907 | } |
696 | 908 | ||
@@ -699,6 +911,8 @@ static int cx24123_read_snr(struct dvb_frontend* fe, u16* snr) | |||
699 | struct cx24123_state *state = fe->demodulator_priv; | 911 | struct cx24123_state *state = fe->demodulator_priv; |
700 | *snr = state->snr; | 912 | *snr = state->snr; |
701 | 913 | ||
914 | dprintk("%s: read S/N index = %d\n",__FUNCTION__,*snr); | ||
915 | |||
702 | return 0; | 916 | return 0; |
703 | } | 917 | } |
704 | 918 | ||
@@ -707,6 +921,8 @@ static int cx24123_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
707 | struct cx24123_state *state = fe->demodulator_priv; | 921 | struct cx24123_state *state = fe->demodulator_priv; |
708 | *ucblocks = state->lastber; | 922 | *ucblocks = state->lastber; |
709 | 923 | ||
924 | dprintk("%s: ucblocks (ber) = %d\n",__FUNCTION__,*ucblocks); | ||
925 | |||
710 | return 0; | 926 | return 0; |
711 | } | 927 | } |
712 | 928 | ||
@@ -714,6 +930,8 @@ static int cx24123_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
714 | { | 930 | { |
715 | struct cx24123_state *state = fe->demodulator_priv; | 931 | struct cx24123_state *state = fe->demodulator_priv; |
716 | 932 | ||
933 | dprintk("%s: set_frontend\n",__FUNCTION__); | ||
934 | |||
717 | if (state->config->set_ts_params) | 935 | if (state->config->set_ts_params) |
718 | state->config->set_ts_params(fe, 0); | 936 | state->config->set_ts_params(fe, 0); |
719 | 937 | ||
@@ -737,6 +955,8 @@ static int cx24123_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
737 | { | 955 | { |
738 | struct cx24123_state *state = fe->demodulator_priv; | 956 | struct cx24123_state *state = fe->demodulator_priv; |
739 | 957 | ||
958 | dprintk("%s: get_frontend\n",__FUNCTION__); | ||
959 | |||
740 | if (cx24123_get_inversion(state, &p->inversion) != 0) { | 960 | if (cx24123_get_inversion(state, &p->inversion) != 0) { |
741 | printk("%s: Failed to get inversion status\n",__FUNCTION__); | 961 | printk("%s: Failed to get inversion status\n",__FUNCTION__); |
742 | return -EREMOTEIO; | 962 | return -EREMOTEIO; |
@@ -763,8 +983,10 @@ static int cx24123_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | |||
763 | 983 | ||
764 | switch (tone) { | 984 | switch (tone) { |
765 | case SEC_TONE_ON: | 985 | case SEC_TONE_ON: |
986 | dprintk("%s: isl6421 sec tone on\n",__FUNCTION__); | ||
766 | return cx24123_writelnbreg(state, 0x0, val | 0x10); | 987 | return cx24123_writelnbreg(state, 0x0, val | 0x10); |
767 | case SEC_TONE_OFF: | 988 | case SEC_TONE_OFF: |
989 | dprintk("%s: isl6421 sec tone off\n",__FUNCTION__); | ||
768 | return cx24123_writelnbreg(state, 0x0, val & 0x2f); | 990 | return cx24123_writelnbreg(state, 0x0, val & 0x2f); |
769 | default: | 991 | default: |
770 | printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); | 992 | printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); |
@@ -855,12 +1077,13 @@ static struct dvb_frontend_ops cx24123_ops = { | |||
855 | .frequency_min = 950000, | 1077 | .frequency_min = 950000, |
856 | .frequency_max = 2150000, | 1078 | .frequency_max = 2150000, |
857 | .frequency_stepsize = 1011, /* kHz for QPSK frontends */ | 1079 | .frequency_stepsize = 1011, /* kHz for QPSK frontends */ |
858 | .frequency_tolerance = 29500, | 1080 | .frequency_tolerance = 5000, |
859 | .symbol_rate_min = 1000000, | 1081 | .symbol_rate_min = 1000000, |
860 | .symbol_rate_max = 45000000, | 1082 | .symbol_rate_max = 45000000, |
861 | .caps = FE_CAN_INVERSION_AUTO | | 1083 | .caps = FE_CAN_INVERSION_AUTO | |
862 | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | | 1084 | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | |
863 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | | 1085 | FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | |
1086 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | | ||
864 | FE_CAN_QPSK | FE_CAN_RECOVER | 1087 | FE_CAN_QPSK | FE_CAN_RECOVER |
865 | }, | 1088 | }, |
866 | 1089 | ||
@@ -875,12 +1098,16 @@ static struct dvb_frontend_ops cx24123_ops = { | |||
875 | .read_snr = cx24123_read_snr, | 1098 | .read_snr = cx24123_read_snr, |
876 | .read_ucblocks = cx24123_read_ucblocks, | 1099 | .read_ucblocks = cx24123_read_ucblocks, |
877 | .diseqc_send_master_cmd = cx24123_send_diseqc_msg, | 1100 | .diseqc_send_master_cmd = cx24123_send_diseqc_msg, |
1101 | .diseqc_send_burst = cx24123_diseqc_send_burst, | ||
878 | .set_tone = cx24123_set_tone, | 1102 | .set_tone = cx24123_set_tone, |
879 | .set_voltage = cx24123_set_voltage, | 1103 | .set_voltage = cx24123_set_voltage, |
880 | }; | 1104 | }; |
881 | 1105 | ||
882 | module_param(debug, int, 0644); | 1106 | module_param(debug, int, 0644); |
883 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); | 1107 | MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)"); |
1108 | |||
1109 | module_param(force_band, int, 0644); | ||
1110 | MODULE_PARM_DESC(force_band, "Force a specific band select (1-9, default:off)."); | ||
884 | 1111 | ||
885 | MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24123/cx24109 hardware"); | 1112 | MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24123/cx24109 hardware"); |
886 | MODULE_AUTHOR("Steven Toth"); | 1113 | MODULE_AUTHOR("Steven Toth"); |
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index b6e2c387a04c..791706ec1da3 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -235,8 +235,8 @@ struct dvb_pll_desc dvb_pll_tdvs_tua6034 = { | |||
235 | .max = 863000000, | 235 | .max = 863000000, |
236 | .count = 3, | 236 | .count = 3, |
237 | .entries = { | 237 | .entries = { |
238 | { 160000000, 44000000, 62500, 0xce, 0x01 }, | 238 | { 165000000, 44000000, 62500, 0xce, 0x01 }, |
239 | { 455000000, 44000000, 62500, 0xce, 0x02 }, | 239 | { 450000000, 44000000, 62500, 0xce, 0x02 }, |
240 | { 999999999, 44000000, 62500, 0xce, 0x04 }, | 240 | { 999999999, 44000000, 62500, 0xce, 0x04 }, |
241 | }, | 241 | }, |
242 | }; | 242 | }; |
diff --git a/drivers/media/dvb/pluto2/Kconfig b/drivers/media/dvb/pluto2/Kconfig index 84f8f9f52869..7d8e6e87bdbb 100644 --- a/drivers/media/dvb/pluto2/Kconfig +++ b/drivers/media/dvb/pluto2/Kconfig | |||
@@ -1,7 +1,6 @@ | |||
1 | config DVB_PLUTO2 | 1 | config DVB_PLUTO2 |
2 | tristate "Pluto2 cards" | 2 | tristate "Pluto2 cards" |
3 | depends on DVB_CORE && PCI | 3 | depends on DVB_CORE && PCI && I2C |
4 | select I2C | ||
5 | select I2C_ALGOBIT | 4 | select I2C_ALGOBIT |
6 | select DVB_TDA1004X | 5 | select DVB_TDA1004X |
7 | help | 6 | help |
diff --git a/drivers/media/dvb/pluto2/Makefile b/drivers/media/dvb/pluto2/Makefile index 86ca84b2be6e..ce6a9aaf937e 100644 --- a/drivers/media/dvb/pluto2/Makefile +++ b/drivers/media/dvb/pluto2/Makefile | |||
@@ -1,3 +1,3 @@ | |||
1 | obj-$(CONFIG_DVB_PLUTO2) = pluto2.o | 1 | obj-$(CONFIG_DVB_PLUTO2) += pluto2.o |
2 | 2 | ||
3 | EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ | 3 | EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ |
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig index 5b2aadb8385c..b5ac7dfde52f 100644 --- a/drivers/media/dvb/ttpci/Kconfig +++ b/drivers/media/dvb/ttpci/Kconfig | |||
@@ -1,8 +1,7 @@ | |||
1 | config DVB_AV7110 | 1 | config DVB_AV7110 |
2 | tristate "AV7110 cards" | 2 | tristate "AV7110 cards" |
3 | depends on DVB_CORE && PCI | 3 | depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 |
4 | select FW_LOADER | 4 | select FW_LOADER |
5 | select VIDEO_DEV | ||
6 | select VIDEO_SAA7146_VV | 5 | select VIDEO_SAA7146_VV |
7 | select DVB_VES1820 | 6 | select DVB_VES1820 |
8 | select DVB_VES1X93 | 7 | select DVB_VES1X93 |
@@ -59,7 +58,7 @@ config DVB_AV7110_OSD | |||
59 | 58 | ||
60 | config DVB_BUDGET | 59 | config DVB_BUDGET |
61 | tristate "Budget cards" | 60 | tristate "Budget cards" |
62 | depends on DVB_CORE && PCI | 61 | depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 |
63 | select VIDEO_SAA7146 | 62 | select VIDEO_SAA7146 |
64 | select DVB_STV0299 | 63 | select DVB_STV0299 |
65 | select DVB_VES1X93 | 64 | select DVB_VES1X93 |
@@ -80,7 +79,7 @@ config DVB_BUDGET | |||
80 | 79 | ||
81 | config DVB_BUDGET_CI | 80 | config DVB_BUDGET_CI |
82 | tristate "Budget cards with onboard CI connector" | 81 | tristate "Budget cards with onboard CI connector" |
83 | depends on DVB_CORE && PCI | 82 | depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 |
84 | select VIDEO_SAA7146 | 83 | select VIDEO_SAA7146 |
85 | select DVB_STV0297 | 84 | select DVB_STV0297 |
86 | select DVB_STV0299 | 85 | select DVB_STV0299 |
@@ -100,8 +99,7 @@ config DVB_BUDGET_CI | |||
100 | 99 | ||
101 | config DVB_BUDGET_AV | 100 | config DVB_BUDGET_AV |
102 | tristate "Budget cards with analog video inputs" | 101 | tristate "Budget cards with analog video inputs" |
103 | depends on DVB_CORE && PCI | 102 | depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 |
104 | select VIDEO_DEV | ||
105 | select VIDEO_SAA7146_VV | 103 | select VIDEO_SAA7146_VV |
106 | select DVB_STV0299 | 104 | select DVB_STV0299 |
107 | select DVB_TDA1004X | 105 | select DVB_TDA1004X |
@@ -119,7 +117,7 @@ config DVB_BUDGET_AV | |||
119 | 117 | ||
120 | config DVB_BUDGET_PATCH | 118 | config DVB_BUDGET_PATCH |
121 | tristate "AV7110 cards with Budget Patch" | 119 | tristate "AV7110 cards with Budget Patch" |
122 | depends on DVB_CORE && DVB_BUDGET | 120 | depends on DVB_CORE && DVB_BUDGET && VIDEO_V4L1 |
123 | select DVB_AV7110 | 121 | select DVB_AV7110 |
124 | select DVB_STV0299 | 122 | select DVB_STV0299 |
125 | select DVB_VES1X93 | 123 | select DVB_VES1X93 |
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 8efe3ce5f66c..8a7cd7d505cf 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c | |||
@@ -1190,8 +1190,6 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio | |||
1190 | SAA7146_HPS_SYNC_PORT_A); | 1190 | SAA7146_HPS_SYNC_PORT_A); |
1191 | 1191 | ||
1192 | saa7113_setinput(budget_av, 0); | 1192 | saa7113_setinput(budget_av, 0); |
1193 | } else { | ||
1194 | ciintf_init(budget_av); | ||
1195 | } | 1193 | } |
1196 | 1194 | ||
1197 | /* fixme: find some sane values here... */ | 1195 | /* fixme: find some sane values here... */ |
@@ -1211,6 +1209,10 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio | |||
1211 | budget_av->budget.dvb_adapter.priv = budget_av; | 1209 | budget_av->budget.dvb_adapter.priv = budget_av; |
1212 | frontend_init(budget_av); | 1210 | frontend_init(budget_av); |
1213 | 1211 | ||
1212 | if (!budget_av->has_saa7113) { | ||
1213 | ciintf_init(budget_av); | ||
1214 | } | ||
1215 | |||
1214 | return 0; | 1216 | return 0; |
1215 | } | 1217 | } |
1216 | 1218 | ||
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 5f91036f5b87..e64a609cf4ff 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c | |||
@@ -71,6 +71,7 @@ struct budget_ci { | |||
71 | struct tasklet_struct msp430_irq_tasklet; | 71 | struct tasklet_struct msp430_irq_tasklet; |
72 | struct tasklet_struct ciintf_irq_tasklet; | 72 | struct tasklet_struct ciintf_irq_tasklet; |
73 | int slot_status; | 73 | int slot_status; |
74 | int ci_irq; | ||
74 | struct dvb_ca_en50221 ca; | 75 | struct dvb_ca_en50221 ca; |
75 | char ir_dev_name[50]; | 76 | char ir_dev_name[50]; |
76 | u8 tuner_pll_address; /* used for philips_tdm1316l configs */ | 77 | u8 tuner_pll_address; /* used for philips_tdm1316l configs */ |
@@ -276,8 +277,10 @@ static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot) | |||
276 | if (slot != 0) | 277 | if (slot != 0) |
277 | return -EINVAL; | 278 | return -EINVAL; |
278 | 279 | ||
279 | // trigger on RISING edge during reset so we know when READY is re-asserted | 280 | if (budget_ci->ci_irq) { |
280 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); | 281 | // trigger on RISING edge during reset so we know when READY is re-asserted |
282 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); | ||
283 | } | ||
281 | budget_ci->slot_status = SLOTSTATUS_RESET; | 284 | budget_ci->slot_status = SLOTSTATUS_RESET; |
282 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); | 285 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); |
283 | msleep(1); | 286 | msleep(1); |
@@ -370,11 +373,50 @@ static void ciintf_interrupt(unsigned long data) | |||
370 | } | 373 | } |
371 | } | 374 | } |
372 | 375 | ||
376 | static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open) | ||
377 | { | ||
378 | struct budget_ci *budget_ci = (struct budget_ci *) ca->data; | ||
379 | unsigned int flags; | ||
380 | |||
381 | // ensure we don't get spurious IRQs during initialisation | ||
382 | if (!budget_ci->budget.ci_present) | ||
383 | return -EINVAL; | ||
384 | |||
385 | // read the CAM status | ||
386 | flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); | ||
387 | if (flags & CICONTROL_CAMDETECT) { | ||
388 | // mark it as present if it wasn't before | ||
389 | if (budget_ci->slot_status & SLOTSTATUS_NONE) { | ||
390 | budget_ci->slot_status = SLOTSTATUS_PRESENT; | ||
391 | } | ||
392 | |||
393 | // during a RESET, we check if we can read from IO memory to see when CAM is ready | ||
394 | if (budget_ci->slot_status & SLOTSTATUS_RESET) { | ||
395 | if (ciintf_read_attribute_mem(ca, slot, 0) == 0x1d) { | ||
396 | budget_ci->slot_status = SLOTSTATUS_READY; | ||
397 | } | ||
398 | } | ||
399 | } else { | ||
400 | budget_ci->slot_status = SLOTSTATUS_NONE; | ||
401 | } | ||
402 | |||
403 | if (budget_ci->slot_status != SLOTSTATUS_NONE) { | ||
404 | if (budget_ci->slot_status & SLOTSTATUS_READY) { | ||
405 | return DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY; | ||
406 | } | ||
407 | return DVB_CA_EN50221_POLL_CAM_PRESENT; | ||
408 | } | ||
409 | |||
410 | return 0; | ||
411 | } | ||
412 | |||
373 | static int ciintf_init(struct budget_ci *budget_ci) | 413 | static int ciintf_init(struct budget_ci *budget_ci) |
374 | { | 414 | { |
375 | struct saa7146_dev *saa = budget_ci->budget.dev; | 415 | struct saa7146_dev *saa = budget_ci->budget.dev; |
376 | int flags; | 416 | int flags; |
377 | int result; | 417 | int result; |
418 | int ci_version; | ||
419 | int ca_flags; | ||
378 | 420 | ||
379 | memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221)); | 421 | memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221)); |
380 | 422 | ||
@@ -382,16 +424,29 @@ static int ciintf_init(struct budget_ci *budget_ci) | |||
382 | saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800); | 424 | saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800); |
383 | 425 | ||
384 | // test if it is there | 426 | // test if it is there |
385 | if ((ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0) & 0xa0) != 0xa0) { | 427 | ci_version = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0); |
428 | if ((ci_version & 0xa0) != 0xa0) { | ||
386 | result = -ENODEV; | 429 | result = -ENODEV; |
387 | goto error; | 430 | goto error; |
388 | } | 431 | } |
432 | |||
389 | // determine whether a CAM is present or not | 433 | // determine whether a CAM is present or not |
390 | flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); | 434 | flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); |
391 | budget_ci->slot_status = SLOTSTATUS_NONE; | 435 | budget_ci->slot_status = SLOTSTATUS_NONE; |
392 | if (flags & CICONTROL_CAMDETECT) | 436 | if (flags & CICONTROL_CAMDETECT) |
393 | budget_ci->slot_status = SLOTSTATUS_PRESENT; | 437 | budget_ci->slot_status = SLOTSTATUS_PRESENT; |
394 | 438 | ||
439 | // version 0xa2 of the CI firmware doesn't generate interrupts | ||
440 | if (ci_version == 0xa2) { | ||
441 | ca_flags = 0; | ||
442 | budget_ci->ci_irq = 0; | ||
443 | } else { | ||
444 | ca_flags = DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | | ||
445 | DVB_CA_EN50221_FLAG_IRQ_FR | | ||
446 | DVB_CA_EN50221_FLAG_IRQ_DA; | ||
447 | budget_ci->ci_irq = 1; | ||
448 | } | ||
449 | |||
395 | // register CI interface | 450 | // register CI interface |
396 | budget_ci->ca.owner = THIS_MODULE; | 451 | budget_ci->ca.owner = THIS_MODULE; |
397 | budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem; | 452 | budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem; |
@@ -401,23 +456,27 @@ static int ciintf_init(struct budget_ci *budget_ci) | |||
401 | budget_ci->ca.slot_reset = ciintf_slot_reset; | 456 | budget_ci->ca.slot_reset = ciintf_slot_reset; |
402 | budget_ci->ca.slot_shutdown = ciintf_slot_shutdown; | 457 | budget_ci->ca.slot_shutdown = ciintf_slot_shutdown; |
403 | budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; | 458 | budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; |
459 | budget_ci->ca.poll_slot_status = ciintf_poll_slot_status; | ||
404 | budget_ci->ca.data = budget_ci; | 460 | budget_ci->ca.data = budget_ci; |
405 | if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter, | 461 | if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter, |
406 | &budget_ci->ca, | 462 | &budget_ci->ca, |
407 | DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | | 463 | ca_flags, 1)) != 0) { |
408 | DVB_CA_EN50221_FLAG_IRQ_FR | | ||
409 | DVB_CA_EN50221_FLAG_IRQ_DA, 1)) != 0) { | ||
410 | printk("budget_ci: CI interface detected, but initialisation failed.\n"); | 464 | printk("budget_ci: CI interface detected, but initialisation failed.\n"); |
411 | goto error; | 465 | goto error; |
412 | } | 466 | } |
467 | |||
413 | // Setup CI slot IRQ | 468 | // Setup CI slot IRQ |
414 | tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci); | 469 | if (budget_ci->ci_irq) { |
415 | if (budget_ci->slot_status != SLOTSTATUS_NONE) { | 470 | tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci); |
416 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO); | 471 | if (budget_ci->slot_status != SLOTSTATUS_NONE) { |
417 | } else { | 472 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO); |
418 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); | 473 | } else { |
474 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); | ||
475 | } | ||
476 | saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03); | ||
419 | } | 477 | } |
420 | saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03); | 478 | |
479 | // enable interface | ||
421 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, | 480 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, |
422 | CICONTROL_RESET, 1, 0); | 481 | CICONTROL_RESET, 1, 0); |
423 | 482 | ||
@@ -426,10 +485,12 @@ static int ciintf_init(struct budget_ci *budget_ci) | |||
426 | budget_ci->budget.ci_present = 1; | 485 | budget_ci->budget.ci_present = 1; |
427 | 486 | ||
428 | // forge a fake CI IRQ so the CAM state is setup correctly | 487 | // forge a fake CI IRQ so the CAM state is setup correctly |
429 | flags = DVB_CA_EN50221_CAMCHANGE_REMOVED; | 488 | if (budget_ci->ci_irq) { |
430 | if (budget_ci->slot_status != SLOTSTATUS_NONE) | 489 | flags = DVB_CA_EN50221_CAMCHANGE_REMOVED; |
431 | flags = DVB_CA_EN50221_CAMCHANGE_INSERTED; | 490 | if (budget_ci->slot_status != SLOTSTATUS_NONE) |
432 | dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags); | 491 | flags = DVB_CA_EN50221_CAMCHANGE_INSERTED; |
492 | dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags); | ||
493 | } | ||
433 | 494 | ||
434 | return 0; | 495 | return 0; |
435 | 496 | ||
@@ -443,9 +504,13 @@ static void ciintf_deinit(struct budget_ci *budget_ci) | |||
443 | struct saa7146_dev *saa = budget_ci->budget.dev; | 504 | struct saa7146_dev *saa = budget_ci->budget.dev; |
444 | 505 | ||
445 | // disable CI interrupts | 506 | // disable CI interrupts |
446 | saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03); | 507 | if (budget_ci->ci_irq) { |
447 | saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); | 508 | saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03); |
448 | tasklet_kill(&budget_ci->ciintf_irq_tasklet); | 509 | saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); |
510 | tasklet_kill(&budget_ci->ciintf_irq_tasklet); | ||
511 | } | ||
512 | |||
513 | // reset interface | ||
449 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); | 514 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); |
450 | msleep(1); | 515 | msleep(1); |
451 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, | 516 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, |
@@ -473,7 +538,7 @@ static void budget_ci_irq(struct saa7146_dev *dev, u32 * isr) | |||
473 | if (*isr & MASK_10) | 538 | if (*isr & MASK_10) |
474 | ttpci_budget_irq10_handler(dev, isr); | 539 | ttpci_budget_irq10_handler(dev, isr); |
475 | 540 | ||
476 | if ((*isr & MASK_03) && (budget_ci->budget.ci_present)) | 541 | if ((*isr & MASK_03) && (budget_ci->budget.ci_present) && (budget_ci->ci_irq)) |
477 | tasklet_schedule(&budget_ci->ciintf_irq_tasklet); | 542 | tasklet_schedule(&budget_ci->ciintf_irq_tasklet); |
478 | } | 543 | } |
479 | 544 | ||
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 248fdc7accfb..6ceae38125c7 100644 --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |||
@@ -1507,7 +1507,11 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
1507 | 1507 | ||
1508 | mutex_unlock(&ttusb->semi2c); | 1508 | mutex_unlock(&ttusb->semi2c); |
1509 | 1509 | ||
1510 | dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE); | 1510 | if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE)) < 0) { |
1511 | ttusb_free_iso_urbs(ttusb); | ||
1512 | kfree(ttusb); | ||
1513 | return result; | ||
1514 | } | ||
1511 | ttusb->adapter.priv = ttusb; | 1515 | ttusb->adapter.priv = ttusb; |
1512 | 1516 | ||
1513 | /* i2c */ | 1517 | /* i2c */ |
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig index d318be383de6..3fff75763693 100644 --- a/drivers/media/radio/Kconfig +++ b/drivers/media/radio/Kconfig | |||
@@ -7,7 +7,7 @@ menu "Radio Adapters" | |||
7 | 7 | ||
8 | config RADIO_CADET | 8 | config RADIO_CADET |
9 | tristate "ADS Cadet AM/FM Tuner" | 9 | tristate "ADS Cadet AM/FM Tuner" |
10 | depends on ISA && VIDEO_DEV | 10 | depends on ISA && VIDEO_V4L1 |
11 | ---help--- | 11 | ---help--- |
12 | Choose Y here if you have one of these AM/FM radio cards, and then | 12 | Choose Y here if you have one of these AM/FM radio cards, and then |
13 | fill in the port address below. | 13 | fill in the port address below. |
@@ -25,7 +25,7 @@ config RADIO_CADET | |||
25 | 25 | ||
26 | config RADIO_RTRACK | 26 | config RADIO_RTRACK |
27 | tristate "AIMSlab RadioTrack (aka RadioReveal) support" | 27 | tristate "AIMSlab RadioTrack (aka RadioReveal) support" |
28 | depends on ISA && VIDEO_DEV | 28 | depends on ISA && VIDEO_V4L1 |
29 | ---help--- | 29 | ---help--- |
30 | Choose Y here if you have one of these FM radio cards, and then fill | 30 | Choose Y here if you have one of these FM radio cards, and then fill |
31 | in the port address below. | 31 | in the port address below. |
@@ -59,7 +59,7 @@ config RADIO_RTRACK_PORT | |||
59 | 59 | ||
60 | config RADIO_RTRACK2 | 60 | config RADIO_RTRACK2 |
61 | tristate "AIMSlab RadioTrack II support" | 61 | tristate "AIMSlab RadioTrack II support" |
62 | depends on ISA && VIDEO_DEV | 62 | depends on ISA && VIDEO_V4L1 |
63 | ---help--- | 63 | ---help--- |
64 | Choose Y here if you have this FM radio card, and then fill in the | 64 | Choose Y here if you have this FM radio card, and then fill in the |
65 | port address below. | 65 | port address below. |
@@ -82,7 +82,7 @@ config RADIO_RTRACK2_PORT | |||
82 | 82 | ||
83 | config RADIO_AZTECH | 83 | config RADIO_AZTECH |
84 | tristate "Aztech/Packard Bell Radio" | 84 | tristate "Aztech/Packard Bell Radio" |
85 | depends on ISA && VIDEO_DEV | 85 | depends on ISA && VIDEO_V4L1 |
86 | ---help--- | 86 | ---help--- |
87 | Choose Y here if you have one of these FM radio cards, and then fill | 87 | Choose Y here if you have one of these FM radio cards, and then fill |
88 | in the port address below. | 88 | in the port address below. |
@@ -106,7 +106,7 @@ config RADIO_AZTECH_PORT | |||
106 | 106 | ||
107 | config RADIO_GEMTEK | 107 | config RADIO_GEMTEK |
108 | tristate "GemTek Radio Card support" | 108 | tristate "GemTek Radio Card support" |
109 | depends on ISA && VIDEO_DEV | 109 | depends on ISA && VIDEO_V4L1 |
110 | ---help--- | 110 | ---help--- |
111 | Choose Y here if you have this FM radio card, and then fill in the | 111 | Choose Y here if you have this FM radio card, and then fill in the |
112 | port address below. | 112 | port address below. |
@@ -131,7 +131,7 @@ config RADIO_GEMTEK_PORT | |||
131 | 131 | ||
132 | config RADIO_GEMTEK_PCI | 132 | config RADIO_GEMTEK_PCI |
133 | tristate "GemTek PCI Radio Card support" | 133 | tristate "GemTek PCI Radio Card support" |
134 | depends on VIDEO_DEV && PCI | 134 | depends on VIDEO_V4L1 && PCI |
135 | ---help--- | 135 | ---help--- |
136 | Choose Y here if you have this PCI FM radio card. | 136 | Choose Y here if you have this PCI FM radio card. |
137 | 137 | ||
@@ -145,7 +145,7 @@ config RADIO_GEMTEK_PCI | |||
145 | 145 | ||
146 | config RADIO_MAXIRADIO | 146 | config RADIO_MAXIRADIO |
147 | tristate "Guillemot MAXI Radio FM 2000 radio" | 147 | tristate "Guillemot MAXI Radio FM 2000 radio" |
148 | depends on VIDEO_DEV && PCI | 148 | depends on VIDEO_V4L1 && PCI |
149 | ---help--- | 149 | ---help--- |
150 | Choose Y here if you have this radio card. This card may also be | 150 | Choose Y here if you have this radio card. This card may also be |
151 | found as Gemtek PCI FM. | 151 | found as Gemtek PCI FM. |
@@ -160,7 +160,7 @@ config RADIO_MAXIRADIO | |||
160 | 160 | ||
161 | config RADIO_MAESTRO | 161 | config RADIO_MAESTRO |
162 | tristate "Maestro on board radio" | 162 | tristate "Maestro on board radio" |
163 | depends on VIDEO_DEV | 163 | depends on VIDEO_V4L1 |
164 | ---help--- | 164 | ---help--- |
165 | Say Y here to directly support the on-board radio tuner on the | 165 | Say Y here to directly support the on-board radio tuner on the |
166 | Maestro 2 or 2E sound card. | 166 | Maestro 2 or 2E sound card. |
@@ -175,7 +175,7 @@ config RADIO_MAESTRO | |||
175 | 175 | ||
176 | config RADIO_MIROPCM20 | 176 | config RADIO_MIROPCM20 |
177 | tristate "miroSOUND PCM20 radio" | 177 | tristate "miroSOUND PCM20 radio" |
178 | depends on ISA && VIDEO_DEV && SOUND_ACI_MIXER | 178 | depends on ISA && VIDEO_V4L1 && SOUND_ACI_MIXER |
179 | ---help--- | 179 | ---help--- |
180 | Choose Y here if you have this FM radio card. You also need to say Y | 180 | Choose Y here if you have this FM radio card. You also need to say Y |
181 | to "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)" (in "Sound") | 181 | to "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)" (in "Sound") |
@@ -208,7 +208,7 @@ config RADIO_MIROPCM20_RDS | |||
208 | 208 | ||
209 | config RADIO_SF16FMI | 209 | config RADIO_SF16FMI |
210 | tristate "SF16FMI Radio" | 210 | tristate "SF16FMI Radio" |
211 | depends on ISA && VIDEO_DEV | 211 | depends on ISA && VIDEO_V4L1 |
212 | ---help--- | 212 | ---help--- |
213 | Choose Y here if you have one of these FM radio cards. If you | 213 | Choose Y here if you have one of these FM radio cards. If you |
214 | compile the driver into the kernel and your card is not PnP one, you | 214 | compile the driver into the kernel and your card is not PnP one, you |
@@ -225,7 +225,7 @@ config RADIO_SF16FMI | |||
225 | 225 | ||
226 | config RADIO_SF16FMR2 | 226 | config RADIO_SF16FMR2 |
227 | tristate "SF16FMR2 Radio" | 227 | tristate "SF16FMR2 Radio" |
228 | depends on ISA && VIDEO_DEV | 228 | depends on ISA && VIDEO_V4L1 |
229 | ---help--- | 229 | ---help--- |
230 | Choose Y here if you have one of these FM radio cards. | 230 | Choose Y here if you have one of these FM radio cards. |
231 | 231 | ||
@@ -239,7 +239,7 @@ config RADIO_SF16FMR2 | |||
239 | 239 | ||
240 | config RADIO_TERRATEC | 240 | config RADIO_TERRATEC |
241 | tristate "TerraTec ActiveRadio ISA Standalone" | 241 | tristate "TerraTec ActiveRadio ISA Standalone" |
242 | depends on ISA && VIDEO_DEV | 242 | depends on ISA && VIDEO_V4L1 |
243 | ---help--- | 243 | ---help--- |
244 | Choose Y here if you have this FM radio card, and then fill in the | 244 | Choose Y here if you have this FM radio card, and then fill in the |
245 | port address below. (TODO) | 245 | port address below. (TODO) |
@@ -268,7 +268,7 @@ config RADIO_TERRATEC_PORT | |||
268 | 268 | ||
269 | config RADIO_TRUST | 269 | config RADIO_TRUST |
270 | tristate "Trust FM radio card" | 270 | tristate "Trust FM radio card" |
271 | depends on ISA && VIDEO_DEV | 271 | depends on ISA && VIDEO_V4L1 |
272 | help | 272 | help |
273 | This is a driver for the Trust FM radio cards. Say Y if you have | 273 | This is a driver for the Trust FM radio cards. Say Y if you have |
274 | such a card and want to use it under Linux. | 274 | such a card and want to use it under Linux. |
@@ -286,7 +286,7 @@ config RADIO_TRUST_PORT | |||
286 | 286 | ||
287 | config RADIO_TYPHOON | 287 | config RADIO_TYPHOON |
288 | tristate "Typhoon Radio (a.k.a. EcoRadio)" | 288 | tristate "Typhoon Radio (a.k.a. EcoRadio)" |
289 | depends on ISA && VIDEO_DEV | 289 | depends on ISA && VIDEO_V4L1 |
290 | ---help--- | 290 | ---help--- |
291 | Choose Y here if you have one of these FM radio cards, and then fill | 291 | Choose Y here if you have one of these FM radio cards, and then fill |
292 | in the port address and the frequency used for muting below. | 292 | in the port address and the frequency used for muting below. |
@@ -330,7 +330,7 @@ config RADIO_TYPHOON_MUTEFREQ | |||
330 | 330 | ||
331 | config RADIO_ZOLTRIX | 331 | config RADIO_ZOLTRIX |
332 | tristate "Zoltrix Radio" | 332 | tristate "Zoltrix Radio" |
333 | depends on ISA && VIDEO_DEV | 333 | depends on ISA && VIDEO_V4L1 |
334 | ---help--- | 334 | ---help--- |
335 | Choose Y here if you have one of these FM radio cards, and then fill | 335 | Choose Y here if you have one of these FM radio cards, and then fill |
336 | in the port address below. | 336 | in the port address below. |
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 85888a8a93c9..6b4197018561 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -2,10 +2,10 @@ | |||
2 | # Multimedia Video device configuration | 2 | # Multimedia Video device configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | menu "Video For Linux" | 5 | menu "Video Capture Adapters" |
6 | depends on VIDEO_DEV | 6 | depends on VIDEO_DEV |
7 | 7 | ||
8 | comment "Video Adapters" | 8 | comment "Video Capture Adapters" |
9 | 9 | ||
10 | config VIDEO_ADV_DEBUG | 10 | config VIDEO_ADV_DEBUG |
11 | bool "Enable advanced debug functionality" | 11 | bool "Enable advanced debug functionality" |
@@ -16,11 +16,23 @@ config VIDEO_ADV_DEBUG | |||
16 | V4L devices. | 16 | V4L devices. |
17 | In doubt, say N. | 17 | In doubt, say N. |
18 | 18 | ||
19 | config VIDEO_VIVI | ||
20 | tristate "Virtual Video Driver" | ||
21 | depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 | ||
22 | select VIDEO_BUF | ||
23 | default n | ||
24 | ---help--- | ||
25 | Enables a virtual video driver. This device shows a color bar | ||
26 | and a timestamp, as a real device would generate by using V4L2 | ||
27 | api. | ||
28 | Say Y here if you want to test video apps or debug V4L devices. | ||
29 | In doubt, say N. | ||
30 | |||
19 | source "drivers/media/video/bt8xx/Kconfig" | 31 | source "drivers/media/video/bt8xx/Kconfig" |
20 | 32 | ||
21 | config VIDEO_SAA6588 | 33 | config VIDEO_SAA6588 |
22 | tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" | 34 | tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" |
23 | depends on VIDEO_DEV && I2C && VIDEO_BT848 | 35 | depends on I2C && VIDEO_BT848 |
24 | 36 | ||
25 | help | 37 | help |
26 | Support for Radio Data System (RDS) decoder. This allows seeing | 38 | Support for Radio Data System (RDS) decoder. This allows seeing |
@@ -32,7 +44,7 @@ config VIDEO_SAA6588 | |||
32 | 44 | ||
33 | config VIDEO_PMS | 45 | config VIDEO_PMS |
34 | tristate "Mediavision Pro Movie Studio Video For Linux" | 46 | tristate "Mediavision Pro Movie Studio Video For Linux" |
35 | depends on VIDEO_DEV && ISA | 47 | depends on ISA && VIDEO_V4L1 |
36 | help | 48 | help |
37 | Say Y if you have such a thing. | 49 | Say Y if you have such a thing. |
38 | 50 | ||
@@ -41,7 +53,7 @@ config VIDEO_PMS | |||
41 | 53 | ||
42 | config VIDEO_PLANB | 54 | config VIDEO_PLANB |
43 | tristate "PlanB Video-In on PowerMac" | 55 | tristate "PlanB Video-In on PowerMac" |
44 | depends on PPC_PMAC && VIDEO_DEV && BROKEN | 56 | depends on PPC_PMAC && VIDEO_V4L1 && BROKEN |
45 | help | 57 | help |
46 | PlanB is the V4L driver for the PowerMac 7x00/8x00 series video | 58 | PlanB is the V4L driver for the PowerMac 7x00/8x00 series video |
47 | input hardware. If you want to experiment with this, say Y. | 59 | input hardware. If you want to experiment with this, say Y. |
@@ -52,7 +64,7 @@ config VIDEO_PLANB | |||
52 | 64 | ||
53 | config VIDEO_BWQCAM | 65 | config VIDEO_BWQCAM |
54 | tristate "Quickcam BW Video For Linux" | 66 | tristate "Quickcam BW Video For Linux" |
55 | depends on VIDEO_DEV && PARPORT | 67 | depends on PARPORT && VIDEO_V4L1 |
56 | help | 68 | help |
57 | Say Y have if you the black and white version of the QuickCam | 69 | Say Y have if you the black and white version of the QuickCam |
58 | camera. See the next option for the color version. | 70 | camera. See the next option for the color version. |
@@ -62,7 +74,7 @@ config VIDEO_BWQCAM | |||
62 | 74 | ||
63 | config VIDEO_CQCAM | 75 | config VIDEO_CQCAM |
64 | tristate "QuickCam Colour Video For Linux (EXPERIMENTAL)" | 76 | tristate "QuickCam Colour Video For Linux (EXPERIMENTAL)" |
65 | depends on EXPERIMENTAL && VIDEO_DEV && PARPORT | 77 | depends on EXPERIMENTAL && PARPORT && VIDEO_V4L1 |
66 | help | 78 | help |
67 | This is the video4linux driver for the colour version of the | 79 | This is the video4linux driver for the colour version of the |
68 | Connectix QuickCam. If you have one of these cameras, say Y here, | 80 | Connectix QuickCam. If you have one of these cameras, say Y here, |
@@ -73,7 +85,7 @@ config VIDEO_CQCAM | |||
73 | 85 | ||
74 | config VIDEO_W9966 | 86 | config VIDEO_W9966 |
75 | tristate "W9966CF Webcam (FlyCam Supra and others) Video For Linux" | 87 | tristate "W9966CF Webcam (FlyCam Supra and others) Video For Linux" |
76 | depends on PARPORT_1284 && VIDEO_DEV && PARPORT | 88 | depends on PARPORT_1284 && PARPORT && VIDEO_V4L1 |
77 | help | 89 | help |
78 | Video4linux driver for Winbond's w9966 based Webcams. | 90 | Video4linux driver for Winbond's w9966 based Webcams. |
79 | Currently tested with the LifeView FlyCam Supra. | 91 | Currently tested with the LifeView FlyCam Supra. |
@@ -86,7 +98,7 @@ config VIDEO_W9966 | |||
86 | 98 | ||
87 | config VIDEO_CPIA | 99 | config VIDEO_CPIA |
88 | tristate "CPiA Video For Linux" | 100 | tristate "CPiA Video For Linux" |
89 | depends on VIDEO_DEV | 101 | depends on VIDEO_V4L1 |
90 | ---help--- | 102 | ---help--- |
91 | This is the video4linux driver for cameras based on Vision's CPiA | 103 | This is the video4linux driver for cameras based on Vision's CPiA |
92 | (Colour Processor Interface ASIC), such as the Creative Labs Video | 104 | (Colour Processor Interface ASIC), such as the Creative Labs Video |
@@ -123,7 +135,7 @@ source "drivers/media/video/cpia2/Kconfig" | |||
123 | 135 | ||
124 | config VIDEO_SAA5246A | 136 | config VIDEO_SAA5246A |
125 | tristate "SAA5246A, SAA5281 Teletext processor" | 137 | tristate "SAA5246A, SAA5281 Teletext processor" |
126 | depends on VIDEO_DEV && I2C | 138 | depends on I2C && VIDEO_V4L1 |
127 | help | 139 | help |
128 | Support for I2C bus based teletext using the SAA5246A or SAA5281 | 140 | Support for I2C bus based teletext using the SAA5246A or SAA5281 |
129 | chip. Useful only if you live in Europe. | 141 | chip. Useful only if you live in Europe. |
@@ -150,7 +162,7 @@ config TUNER_3036 | |||
150 | 162 | ||
151 | config VIDEO_VINO | 163 | config VIDEO_VINO |
152 | tristate "SGI Vino Video For Linux (EXPERIMENTAL)" | 164 | tristate "SGI Vino Video For Linux (EXPERIMENTAL)" |
153 | depends on VIDEO_DEV && I2C && SGI_IP22 && EXPERIMENTAL | 165 | depends on I2C && SGI_IP22 && EXPERIMENTAL && VIDEO_V4L1 |
154 | select I2C_ALGO_SGI | 166 | select I2C_ALGO_SGI |
155 | help | 167 | help |
156 | Say Y here to build in support for the Vino video input system found | 168 | Say Y here to build in support for the Vino video input system found |
@@ -158,7 +170,7 @@ config VIDEO_VINO | |||
158 | 170 | ||
159 | config VIDEO_STRADIS | 171 | config VIDEO_STRADIS |
160 | tristate "Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)" | 172 | tristate "Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)" |
161 | depends on EXPERIMENTAL && VIDEO_DEV && PCI | 173 | depends on EXPERIMENTAL && PCI && VIDEO_V4L1 && !PPC64 |
162 | help | 174 | help |
163 | Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video | 175 | Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video |
164 | driver for PCI. There is a product page at | 176 | driver for PCI. There is a product page at |
@@ -166,7 +178,7 @@ config VIDEO_STRADIS | |||
166 | 178 | ||
167 | config VIDEO_ZORAN | 179 | config VIDEO_ZORAN |
168 | tristate "Zoran ZR36057/36067 Video For Linux" | 180 | tristate "Zoran ZR36057/36067 Video For Linux" |
169 | depends on VIDEO_DEV && PCI && I2C_ALGOBIT | 181 | depends on PCI && I2C_ALGOBIT && VIDEO_V4L1 && !PPC64 |
170 | help | 182 | help |
171 | Say Y for support for MJPEG capture cards based on the Zoran | 183 | Say Y for support for MJPEG capture cards based on the Zoran |
172 | 36057/36067 PCI controller chipset. This includes the Iomega | 184 | 36057/36067 PCI controller chipset. This includes the Iomega |
@@ -214,7 +226,7 @@ config VIDEO_ZORAN_LML33R10 | |||
214 | 226 | ||
215 | config VIDEO_ZR36120 | 227 | config VIDEO_ZR36120 |
216 | tristate "Zoran ZR36120/36125 Video For Linux" | 228 | tristate "Zoran ZR36120/36125 Video For Linux" |
217 | depends on VIDEO_DEV && PCI && I2C && BROKEN | 229 | depends on PCI && I2C && VIDEO_V4L1 && BROKEN |
218 | help | 230 | help |
219 | Support for ZR36120/ZR36125 based frame grabber/overlay boards. | 231 | Support for ZR36120/ZR36125 based frame grabber/overlay boards. |
220 | This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV, | 232 | This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV, |
@@ -226,7 +238,7 @@ config VIDEO_ZR36120 | |||
226 | 238 | ||
227 | config VIDEO_MEYE | 239 | config VIDEO_MEYE |
228 | tristate "Sony Vaio Picturebook Motion Eye Video For Linux" | 240 | tristate "Sony Vaio Picturebook Motion Eye Video For Linux" |
229 | depends on VIDEO_DEV && PCI && SONYPI | 241 | depends on PCI && SONYPI && VIDEO_V4L1 |
230 | ---help--- | 242 | ---help--- |
231 | This is the video4linux driver for the Motion Eye camera found | 243 | This is the video4linux driver for the Motion Eye camera found |
232 | in the Vaio Picturebook laptops. Please read the material in | 244 | in the Vaio Picturebook laptops. Please read the material in |
@@ -242,7 +254,7 @@ source "drivers/media/video/saa7134/Kconfig" | |||
242 | 254 | ||
243 | config VIDEO_MXB | 255 | config VIDEO_MXB |
244 | tristate "Siemens-Nixdorf 'Multimedia eXtension Board'" | 256 | tristate "Siemens-Nixdorf 'Multimedia eXtension Board'" |
245 | depends on VIDEO_DEV && PCI | 257 | depends on PCI && VIDEO_V4L1 |
246 | select VIDEO_SAA7146_VV | 258 | select VIDEO_SAA7146_VV |
247 | select VIDEO_TUNER | 259 | select VIDEO_TUNER |
248 | ---help--- | 260 | ---help--- |
@@ -254,8 +266,9 @@ config VIDEO_MXB | |||
254 | 266 | ||
255 | config VIDEO_DPC | 267 | config VIDEO_DPC |
256 | tristate "Philips-Semiconductors 'dpc7146 demonstration board'" | 268 | tristate "Philips-Semiconductors 'dpc7146 demonstration board'" |
257 | depends on VIDEO_DEV && PCI | 269 | depends on PCI && VIDEO_V4L1 |
258 | select VIDEO_SAA7146_VV | 270 | select VIDEO_SAA7146_VV |
271 | select VIDEO_V4L2 | ||
259 | ---help--- | 272 | ---help--- |
260 | This is a video4linux driver for the 'dpc7146 demonstration | 273 | This is a video4linux driver for the 'dpc7146 demonstration |
261 | board' by Philips-Semiconductors. It's the reference design | 274 | board' by Philips-Semiconductors. It's the reference design |
@@ -268,8 +281,9 @@ config VIDEO_DPC | |||
268 | 281 | ||
269 | config VIDEO_HEXIUM_ORION | 282 | config VIDEO_HEXIUM_ORION |
270 | tristate "Hexium HV-PCI6 and Orion frame grabber" | 283 | tristate "Hexium HV-PCI6 and Orion frame grabber" |
271 | depends on VIDEO_DEV && PCI | 284 | depends on PCI && VIDEO_V4L1 |
272 | select VIDEO_SAA7146_VV | 285 | select VIDEO_SAA7146_VV |
286 | select VIDEO_V4L2 | ||
273 | ---help--- | 287 | ---help--- |
274 | This is a video4linux driver for the Hexium HV-PCI6 and | 288 | This is a video4linux driver for the Hexium HV-PCI6 and |
275 | Orion frame grabber cards by Hexium. | 289 | Orion frame grabber cards by Hexium. |
@@ -279,8 +293,9 @@ config VIDEO_HEXIUM_ORION | |||
279 | 293 | ||
280 | config VIDEO_HEXIUM_GEMINI | 294 | config VIDEO_HEXIUM_GEMINI |
281 | tristate "Hexium Gemini frame grabber" | 295 | tristate "Hexium Gemini frame grabber" |
282 | depends on VIDEO_DEV && PCI | 296 | depends on PCI && VIDEO_V4L1 |
283 | select VIDEO_SAA7146_VV | 297 | select VIDEO_SAA7146_VV |
298 | select VIDEO_V4L2 | ||
284 | ---help--- | 299 | ---help--- |
285 | This is a video4linux driver for the Hexium Gemini frame | 300 | This is a video4linux driver for the Hexium Gemini frame |
286 | grabber card by Hexium. Please note that the Gemini Dual | 301 | grabber card by Hexium. Please note that the Gemini Dual |
@@ -293,7 +308,7 @@ source "drivers/media/video/cx88/Kconfig" | |||
293 | 308 | ||
294 | config VIDEO_OVCAMCHIP | 309 | config VIDEO_OVCAMCHIP |
295 | tristate "OmniVision Camera Chip support" | 310 | tristate "OmniVision Camera Chip support" |
296 | depends on VIDEO_DEV && I2C | 311 | depends on I2C && VIDEO_V4L1 |
297 | ---help--- | 312 | ---help--- |
298 | Support for the OmniVision OV6xxx and OV7xxx series of camera chips. | 313 | Support for the OmniVision OV6xxx and OV7xxx series of camera chips. |
299 | This driver is intended to be used with the ov511 and w9968cf USB | 314 | This driver is intended to be used with the ov511 and w9968cf USB |
@@ -304,7 +319,7 @@ config VIDEO_OVCAMCHIP | |||
304 | 319 | ||
305 | config VIDEO_M32R_AR | 320 | config VIDEO_M32R_AR |
306 | tristate "AR devices" | 321 | tristate "AR devices" |
307 | depends on M32R | 322 | depends on M32R && VIDEO_V4L1 |
308 | ---help--- | 323 | ---help--- |
309 | This is a video4linux driver for the Renesas AR (Artificial Retina) | 324 | This is a video4linux driver for the Renesas AR (Artificial Retina) |
310 | camera module. | 325 | camera module. |
@@ -365,17 +380,17 @@ config VIDEO_WM8739 | |||
365 | source "drivers/media/video/cx25840/Kconfig" | 380 | source "drivers/media/video/cx25840/Kconfig" |
366 | 381 | ||
367 | config VIDEO_SAA711X | 382 | config VIDEO_SAA711X |
368 | tristate "Philips SAA7113/4/5 video decoders" | 383 | tristate "Philips SAA7113/4/5 video decoders (OBSOLETED)" |
369 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | 384 | depends on VIDEO_V4L1 && I2C && EXPERIMENTAL |
370 | ---help--- | 385 | ---help--- |
371 | Support for the Philips SAA7113/4/5 video decoders. | 386 | Old support for the Philips SAA7113/4 video decoders. |
372 | 387 | ||
373 | To compile this driver as a module, choose M here: the | 388 | To compile this driver as a module, choose M here: the |
374 | module will be called saa7115. | 389 | module will be called saa7115. |
375 | 390 | ||
376 | config VIDEO_SAA7127 | 391 | config VIDEO_SAA7127 |
377 | tristate "Philips SAA7127/9 digital video encoders" | 392 | tristate "Philips SAA7127/9 digital video encoders" |
378 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | 393 | depends on VIDEO_V4L2 && I2C && EXPERIMENTAL |
379 | ---help--- | 394 | ---help--- |
380 | Support for the Philips SAA7127/9 digital video encoders. | 395 | Support for the Philips SAA7127/9 digital video encoders. |
381 | 396 | ||
@@ -384,7 +399,7 @@ config VIDEO_SAA7127 | |||
384 | 399 | ||
385 | config VIDEO_UPD64031A | 400 | config VIDEO_UPD64031A |
386 | tristate "NEC Electronics uPD64031A Ghost Reduction" | 401 | tristate "NEC Electronics uPD64031A Ghost Reduction" |
387 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | 402 | depends on VIDEO_V4L2 && I2C && EXPERIMENTAL |
388 | ---help--- | 403 | ---help--- |
389 | Support for the NEC Electronics uPD64031A Ghost Reduction | 404 | Support for the NEC Electronics uPD64031A Ghost Reduction |
390 | video chip. It is most often found in NTSC TV cards made for | 405 | video chip. It is most often found in NTSC TV cards made for |
@@ -396,7 +411,7 @@ config VIDEO_UPD64031A | |||
396 | 411 | ||
397 | config VIDEO_UPD64083 | 412 | config VIDEO_UPD64083 |
398 | tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation" | 413 | tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation" |
399 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | 414 | depends on VIDEO_V4L2 && I2C && EXPERIMENTAL |
400 | ---help--- | 415 | ---help--- |
401 | Support for the NEC Electronics uPD64083 3-Dimensional Y/C | 416 | Support for the NEC Electronics uPD64083 3-Dimensional Y/C |
402 | separation video chip. It is used to improve the quality of | 417 | separation video chip. It is used to improve the quality of |
@@ -418,7 +433,7 @@ source "drivers/media/video/em28xx/Kconfig" | |||
418 | 433 | ||
419 | config USB_DSBR | 434 | config USB_DSBR |
420 | tristate "D-Link USB FM radio support (EXPERIMENTAL)" | 435 | tristate "D-Link USB FM radio support (EXPERIMENTAL)" |
421 | depends on USB && VIDEO_DEV && EXPERIMENTAL | 436 | depends on USB && VIDEO_V4L1 && EXPERIMENTAL |
422 | ---help--- | 437 | ---help--- |
423 | Say Y here if you want to connect this type of radio to your | 438 | Say Y here if you want to connect this type of radio to your |
424 | computer's USB port. Note that the audio is not digital, and | 439 | computer's USB port. Note that the audio is not digital, and |
@@ -434,7 +449,7 @@ source "drivers/media/video/et61x251/Kconfig" | |||
434 | 449 | ||
435 | config USB_OV511 | 450 | config USB_OV511 |
436 | tristate "USB OV511 Camera support" | 451 | tristate "USB OV511 Camera support" |
437 | depends on USB && VIDEO_DEV | 452 | depends on USB && VIDEO_V4L1 |
438 | ---help--- | 453 | ---help--- |
439 | Say Y here if you want to connect this type of camera to your | 454 | Say Y here if you want to connect this type of camera to your |
440 | computer's USB port. See <file:Documentation/video4linux/ov511.txt> | 455 | computer's USB port. See <file:Documentation/video4linux/ov511.txt> |
@@ -445,7 +460,7 @@ config USB_OV511 | |||
445 | 460 | ||
446 | config USB_SE401 | 461 | config USB_SE401 |
447 | tristate "USB SE401 Camera support" | 462 | tristate "USB SE401 Camera support" |
448 | depends on USB && VIDEO_DEV | 463 | depends on USB && VIDEO_V4L1 |
449 | ---help--- | 464 | ---help--- |
450 | Say Y here if you want to connect this type of camera to your | 465 | Say Y here if you want to connect this type of camera to your |
451 | computer's USB port. See <file:Documentation/video4linux/se401.txt> | 466 | computer's USB port. See <file:Documentation/video4linux/se401.txt> |
@@ -458,7 +473,7 @@ source "drivers/media/video/sn9c102/Kconfig" | |||
458 | 473 | ||
459 | config USB_STV680 | 474 | config USB_STV680 |
460 | tristate "USB STV680 (Pencam) Camera support" | 475 | tristate "USB STV680 (Pencam) Camera support" |
461 | depends on USB && VIDEO_DEV | 476 | depends on USB && VIDEO_V4L1 |
462 | ---help--- | 477 | ---help--- |
463 | Say Y here if you want to connect this type of camera to your | 478 | Say Y here if you want to connect this type of camera to your |
464 | computer's USB port. This includes the Pencam line of cameras. | 479 | computer's USB port. This includes the Pencam line of cameras. |
@@ -470,7 +485,7 @@ config USB_STV680 | |||
470 | 485 | ||
471 | config USB_W9968CF | 486 | config USB_W9968CF |
472 | tristate "USB W996[87]CF JPEG Dual Mode Camera support" | 487 | tristate "USB W996[87]CF JPEG Dual Mode Camera support" |
473 | depends on USB && VIDEO_DEV && I2C | 488 | depends on USB && VIDEO_V4L1 && I2C |
474 | select VIDEO_OVCAMCHIP | 489 | select VIDEO_OVCAMCHIP |
475 | ---help--- | 490 | ---help--- |
476 | Say Y here if you want support for cameras based on OV681 or | 491 | Say Y here if you want support for cameras based on OV681 or |
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index b3ea2d63db9b..e5bf2687b76d 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile | |||
@@ -10,7 +10,11 @@ tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \ | |||
10 | 10 | ||
11 | msp3400-objs := msp3400-driver.o msp3400-kthreads.o | 11 | msp3400-objs := msp3400-driver.o msp3400-kthreads.o |
12 | 12 | ||
13 | obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o compat_ioctl32.o | 13 | obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o |
14 | |||
15 | ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y) | ||
16 | obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o | ||
17 | endif | ||
14 | 18 | ||
15 | obj-$(CONFIG_VIDEO_BT848) += bt8xx/ | 19 | obj-$(CONFIG_VIDEO_BT848) += bt8xx/ |
16 | obj-$(CONFIG_VIDEO_BT848) += tvaudio.o tda7432.o tda9875.o ir-kbd-i2c.o | 20 | obj-$(CONFIG_VIDEO_BT848) += tvaudio.o tda7432.o tda9875.o ir-kbd-i2c.o |
@@ -84,4 +88,8 @@ obj-$(CONFIG_USB_IBMCAM) += usbvideo/ | |||
84 | obj-$(CONFIG_USB_KONICAWC) += usbvideo/ | 88 | obj-$(CONFIG_USB_KONICAWC) += usbvideo/ |
85 | obj-$(CONFIG_USB_VICAM) += usbvideo/ | 89 | obj-$(CONFIG_USB_VICAM) += usbvideo/ |
86 | 90 | ||
91 | obj-$(CONFIG_VIDEO_VIVI) += vivi.o | ||
92 | |||
87 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core | 93 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core |
94 | extra-cflags-$(CONFIG_VIDEO_V4L1_COMPAT) += -DCONFIG_VIDEO_V4L1_COMPAT | ||
95 | |||
diff --git a/drivers/media/video/bt8xx/Kconfig b/drivers/media/video/bt8xx/Kconfig index 085477c12612..153f6a4a96c9 100644 --- a/drivers/media/video/bt8xx/Kconfig +++ b/drivers/media/video/bt8xx/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config VIDEO_BT848 | 1 | config VIDEO_BT848 |
2 | tristate "BT848 Video For Linux" | 2 | tristate "BT848 Video For Linux" |
3 | depends on VIDEO_DEV && PCI && I2C | 3 | depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 |
4 | select I2C_ALGOBIT | 4 | select I2C_ALGOBIT |
5 | select FW_LOADER | 5 | select FW_LOADER |
6 | select VIDEO_BTCX | 6 | select VIDEO_BTCX |
diff --git a/drivers/media/video/bt8xx/Makefile b/drivers/media/video/bt8xx/Makefile index db641a36b197..a096a03418aa 100644 --- a/drivers/media/video/bt8xx/Makefile +++ b/drivers/media/video/bt8xx/Makefile | |||
@@ -8,5 +8,5 @@ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \ | |||
8 | 8 | ||
9 | obj-$(CONFIG_VIDEO_BT848) += bttv.o | 9 | obj-$(CONFIG_VIDEO_BT848) += bttv.o |
10 | 10 | ||
11 | EXTRA_CFLAGS += -I$(src)/.. | 11 | EXTRA_CFLAGS += -Idrivers/media/video |
12 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core | 12 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core |
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index f209a7492051..2b64aa835b42 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c | |||
@@ -2991,13 +2991,13 @@ void __devinit bttv_idcard(struct bttv *btv) | |||
2991 | 2991 | ||
2992 | if (UNSET != audiomux[0]) { | 2992 | if (UNSET != audiomux[0]) { |
2993 | gpiobits = 0; | 2993 | gpiobits = 0; |
2994 | for (i = 0; i < 5; i++) { | 2994 | for (i = 0; i < 4; i++) { |
2995 | bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; | 2995 | bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; |
2996 | gpiobits |= audiomux[i]; | 2996 | gpiobits |= audiomux[i]; |
2997 | } | 2997 | } |
2998 | } else { | 2998 | } else { |
2999 | gpiobits = audioall; | 2999 | gpiobits = audioall; |
3000 | for (i = 0; i < 5; i++) { | 3000 | for (i = 0; i < 4; i++) { |
3001 | bttv_tvcards[btv->c.type].gpiomux[i] = audioall; | 3001 | bttv_tvcards[btv->c.type].gpiomux[i] = audioall; |
3002 | } | 3002 | } |
3003 | } | 3003 | } |
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c index 16323a5d68ac..afcfe71e3792 100644 --- a/drivers/media/video/bt8xx/bttv-risc.c +++ b/drivers/media/video/bt8xx/bttv-risc.c | |||
@@ -233,7 +233,7 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, | |||
233 | const struct bttv_format *fmt, struct bttv_overlay *ov, | 233 | const struct bttv_format *fmt, struct bttv_overlay *ov, |
234 | int skip_even, int skip_odd) | 234 | int skip_even, int skip_odd) |
235 | { | 235 | { |
236 | int instructions,rc,line,maxy,start,end,skip,nskips; | 236 | int dwords,rc,line,maxy,start,end,skip,nskips; |
237 | struct btcx_skiplist *skips; | 237 | struct btcx_skiplist *skips; |
238 | u32 *rp,ri,ra; | 238 | u32 *rp,ri,ra; |
239 | u32 addr; | 239 | u32 addr; |
@@ -242,12 +242,12 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, | |||
242 | if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL))) | 242 | if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL))) |
243 | return -ENOMEM; | 243 | return -ENOMEM; |
244 | 244 | ||
245 | /* estimate risc mem: worst case is (clip+1) * lines instructions | 245 | /* estimate risc mem: worst case is (1.5*clip+1) * lines instructions |
246 | + sync + jump (all 2 dwords) */ | 246 | + sync + jump (all 2 dwords) */ |
247 | instructions = (ov->nclips + 1) * | 247 | dwords = (3 * ov->nclips + 2) * |
248 | ((skip_even || skip_odd) ? ov->w.height>>1 : ov->w.height); | 248 | ((skip_even || skip_odd) ? (ov->w.height+1)>>1 : ov->w.height); |
249 | instructions += 2; | 249 | dwords += 4; |
250 | if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*8)) < 0) { | 250 | if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,dwords*4)) < 0) { |
251 | kfree(skips); | 251 | kfree(skips); |
252 | return rc; | 252 | return rc; |
253 | } | 253 | } |
@@ -276,8 +276,6 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, | |||
276 | if (line > maxy) | 276 | if (line > maxy) |
277 | btcx_calc_skips(line, ov->w.width, &maxy, | 277 | btcx_calc_skips(line, ov->w.width, &maxy, |
278 | skips, &nskips, ov->clips, ov->nclips); | 278 | skips, &nskips, ov->clips, ov->nclips); |
279 | else | ||
280 | nskips = 0; | ||
281 | 279 | ||
282 | /* write out risc code */ | 280 | /* write out risc code */ |
283 | for (start = 0, skip = 0; start < ov->w.width; start = end) { | 281 | for (start = 0, skip = 0; start < ov->w.width; start = end) { |
diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c index f59ced181c55..1958d4016ea1 100644 --- a/drivers/media/video/cx25840/cx25840-firmware.c +++ b/drivers/media/video/cx25840/cx25840-firmware.c | |||
@@ -39,29 +39,12 @@ | |||
39 | 39 | ||
40 | #define FWDEV(x) &((x)->adapter->dev) | 40 | #define FWDEV(x) &((x)->adapter->dev) |
41 | 41 | ||
42 | static int fastfw = 1; | ||
43 | static char *firmware = FWFILE; | 42 | static char *firmware = FWFILE; |
44 | 43 | ||
45 | module_param(fastfw, bool, 0444); | ||
46 | module_param(firmware, charp, 0444); | 44 | module_param(firmware, charp, 0444); |
47 | 45 | ||
48 | MODULE_PARM_DESC(fastfw, "Load firmware fast [0=100MHz 1=333MHz (default)]"); | ||
49 | MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]"); | 46 | MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]"); |
50 | 47 | ||
51 | static void set_i2c_delay(struct i2c_client *client, int delay) | ||
52 | { | ||
53 | struct i2c_algo_bit_data *algod = client->adapter->algo_data; | ||
54 | |||
55 | /* We aren't guaranteed to be using algo_bit, | ||
56 | * so avoid the null pointer dereference | ||
57 | * and disable the 'fast firmware load' */ | ||
58 | if (algod) { | ||
59 | algod->udelay = delay; | ||
60 | } else { | ||
61 | fastfw = 0; | ||
62 | } | ||
63 | } | ||
64 | |||
65 | static void start_fw_load(struct i2c_client *client) | 48 | static void start_fw_load(struct i2c_client *client) |
66 | { | 49 | { |
67 | /* DL_ADDR_LB=0 DL_ADDR_HB=0 */ | 50 | /* DL_ADDR_LB=0 DL_ADDR_HB=0 */ |
@@ -71,16 +54,10 @@ static void start_fw_load(struct i2c_client *client) | |||
71 | cx25840_write(client, 0x803, 0x0b); | 54 | cx25840_write(client, 0x803, 0x0b); |
72 | /* AUTO_INC_DIS=1 */ | 55 | /* AUTO_INC_DIS=1 */ |
73 | cx25840_write(client, 0x000, 0x20); | 56 | cx25840_write(client, 0x000, 0x20); |
74 | |||
75 | if (fastfw) | ||
76 | set_i2c_delay(client, 3); | ||
77 | } | 57 | } |
78 | 58 | ||
79 | static void end_fw_load(struct i2c_client *client) | 59 | static void end_fw_load(struct i2c_client *client) |
80 | { | 60 | { |
81 | if (fastfw) | ||
82 | set_i2c_delay(client, 10); | ||
83 | |||
84 | /* AUTO_INC_DIS=0 */ | 61 | /* AUTO_INC_DIS=0 */ |
85 | cx25840_write(client, 0x000, 0x00); | 62 | cx25840_write(client, 0x000, 0x00); |
86 | /* DL_ENABLE=0 */ | 63 | /* DL_ENABLE=0 */ |
@@ -107,30 +84,8 @@ static int fw_write(struct i2c_client *client, u8 * data, int size) | |||
107 | int sent; | 84 | int sent; |
108 | 85 | ||
109 | if ((sent = i2c_master_send(client, data, size)) < size) { | 86 | if ((sent = i2c_master_send(client, data, size)) < size) { |
110 | 87 | v4l_err(client, "firmware load i2c failure\n"); | |
111 | if (fastfw) { | 88 | return -ENOSYS; |
112 | v4l_err(client, "333MHz i2c firmware load failed\n"); | ||
113 | fastfw = 0; | ||
114 | set_i2c_delay(client, 10); | ||
115 | |||
116 | if (sent > 2) { | ||
117 | u16 dl_addr = cx25840_read(client, 0x801) << 8; | ||
118 | dl_addr |= cx25840_read(client, 0x800); | ||
119 | dl_addr -= sent - 2; | ||
120 | cx25840_write(client, 0x801, dl_addr >> 8); | ||
121 | cx25840_write(client, 0x800, dl_addr & 0xff); | ||
122 | } | ||
123 | |||
124 | if (i2c_master_send(client, data, size) < size) { | ||
125 | v4l_err(client, "100MHz i2c firmware load failed\n"); | ||
126 | return -ENOSYS; | ||
127 | } | ||
128 | |||
129 | } else { | ||
130 | v4l_err(client, "firmware load i2c failure\n"); | ||
131 | return -ENOSYS; | ||
132 | } | ||
133 | |||
134 | } | 89 | } |
135 | 90 | ||
136 | return 0; | 91 | return 0; |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index c7042cf41231..f80154b87d22 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -564,7 +564,7 @@ struct cx88_board cx88_boards[] = { | |||
564 | }, | 564 | }, |
565 | [CX88_BOARD_PCHDTV_HD3000] = { | 565 | [CX88_BOARD_PCHDTV_HD3000] = { |
566 | .name = "pcHDTV HD3000 HDTV", | 566 | .name = "pcHDTV HD3000 HDTV", |
567 | .tuner_type = TUNER_THOMSON_DTT7610, | 567 | .tuner_type = TUNER_THOMSON_DTT761X, |
568 | .radio_type = UNSET, | 568 | .radio_type = UNSET, |
569 | .tuner_addr = ADDR_UNSET, | 569 | .tuner_addr = ADDR_UNSET, |
570 | .radio_addr = ADDR_UNSET, | 570 | .radio_addr = ADDR_UNSET, |
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 2c3d9f1999be..e1092d5d4628 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -146,9 +146,11 @@ int cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |||
146 | fields++; | 146 | fields++; |
147 | 147 | ||
148 | /* estimate risc mem: worst case is one write per page border + | 148 | /* estimate risc mem: worst case is one write per page border + |
149 | one write per scan line + syncs + jump (all 2 dwords) */ | 149 | one write per scan line + syncs + jump (all 2 dwords). Padding |
150 | instructions = (bpl * lines * fields) / PAGE_SIZE + lines * fields; | 150 | can cause next bpl to start close to a page border. First DMA |
151 | instructions += 3 + 4; | 151 | region may be smaller than PAGE_SIZE */ |
152 | instructions = fields * (1 + ((bpl + padding) * lines) / PAGE_SIZE + lines); | ||
153 | instructions += 2; | ||
152 | if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) | 154 | if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) |
153 | return rc; | 155 | return rc; |
154 | 156 | ||
@@ -176,9 +178,11 @@ int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |||
176 | int rc; | 178 | int rc; |
177 | 179 | ||
178 | /* estimate risc mem: worst case is one write per page border + | 180 | /* estimate risc mem: worst case is one write per page border + |
179 | one write per scan line + syncs + jump (all 2 dwords) */ | 181 | one write per scan line + syncs + jump (all 2 dwords). Here |
180 | instructions = (bpl * lines) / PAGE_SIZE + lines; | 182 | there is no padding and no sync. First DMA region may be smaller |
181 | instructions += 3 + 4; | 183 | than PAGE_SIZE */ |
184 | instructions = 1 + (bpl * lines) / PAGE_SIZE + lines; | ||
185 | instructions += 1; | ||
182 | if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) | 186 | if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) |
183 | return rc; | 187 | return rc; |
184 | 188 | ||
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index f0ea9b5cdbc2..3619a449aefd 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -372,7 +372,7 @@ static int or51132_set_ts_param(struct dvb_frontend* fe, | |||
372 | static struct or51132_config pchdtv_hd3000 = { | 372 | static struct or51132_config pchdtv_hd3000 = { |
373 | .demod_address = 0x15, | 373 | .demod_address = 0x15, |
374 | .pll_address = 0x61, | 374 | .pll_address = 0x61, |
375 | .pll_desc = &dvb_pll_thomson_dtt7610, | 375 | .pll_desc = &dvb_pll_thomson_dtt761x, |
376 | .set_ts_params = or51132_set_ts_param, | 376 | .set_ts_params = or51132_set_ts_param, |
377 | }; | 377 | }; |
378 | #endif | 378 | #endif |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 72a417b31745..694d1d80ff3f 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -35,8 +35,10 @@ | |||
35 | #include "cx88.h" | 35 | #include "cx88.h" |
36 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
37 | 37 | ||
38 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
38 | /* Include V4L1 specific functions. Should be removed soon */ | 39 | /* Include V4L1 specific functions. Should be removed soon */ |
39 | #include <linux/videodev.h> | 40 | #include <linux/videodev.h> |
41 | #endif | ||
40 | 42 | ||
41 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); | 43 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); |
42 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | 44 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig index 5a793ae7cc23..dfb15bfb83dc 100644 --- a/drivers/media/video/em28xx/Kconfig +++ b/drivers/media/video/em28xx/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config VIDEO_EM28XX | 1 | config VIDEO_EM28XX |
2 | tristate "Empia EM2800/2820/2840 USB video capture support" | 2 | tristate "Empia EM2800/2820/2840 USB video capture support" |
3 | depends on VIDEO_DEV && USB && I2C | 3 | depends on VIDEO_V4L1 && USB && I2C |
4 | select VIDEO_BUF | 4 | select VIDEO_BUF |
5 | select VIDEO_TUNER | 5 | select VIDEO_TUNER |
6 | select VIDEO_TVEEPROM | 6 | select VIDEO_TVEEPROM |
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index ddc92cbb5276..cf7cdf9ef617 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1576,8 +1576,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1576 | errCode = em28xx_config(dev); | 1576 | errCode = em28xx_config(dev); |
1577 | if (errCode) { | 1577 | if (errCode) { |
1578 | em28xx_errdev("error configuring device\n"); | 1578 | em28xx_errdev("error configuring device\n"); |
1579 | kfree(dev); | ||
1580 | em28xx_devused&=~(1<<dev->devno); | 1579 | em28xx_devused&=~(1<<dev->devno); |
1580 | kfree(dev); | ||
1581 | return -ENOMEM; | 1581 | return -ENOMEM; |
1582 | } | 1582 | } |
1583 | 1583 | ||
@@ -1603,8 +1603,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1603 | dev->vdev = video_device_alloc(); | 1603 | dev->vdev = video_device_alloc(); |
1604 | if (NULL == dev->vdev) { | 1604 | if (NULL == dev->vdev) { |
1605 | em28xx_errdev("cannot allocate video_device.\n"); | 1605 | em28xx_errdev("cannot allocate video_device.\n"); |
1606 | kfree(dev); | ||
1607 | em28xx_devused&=~(1<<dev->devno); | 1606 | em28xx_devused&=~(1<<dev->devno); |
1607 | kfree(dev); | ||
1608 | return -ENOMEM; | 1608 | return -ENOMEM; |
1609 | } | 1609 | } |
1610 | 1610 | ||
@@ -1612,8 +1612,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1612 | if (NULL == dev->vbi_dev) { | 1612 | if (NULL == dev->vbi_dev) { |
1613 | em28xx_errdev("cannot allocate video_device.\n"); | 1613 | em28xx_errdev("cannot allocate video_device.\n"); |
1614 | kfree(dev->vdev); | 1614 | kfree(dev->vdev); |
1615 | kfree(dev); | ||
1616 | em28xx_devused&=~(1<<dev->devno); | 1615 | em28xx_devused&=~(1<<dev->devno); |
1616 | kfree(dev); | ||
1617 | return -ENOMEM; | 1617 | return -ENOMEM; |
1618 | } | 1618 | } |
1619 | 1619 | ||
@@ -1650,8 +1650,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1650 | mutex_unlock(&dev->lock); | 1650 | mutex_unlock(&dev->lock); |
1651 | list_del(&dev->devlist); | 1651 | list_del(&dev->devlist); |
1652 | video_device_release(dev->vdev); | 1652 | video_device_release(dev->vdev); |
1653 | kfree(dev); | ||
1654 | em28xx_devused&=~(1<<dev->devno); | 1653 | em28xx_devused&=~(1<<dev->devno); |
1654 | kfree(dev); | ||
1655 | return -ENODEV; | 1655 | return -ENODEV; |
1656 | } | 1656 | } |
1657 | 1657 | ||
@@ -1662,8 +1662,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1662 | list_del(&dev->devlist); | 1662 | list_del(&dev->devlist); |
1663 | video_device_release(dev->vbi_dev); | 1663 | video_device_release(dev->vbi_dev); |
1664 | video_device_release(dev->vdev); | 1664 | video_device_release(dev->vdev); |
1665 | kfree(dev); | ||
1666 | em28xx_devused&=~(1<<dev->devno); | 1665 | em28xx_devused&=~(1<<dev->devno); |
1666 | kfree(dev); | ||
1667 | return -ENODEV; | 1667 | return -ENODEV; |
1668 | } else { | 1668 | } else { |
1669 | printk("registered VBI\n"); | 1669 | printk("registered VBI\n"); |
diff --git a/drivers/media/video/et61x251/Kconfig b/drivers/media/video/et61x251/Kconfig index 6c43a90c6569..c6bff705688d 100644 --- a/drivers/media/video/et61x251/Kconfig +++ b/drivers/media/video/et61x251/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config USB_ET61X251 | 1 | config USB_ET61X251 |
2 | tristate "USB ET61X[12]51 PC Camera Controller support" | 2 | tristate "USB ET61X[12]51 PC Camera Controller support" |
3 | depends on USB && VIDEO_DEV | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y here if you want support for cameras based on Etoms ET61X151 | 5 | Say Y here if you want support for cameras based on Etoms ET61X151 |
6 | or ET61X251 PC Camera Controllers. | 6 | or ET61X251 PC Camera Controllers. |
diff --git a/drivers/media/video/pwc/Kconfig b/drivers/media/video/pwc/Kconfig index 86376556f108..53cbc950f95c 100644 --- a/drivers/media/video/pwc/Kconfig +++ b/drivers/media/video/pwc/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config USB_PWC | 1 | config USB_PWC |
2 | tristate "USB Philips Cameras" | 2 | tristate "USB Philips Cameras" |
3 | depends on USB && VIDEO_DEV | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y or M here if you want to use one of these Philips & OEM | 5 | Say Y or M here if you want to use one of these Philips & OEM |
6 | webcams: | 6 | webcams: |
diff --git a/drivers/media/video/pwc/Makefile b/drivers/media/video/pwc/Makefile index 8326684f49f3..33d60126c024 100644 --- a/drivers/media/video/pwc/Makefile +++ b/drivers/media/video/pwc/Makefile | |||
@@ -1,20 +1,3 @@ | |||
1 | ifneq ($(KERNELRELEASE),) | ||
2 | |||
3 | pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o | 1 | pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o |
4 | 2 | ||
5 | obj-$(CONFIG_USB_PWC) += pwc.o | 3 | obj-$(CONFIG_USB_PWC) += pwc.o |
6 | |||
7 | else | ||
8 | |||
9 | KDIR := /lib/modules/$(shell uname -r)/build | ||
10 | PWD := $(shell pwd) | ||
11 | |||
12 | default: | ||
13 | $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules | ||
14 | |||
15 | endif | ||
16 | |||
17 | clean: | ||
18 | rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c | ||
19 | rm -rf .tmp_versions | ||
20 | |||
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 133f9e5252fe..c271e2e14105 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -142,6 +142,7 @@ struct i2c_reg_value { | |||
142 | static const struct i2c_reg_value saa7129_init_config_extra[] = { | 142 | static const struct i2c_reg_value saa7129_init_config_extra[] = { |
143 | { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x38 }, | 143 | { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x38 }, |
144 | { SAA7127_REG_VTRIG, 0xfa }, | 144 | { SAA7127_REG_VTRIG, 0xfa }, |
145 | { 0, 0 } | ||
145 | }; | 146 | }; |
146 | 147 | ||
147 | static const struct i2c_reg_value saa7127_init_config_common[] = { | 148 | static const struct i2c_reg_value saa7127_init_config_common[] = { |
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index e666a4465ca4..86eae3528330 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -3504,6 +3504,7 @@ int saa7134_board_init1(struct saa7134_dev *dev) | |||
3504 | /* power-up tuner chip */ | 3504 | /* power-up tuner chip */ |
3505 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); | 3505 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); |
3506 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); | 3506 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); |
3507 | break; | ||
3507 | case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: | 3508 | case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: |
3508 | /* this turns the remote control chip off to work around a bug in it */ | 3509 | /* this turns the remote control chip off to work around a bug in it */ |
3509 | saa_writeb(SAA7134_GPIO_GPMODE1, 0x80); | 3510 | saa_writeb(SAA7134_GPIO_GPMODE1, 0x80); |
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 13de05532e0a..f0c2111f14ad 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -548,6 +548,8 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
548 | if (report & SAA7134_IRQ_REPORT_GPIO16) { | 548 | if (report & SAA7134_IRQ_REPORT_GPIO16) { |
549 | switch (dev->has_remote) { | 549 | switch (dev->has_remote) { |
550 | case SAA7134_REMOTE_GPIO: | 550 | case SAA7134_REMOTE_GPIO: |
551 | if (!dev->remote) | ||
552 | break; | ||
551 | if (dev->remote->mask_keydown & 0x10000) { | 553 | if (dev->remote->mask_keydown & 0x10000) { |
552 | saa7134_input_irq(dev); | 554 | saa7134_input_irq(dev); |
553 | } | 555 | } |
@@ -564,6 +566,8 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
564 | if (report & SAA7134_IRQ_REPORT_GPIO18) { | 566 | if (report & SAA7134_IRQ_REPORT_GPIO18) { |
565 | switch (dev->has_remote) { | 567 | switch (dev->has_remote) { |
566 | case SAA7134_REMOTE_GPIO: | 568 | case SAA7134_REMOTE_GPIO: |
569 | if (!dev->remote) | ||
570 | break; | ||
567 | if ((dev->remote->mask_keydown & 0x40000) || | 571 | if ((dev->remote->mask_keydown & 0x40000) || |
568 | (dev->remote->mask_keyup & 0x40000)) { | 572 | (dev->remote->mask_keyup & 0x40000)) { |
569 | saa7134_input_irq(dev); | 573 | saa7134_input_irq(dev); |
@@ -676,7 +680,7 @@ static int saa7134_hwinit2(struct saa7134_dev *dev) | |||
676 | SAA7134_IRQ2_INTE_PE | | 680 | SAA7134_IRQ2_INTE_PE | |
677 | SAA7134_IRQ2_INTE_AR; | 681 | SAA7134_IRQ2_INTE_AR; |
678 | 682 | ||
679 | if (dev->has_remote == SAA7134_REMOTE_GPIO) { | 683 | if (dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote) { |
680 | if (dev->remote->mask_keydown & 0x10000) | 684 | if (dev->remote->mask_keydown & 0x10000) |
681 | irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; | 685 | irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; |
682 | else if (dev->remote->mask_keydown & 0x40000) | 686 | else if (dev->remote->mask_keydown & 0x40000) |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index aeef80f88a6b..e4156ec9c6d7 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -31,8 +31,10 @@ | |||
31 | #include "saa7134.h" | 31 | #include "saa7134.h" |
32 | #include <media/v4l2-common.h> | 32 | #include <media/v4l2-common.h> |
33 | 33 | ||
34 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
34 | /* Include V4L1 specific functions. Should be removed soon */ | 35 | /* Include V4L1 specific functions. Should be removed soon */ |
35 | #include <linux/videodev.h> | 36 | #include <linux/videodev.h> |
37 | #endif | ||
36 | 38 | ||
37 | /* ------------------------------------------------------------------ */ | 39 | /* ------------------------------------------------------------------ */ |
38 | 40 | ||
diff --git a/drivers/media/video/sn9c102/Kconfig b/drivers/media/video/sn9c102/Kconfig index 55f2bc11964b..cf552e6b8ecf 100644 --- a/drivers/media/video/sn9c102/Kconfig +++ b/drivers/media/video/sn9c102/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config USB_SN9C102 | 1 | config USB_SN9C102 |
2 | tristate "USB SN9C10x PC Camera Controller support" | 2 | tristate "USB SN9C10x PC Camera Controller support" |
3 | depends on USB && VIDEO_DEV | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y here if you want support for cameras based on SONiX SN9C101, | 5 | Say Y here if you want support for cameras based on SONiX SN9C101, |
6 | SN9C102 or SN9C103 PC Camera Controllers. | 6 | SN9C102 or SN9C103 PC Camera Controllers. |
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c index 72e0f01db563..a1ae036b44ec 100644 --- a/drivers/media/video/tuner-types.c +++ b/drivers/media/video/tuner-types.c | |||
@@ -877,8 +877,8 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { | |||
877 | /* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */ | 877 | /* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */ |
878 | 878 | ||
879 | static struct tuner_range tuner_tua6034_ntsc_ranges[] = { | 879 | static struct tuner_range tuner_tua6034_ntsc_ranges[] = { |
880 | { 16 * 160.00 /*MHz*/, 0x8e, 0x01 }, | 880 | { 16 * 165.00 /*MHz*/, 0x8e, 0x01 }, |
881 | { 16 * 455.00 /*MHz*/, 0x8e, 0x02 }, | 881 | { 16 * 450.00 /*MHz*/, 0x8e, 0x02 }, |
882 | { 16 * 999.99 , 0x8e, 0x04 }, | 882 | { 16 * 999.99 , 0x8e, 0x04 }, |
883 | }; | 883 | }; |
884 | 884 | ||
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 431c3e2f6c42..b463e996961a 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -218,7 +218,7 @@ hauppauge_tuner[] = | |||
218 | /* 110-119 */ | 218 | /* 110-119 */ |
219 | { TUNER_ABSENT, "Thompson DTT75105"}, | 219 | { TUNER_ABSENT, "Thompson DTT75105"}, |
220 | { TUNER_ABSENT, "Conexant_CX24109"}, | 220 | { TUNER_ABSENT, "Conexant_CX24109"}, |
221 | { TUNER_ABSENT, "TCL M2523_5N_E"}, | 221 | { TUNER_TCL_2002N, "TCL M2523_5N_E"}, |
222 | { TUNER_ABSENT, "TCL M2523_3DB_E"}, | 222 | { TUNER_ABSENT, "TCL M2523_3DB_E"}, |
223 | { TUNER_ABSENT, "Philips 8275A"}, | 223 | { TUNER_ABSENT, "Philips 8275A"}, |
224 | { TUNER_ABSENT, "Microtune MT2060"}, | 224 | { TUNER_ABSENT, "Microtune MT2060"}, |
diff --git a/drivers/media/video/usbvideo/Kconfig b/drivers/media/video/usbvideo/Kconfig index 08a5d20bb2c0..39269a2c5635 100644 --- a/drivers/media/video/usbvideo/Kconfig +++ b/drivers/media/video/usbvideo/Kconfig | |||
@@ -3,7 +3,7 @@ config VIDEO_USBVIDEO | |||
3 | 3 | ||
4 | config USB_VICAM | 4 | config USB_VICAM |
5 | tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" | 5 | tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" |
6 | depends on USB && VIDEO_DEV && EXPERIMENTAL | 6 | depends on USB && VIDEO_V4L1 && EXPERIMENTAL |
7 | select VIDEO_USBVIDEO | 7 | select VIDEO_USBVIDEO |
8 | ---help--- | 8 | ---help--- |
9 | Say Y here if you have 3com homeconnect camera (vicam). | 9 | Say Y here if you have 3com homeconnect camera (vicam). |
@@ -13,7 +13,7 @@ config USB_VICAM | |||
13 | 13 | ||
14 | config USB_IBMCAM | 14 | config USB_IBMCAM |
15 | tristate "USB IBM (Xirlink) C-it Camera support" | 15 | tristate "USB IBM (Xirlink) C-it Camera support" |
16 | depends on USB && VIDEO_DEV | 16 | depends on USB && VIDEO_V4L1 |
17 | select VIDEO_USBVIDEO | 17 | select VIDEO_USBVIDEO |
18 | ---help--- | 18 | ---help--- |
19 | Say Y here if you want to connect a IBM "C-It" camera, also known as | 19 | Say Y here if you want to connect a IBM "C-It" camera, also known as |
@@ -28,7 +28,7 @@ config USB_IBMCAM | |||
28 | 28 | ||
29 | config USB_KONICAWC | 29 | config USB_KONICAWC |
30 | tristate "USB Konica Webcam support" | 30 | tristate "USB Konica Webcam support" |
31 | depends on USB && VIDEO_DEV | 31 | depends on USB && VIDEO_V4L1 |
32 | select VIDEO_USBVIDEO | 32 | select VIDEO_USBVIDEO |
33 | ---help--- | 33 | ---help--- |
34 | Say Y here if you want support for webcams based on a Konica | 34 | Say Y here if you want support for webcams based on a Konica |
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 5e813404d068..779db26771c0 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
@@ -26,6 +26,11 @@ | |||
26 | #include <linux/random.h> | 26 | #include <linux/random.h> |
27 | #include <linux/version.h> | 27 | #include <linux/version.h> |
28 | #include <linux/videodev2.h> | 28 | #include <linux/videodev2.h> |
29 | #include <linux/dma-mapping.h> | ||
30 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
31 | /* Include V4L1 specific functions. Should be removed soon */ | ||
32 | #include <linux/videodev.h> | ||
33 | #endif | ||
29 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
30 | #include <media/video-buf.h> | 35 | #include <media/video-buf.h> |
31 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
diff --git a/drivers/media/video/zc0301/Kconfig b/drivers/media/video/zc0301/Kconfig index c3bf886b80cd..115833e4f4dd 100644 --- a/drivers/media/video/zc0301/Kconfig +++ b/drivers/media/video/zc0301/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config USB_ZC0301 | 1 | config USB_ZC0301 |
2 | tristate "USB ZC0301 Image Processor and Control Chip support" | 2 | tristate "USB ZC0301 Image Processor and Control Chip support" |
3 | depends on USB && VIDEO_DEV | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y here if you want support for cameras based on the ZC0301 | 5 | Say Y here if you want support for cameras based on the ZC0301 |
6 | Image Processor and Control Chip. | 6 | Image Processor and Control Chip. |
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index e39cc05c64c2..587458b370b9 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c | |||
@@ -353,7 +353,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) | |||
353 | */ | 353 | */ |
354 | printk(KERN_ERR "%s: unable to select block size for " | 354 | printk(KERN_ERR "%s: unable to select block size for " |
355 | "writing (rb%u wb%u rp%u wp%u)\n", | 355 | "writing (rb%u wb%u rp%u wp%u)\n", |
356 | md->disk->disk_name, | 356 | mmc_card_id(card), |
357 | 1 << card->csd.read_blkbits, | 357 | 1 << card->csd.read_blkbits, |
358 | 1 << card->csd.write_blkbits, | 358 | 1 << card->csd.write_blkbits, |
359 | card->csd.read_partial, | 359 | card->csd.read_partial, |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 5ca99e26660a..54161aef3cac 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -55,8 +55,8 @@ | |||
55 | 55 | ||
56 | #define DRV_MODULE_NAME "bnx2" | 56 | #define DRV_MODULE_NAME "bnx2" |
57 | #define PFX DRV_MODULE_NAME ": " | 57 | #define PFX DRV_MODULE_NAME ": " |
58 | #define DRV_MODULE_VERSION "1.4.39" | 58 | #define DRV_MODULE_VERSION "1.4.40" |
59 | #define DRV_MODULE_RELDATE "March 22, 2006" | 59 | #define DRV_MODULE_RELDATE "May 22, 2006" |
60 | 60 | ||
61 | #define RUN_AT(x) (jiffies + (x)) | 61 | #define RUN_AT(x) (jiffies + (x)) |
62 | 62 | ||
@@ -2945,7 +2945,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
2945 | int buf_size) | 2945 | int buf_size) |
2946 | { | 2946 | { |
2947 | u32 written, offset32, len32; | 2947 | u32 written, offset32, len32; |
2948 | u8 *buf, start[4], end[4]; | 2948 | u8 *buf, start[4], end[4], *flash_buffer = NULL; |
2949 | int rc = 0; | 2949 | int rc = 0; |
2950 | int align_start, align_end; | 2950 | int align_start, align_end; |
2951 | 2951 | ||
@@ -2985,12 +2985,19 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
2985 | memcpy(buf + align_start, data_buf, buf_size); | 2985 | memcpy(buf + align_start, data_buf, buf_size); |
2986 | } | 2986 | } |
2987 | 2987 | ||
2988 | if (bp->flash_info->buffered == 0) { | ||
2989 | flash_buffer = kmalloc(264, GFP_KERNEL); | ||
2990 | if (flash_buffer == NULL) { | ||
2991 | rc = -ENOMEM; | ||
2992 | goto nvram_write_end; | ||
2993 | } | ||
2994 | } | ||
2995 | |||
2988 | written = 0; | 2996 | written = 0; |
2989 | while ((written < len32) && (rc == 0)) { | 2997 | while ((written < len32) && (rc == 0)) { |
2990 | u32 page_start, page_end, data_start, data_end; | 2998 | u32 page_start, page_end, data_start, data_end; |
2991 | u32 addr, cmd_flags; | 2999 | u32 addr, cmd_flags; |
2992 | int i; | 3000 | int i; |
2993 | u8 flash_buffer[264]; | ||
2994 | 3001 | ||
2995 | /* Find the page_start addr */ | 3002 | /* Find the page_start addr */ |
2996 | page_start = offset32 + written; | 3003 | page_start = offset32 + written; |
@@ -3061,7 +3068,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3061 | } | 3068 | } |
3062 | 3069 | ||
3063 | /* Loop to write the new data from data_start to data_end */ | 3070 | /* Loop to write the new data from data_start to data_end */ |
3064 | for (addr = data_start; addr < data_end; addr += 4, i++) { | 3071 | for (addr = data_start; addr < data_end; addr += 4, i += 4) { |
3065 | if ((addr == page_end - 4) || | 3072 | if ((addr == page_end - 4) || |
3066 | ((bp->flash_info->buffered) && | 3073 | ((bp->flash_info->buffered) && |
3067 | (addr == data_end - 4))) { | 3074 | (addr == data_end - 4))) { |
@@ -3109,6 +3116,9 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3109 | } | 3116 | } |
3110 | 3117 | ||
3111 | nvram_write_end: | 3118 | nvram_write_end: |
3119 | if (bp->flash_info->buffered == 0) | ||
3120 | kfree(flash_buffer); | ||
3121 | |||
3112 | if (align_start || align_end) | 3122 | if (align_start || align_end) |
3113 | kfree(buf); | 3123 | kfree(buf); |
3114 | return rc; | 3124 | return rc; |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index c99e87838f92..ed15fcaedaf9 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -220,6 +220,7 @@ static void e1000_restore_vlan(struct e1000_adapter *adapter); | |||
220 | static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); | 220 | static int e1000_suspend(struct pci_dev *pdev, pm_message_t state); |
221 | static int e1000_resume(struct pci_dev *pdev); | 221 | static int e1000_resume(struct pci_dev *pdev); |
222 | #endif | 222 | #endif |
223 | static void e1000_shutdown(struct pci_dev *pdev); | ||
223 | 224 | ||
224 | #ifdef CONFIG_NET_POLL_CONTROLLER | 225 | #ifdef CONFIG_NET_POLL_CONTROLLER |
225 | /* for netdump / net console */ | 226 | /* for netdump / net console */ |
@@ -235,8 +236,9 @@ static struct pci_driver e1000_driver = { | |||
235 | /* Power Managment Hooks */ | 236 | /* Power Managment Hooks */ |
236 | #ifdef CONFIG_PM | 237 | #ifdef CONFIG_PM |
237 | .suspend = e1000_suspend, | 238 | .suspend = e1000_suspend, |
238 | .resume = e1000_resume | 239 | .resume = e1000_resume, |
239 | #endif | 240 | #endif |
241 | .shutdown = e1000_shutdown | ||
240 | }; | 242 | }; |
241 | 243 | ||
242 | MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); | 244 | MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>"); |
@@ -4611,6 +4613,12 @@ e1000_resume(struct pci_dev *pdev) | |||
4611 | return 0; | 4613 | return 0; |
4612 | } | 4614 | } |
4613 | #endif | 4615 | #endif |
4616 | |||
4617 | static void e1000_shutdown(struct pci_dev *pdev) | ||
4618 | { | ||
4619 | e1000_suspend(pdev, PMSG_SUSPEND); | ||
4620 | } | ||
4621 | |||
4614 | #ifdef CONFIG_NET_POLL_CONTROLLER | 4622 | #ifdef CONFIG_NET_POLL_CONTROLLER |
4615 | /* | 4623 | /* |
4616 | * Polling 'interrupt' - used by things like netconsole to send skbs | 4624 | * Polling 'interrupt' - used by things like netconsole to send skbs |
diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig index 5e6d00752990..cff8598aa800 100644 --- a/drivers/net/irda/Kconfig +++ b/drivers/net/irda/Kconfig | |||
@@ -33,7 +33,7 @@ config DONGLE | |||
33 | 33 | ||
34 | config ESI_DONGLE | 34 | config ESI_DONGLE |
35 | tristate "ESI JetEye PC dongle" | 35 | tristate "ESI JetEye PC dongle" |
36 | depends on DONGLE && IRDA | 36 | depends on IRTTY_SIR && DONGLE && IRDA |
37 | help | 37 | help |
38 | Say Y here if you want to build support for the Extended Systems | 38 | Say Y here if you want to build support for the Extended Systems |
39 | JetEye PC dongle. To compile it as a module, choose M here. The ESI | 39 | JetEye PC dongle. To compile it as a module, choose M here. The ESI |
@@ -44,7 +44,7 @@ config ESI_DONGLE | |||
44 | 44 | ||
45 | config ACTISYS_DONGLE | 45 | config ACTISYS_DONGLE |
46 | tristate "ACTiSYS IR-220L and IR220L+ dongle" | 46 | tristate "ACTiSYS IR-220L and IR220L+ dongle" |
47 | depends on DONGLE && IRDA | 47 | depends on IRTTY_SIR && DONGLE && IRDA |
48 | help | 48 | help |
49 | Say Y here if you want to build support for the ACTiSYS IR-220L and | 49 | Say Y here if you want to build support for the ACTiSYS IR-220L and |
50 | IR220L+ dongles. To compile it as a module, choose M here. The | 50 | IR220L+ dongles. To compile it as a module, choose M here. The |
@@ -55,7 +55,7 @@ config ACTISYS_DONGLE | |||
55 | 55 | ||
56 | config TEKRAM_DONGLE | 56 | config TEKRAM_DONGLE |
57 | tristate "Tekram IrMate 210B dongle" | 57 | tristate "Tekram IrMate 210B dongle" |
58 | depends on DONGLE && IRDA | 58 | depends on IRTTY_SIR && DONGLE && IRDA |
59 | help | 59 | help |
60 | Say Y here if you want to build support for the Tekram IrMate 210B | 60 | Say Y here if you want to build support for the Tekram IrMate 210B |
61 | dongle. To compile it as a module, choose M here. The Tekram dongle | 61 | dongle. To compile it as a module, choose M here. The Tekram dongle |
@@ -66,7 +66,7 @@ config TEKRAM_DONGLE | |||
66 | 66 | ||
67 | config TOIM3232_DONGLE | 67 | config TOIM3232_DONGLE |
68 | tristate "TOIM3232 IrDa dongle" | 68 | tristate "TOIM3232 IrDa dongle" |
69 | depends on DONGLE && IRDA | 69 | depends on IRTTY_SIR && DONGLE && IRDA |
70 | help | 70 | help |
71 | Say Y here if you want to build support for the Vishay/Temic | 71 | Say Y here if you want to build support for the Vishay/Temic |
72 | TOIM3232 and TOIM4232 based dongles. | 72 | TOIM3232 and TOIM4232 based dongles. |
@@ -74,7 +74,7 @@ config TOIM3232_DONGLE | |||
74 | 74 | ||
75 | config LITELINK_DONGLE | 75 | config LITELINK_DONGLE |
76 | tristate "Parallax LiteLink dongle" | 76 | tristate "Parallax LiteLink dongle" |
77 | depends on DONGLE && IRDA | 77 | depends on IRTTY_SIR && DONGLE && IRDA |
78 | help | 78 | help |
79 | Say Y here if you want to build support for the Parallax Litelink | 79 | Say Y here if you want to build support for the Parallax Litelink |
80 | dongle. To compile it as a module, choose M here. The Parallax | 80 | dongle. To compile it as a module, choose M here. The Parallax |
@@ -85,7 +85,7 @@ config LITELINK_DONGLE | |||
85 | 85 | ||
86 | config MA600_DONGLE | 86 | config MA600_DONGLE |
87 | tristate "Mobile Action MA600 dongle" | 87 | tristate "Mobile Action MA600 dongle" |
88 | depends on DONGLE && IRDA && EXPERIMENTAL | 88 | depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL |
89 | help | 89 | help |
90 | Say Y here if you want to build support for the Mobile Action MA600 | 90 | Say Y here if you want to build support for the Mobile Action MA600 |
91 | dongle. To compile it as a module, choose M here. The MA600 dongle | 91 | dongle. To compile it as a module, choose M here. The MA600 dongle |
@@ -98,7 +98,7 @@ config MA600_DONGLE | |||
98 | 98 | ||
99 | config GIRBIL_DONGLE | 99 | config GIRBIL_DONGLE |
100 | tristate "Greenwich GIrBIL dongle" | 100 | tristate "Greenwich GIrBIL dongle" |
101 | depends on DONGLE && IRDA && EXPERIMENTAL | 101 | depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL |
102 | help | 102 | help |
103 | Say Y here if you want to build support for the Greenwich GIrBIL | 103 | Say Y here if you want to build support for the Greenwich GIrBIL |
104 | dongle. If you want to compile it as a module, choose M here. | 104 | dongle. If you want to compile it as a module, choose M here. |
@@ -109,7 +109,7 @@ config GIRBIL_DONGLE | |||
109 | 109 | ||
110 | config MCP2120_DONGLE | 110 | config MCP2120_DONGLE |
111 | tristate "Microchip MCP2120" | 111 | tristate "Microchip MCP2120" |
112 | depends on DONGLE && IRDA && EXPERIMENTAL | 112 | depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL |
113 | help | 113 | help |
114 | Say Y here if you want to build support for the Microchip MCP2120 | 114 | Say Y here if you want to build support for the Microchip MCP2120 |
115 | dongle. If you want to compile it as a module, choose M here. | 115 | dongle. If you want to compile it as a module, choose M here. |
@@ -123,7 +123,7 @@ config MCP2120_DONGLE | |||
123 | 123 | ||
124 | config OLD_BELKIN_DONGLE | 124 | config OLD_BELKIN_DONGLE |
125 | tristate "Old Belkin dongle" | 125 | tristate "Old Belkin dongle" |
126 | depends on DONGLE && IRDA && EXPERIMENTAL | 126 | depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL |
127 | help | 127 | help |
128 | Say Y here if you want to build support for the Adaptec Airport 1000 | 128 | Say Y here if you want to build support for the Adaptec Airport 1000 |
129 | and 2000 dongles. If you want to compile it as a module, choose | 129 | and 2000 dongles. If you want to compile it as a module, choose |
@@ -132,7 +132,7 @@ config OLD_BELKIN_DONGLE | |||
132 | 132 | ||
133 | config ACT200L_DONGLE | 133 | config ACT200L_DONGLE |
134 | tristate "ACTiSYS IR-200L dongle" | 134 | tristate "ACTiSYS IR-200L dongle" |
135 | depends on DONGLE && IRDA && EXPERIMENTAL | 135 | depends on IRTTY_SIR && DONGLE && IRDA && EXPERIMENTAL |
136 | help | 136 | help |
137 | Say Y here if you want to build support for the ACTiSYS IR-200L | 137 | Say Y here if you want to build support for the ACTiSYS IR-200L |
138 | dongle. If you want to compile it as a module, choose M here. | 138 | dongle. If you want to compile it as a module, choose M here. |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 07c31f19c6ba..fc08c4af506c 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -1774,8 +1774,6 @@ static int pcnet32_open(struct net_device *dev) | |||
1774 | lp->rx_dma_addr[i] = 0; | 1774 | lp->rx_dma_addr[i] = 0; |
1775 | } | 1775 | } |
1776 | 1776 | ||
1777 | pcnet32_free_ring(dev); | ||
1778 | |||
1779 | /* | 1777 | /* |
1780 | * Switch back to 16bit mode to avoid problems with dumb | 1778 | * Switch back to 16bit mode to avoid problems with dumb |
1781 | * DOS packet driver after a warm reboot | 1779 | * DOS packet driver after a warm reboot |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 60779ebf2ff6..959109609d85 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -979,6 +979,7 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
979 | struct sky2_hw *hw = sky2->hw; | 979 | struct sky2_hw *hw = sky2->hw; |
980 | unsigned rxq = rxqaddr[sky2->port]; | 980 | unsigned rxq = rxqaddr[sky2->port]; |
981 | int i; | 981 | int i; |
982 | unsigned thresh; | ||
982 | 983 | ||
983 | sky2->rx_put = sky2->rx_next = 0; | 984 | sky2->rx_put = sky2->rx_next = 0; |
984 | sky2_qset(hw, rxq); | 985 | sky2_qset(hw, rxq); |
@@ -1003,9 +1004,21 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
1003 | sky2_rx_add(sky2, re->mapaddr); | 1004 | sky2_rx_add(sky2, re->mapaddr); |
1004 | } | 1005 | } |
1005 | 1006 | ||
1006 | /* Truncate oversize frames */ | 1007 | |
1007 | sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8); | 1008 | /* |
1008 | sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); | 1009 | * The receiver hangs if it receives frames larger than the |
1010 | * packet buffer. As a workaround, truncate oversize frames, but | ||
1011 | * the register is limited to 9 bits, so if you do frames > 2052 | ||
1012 | * you better get the MTU right! | ||
1013 | */ | ||
1014 | thresh = (sky2->rx_bufsize - 8) / sizeof(u32); | ||
1015 | if (thresh > 0x1ff) | ||
1016 | sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_OFF); | ||
1017 | else { | ||
1018 | sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), thresh); | ||
1019 | sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); | ||
1020 | } | ||
1021 | |||
1009 | 1022 | ||
1010 | /* Tell chip about available buffers */ | 1023 | /* Tell chip about available buffers */ |
1011 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); | 1024 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e1b33a25a25f..49ad60b72657 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -69,8 +69,8 @@ | |||
69 | 69 | ||
70 | #define DRV_MODULE_NAME "tg3" | 70 | #define DRV_MODULE_NAME "tg3" |
71 | #define PFX DRV_MODULE_NAME ": " | 71 | #define PFX DRV_MODULE_NAME ": " |
72 | #define DRV_MODULE_VERSION "3.57" | 72 | #define DRV_MODULE_VERSION "3.58" |
73 | #define DRV_MODULE_RELDATE "Apr 28, 2006" | 73 | #define DRV_MODULE_RELDATE "May 22, 2006" |
74 | 74 | ||
75 | #define TG3_DEF_MAC_MODE 0 | 75 | #define TG3_DEF_MAC_MODE 0 |
76 | #define TG3_DEF_RX_MODE 0 | 76 | #define TG3_DEF_RX_MODE 0 |
@@ -6488,6 +6488,10 @@ static void tg3_periodic_fetch_stats(struct tg3 *tp) | |||
6488 | TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG); | 6488 | TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG); |
6489 | TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS); | 6489 | TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS); |
6490 | TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE); | 6490 | TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE); |
6491 | |||
6492 | TG3_STAT_ADD32(&sp->rxbds_empty, RCVLPC_NO_RCV_BD_CNT); | ||
6493 | TG3_STAT_ADD32(&sp->rx_discards, RCVLPC_IN_DISCARDS_CNT); | ||
6494 | TG3_STAT_ADD32(&sp->rx_errors, RCVLPC_IN_ERRORS_CNT); | ||
6491 | } | 6495 | } |
6492 | 6496 | ||
6493 | static void tg3_timer(unsigned long __opaque) | 6497 | static void tg3_timer(unsigned long __opaque) |
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c index 0e1ac338cac1..bed6823d9809 100644 --- a/drivers/net/wireless/arlan-main.c +++ b/drivers/net/wireless/arlan-main.c | |||
@@ -1838,7 +1838,7 @@ struct net_device * __init arlan_probe(int unit) | |||
1838 | } | 1838 | } |
1839 | 1839 | ||
1840 | #ifdef MODULE | 1840 | #ifdef MODULE |
1841 | int init_module(void) | 1841 | int __init init_module(void) |
1842 | { | 1842 | { |
1843 | int i = 0; | 1843 | int i = 0; |
1844 | 1844 | ||
@@ -1860,7 +1860,7 @@ int init_module(void) | |||
1860 | } | 1860 | } |
1861 | 1861 | ||
1862 | 1862 | ||
1863 | void cleanup_module(void) | 1863 | void __exit cleanup_module(void) |
1864 | { | 1864 | { |
1865 | int i = 0; | 1865 | int i = 0; |
1866 | struct net_device *dev; | 1866 | struct net_device *dev; |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 06523e2a8471..c2d0b09e0418 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -812,7 +812,6 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, | |||
812 | if (datalen > IEEE80211_DATA_LEN + 12) { | 812 | if (datalen > IEEE80211_DATA_LEN + 12) { |
813 | printk(KERN_DEBUG "%s: oversized monitor frame, " | 813 | printk(KERN_DEBUG "%s: oversized monitor frame, " |
814 | "data length = %d\n", dev->name, datalen); | 814 | "data length = %d\n", dev->name, datalen); |
815 | err = -EIO; | ||
816 | stats->rx_length_errors++; | 815 | stats->rx_length_errors++; |
817 | goto update_stats; | 816 | goto update_stats; |
818 | } | 817 | } |
@@ -821,8 +820,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, | |||
821 | if (!skb) { | 820 | if (!skb) { |
822 | printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n", | 821 | printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n", |
823 | dev->name); | 822 | dev->name); |
824 | err = -ENOMEM; | 823 | goto update_stats; |
825 | goto drop; | ||
826 | } | 824 | } |
827 | 825 | ||
828 | /* Copy the 802.11 header to the skb */ | 826 | /* Copy the 802.11 header to the skb */ |
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c index ff192e96268a..dade4b903579 100644 --- a/drivers/net/wireless/wavelan.c +++ b/drivers/net/wireless/wavelan.c | |||
@@ -4306,7 +4306,7 @@ out: | |||
4306 | * Insertion of the module | 4306 | * Insertion of the module |
4307 | * I'm now quite proud of the multi-device support. | 4307 | * I'm now quite proud of the multi-device support. |
4308 | */ | 4308 | */ |
4309 | int init_module(void) | 4309 | int __init init_module(void) |
4310 | { | 4310 | { |
4311 | int ret = -EIO; /* Return error if no cards found */ | 4311 | int ret = -EIO; /* Return error if no cards found */ |
4312 | int i; | 4312 | int i; |
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index af9f212314b3..fe986af884f8 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c | |||
@@ -1486,13 +1486,13 @@ ch_action_iofatal(fsm_instance * fi, int event, void *arg) | |||
1486 | } | 1486 | } |
1487 | } | 1487 | } |
1488 | 1488 | ||
1489 | static void | 1489 | static void |
1490 | ch_action_reinit(fsm_instance *fi, int event, void *arg) | 1490 | ch_action_reinit(fsm_instance *fi, int event, void *arg) |
1491 | { | 1491 | { |
1492 | struct channel *ch = (struct channel *)arg; | 1492 | struct channel *ch = (struct channel *)arg; |
1493 | struct net_device *dev = ch->netdev; | 1493 | struct net_device *dev = ch->netdev; |
1494 | struct ctc_priv *privptr = dev->priv; | 1494 | struct ctc_priv *privptr = dev->priv; |
1495 | 1495 | ||
1496 | DBF_TEXT(trace, 4, __FUNCTION__); | 1496 | DBF_TEXT(trace, 4, __FUNCTION__); |
1497 | ch_action_iofatal(fi, event, arg); | 1497 | ch_action_iofatal(fi, event, arg); |
1498 | fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev); | 1498 | fsm_addtimer(&privptr->restart_timer, 1000, DEV_EVENT_RESTART, dev); |
@@ -1624,7 +1624,7 @@ less_than(char *id1, char *id2) | |||
1624 | } | 1624 | } |
1625 | dev1 = simple_strtoul(id1, &id1, 16); | 1625 | dev1 = simple_strtoul(id1, &id1, 16); |
1626 | dev2 = simple_strtoul(id2, &id2, 16); | 1626 | dev2 = simple_strtoul(id2, &id2, 16); |
1627 | 1627 | ||
1628 | return (dev1 < dev2); | 1628 | return (dev1 < dev2); |
1629 | } | 1629 | } |
1630 | 1630 | ||
@@ -1895,7 +1895,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1895 | irb->scsw.dstat); | 1895 | irb->scsw.dstat); |
1896 | return; | 1896 | return; |
1897 | } | 1897 | } |
1898 | 1898 | ||
1899 | priv = ((struct ccwgroup_device *)cdev->dev.driver_data) | 1899 | priv = ((struct ccwgroup_device *)cdev->dev.driver_data) |
1900 | ->dev.driver_data; | 1900 | ->dev.driver_data; |
1901 | 1901 | ||
@@ -1909,7 +1909,7 @@ ctc_irq_handler(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1909 | "device %s\n", cdev->dev.bus_id); | 1909 | "device %s\n", cdev->dev.bus_id); |
1910 | return; | 1910 | return; |
1911 | } | 1911 | } |
1912 | 1912 | ||
1913 | dev = (struct net_device *) (ch->netdev); | 1913 | dev = (struct net_device *) (ch->netdev); |
1914 | if (dev == NULL) { | 1914 | if (dev == NULL) { |
1915 | ctc_pr_crit("ctc: ctc_irq_handler dev=NULL bus_id=%s, ch=0x%p\n", | 1915 | ctc_pr_crit("ctc: ctc_irq_handler dev=NULL bus_id=%s, ch=0x%p\n", |
@@ -2008,12 +2008,12 @@ dev_action_stop(fsm_instance * fi, int event, void *arg) | |||
2008 | fsm_event(ch->fsm, CH_EVENT_STOP, ch); | 2008 | fsm_event(ch->fsm, CH_EVENT_STOP, ch); |
2009 | } | 2009 | } |
2010 | } | 2010 | } |
2011 | static void | 2011 | static void |
2012 | dev_action_restart(fsm_instance *fi, int event, void *arg) | 2012 | dev_action_restart(fsm_instance *fi, int event, void *arg) |
2013 | { | 2013 | { |
2014 | struct net_device *dev = (struct net_device *)arg; | 2014 | struct net_device *dev = (struct net_device *)arg; |
2015 | struct ctc_priv *privptr = dev->priv; | 2015 | struct ctc_priv *privptr = dev->priv; |
2016 | 2016 | ||
2017 | DBF_TEXT(trace, 3, __FUNCTION__); | 2017 | DBF_TEXT(trace, 3, __FUNCTION__); |
2018 | ctc_pr_debug("%s: Restarting\n", dev->name); | 2018 | ctc_pr_debug("%s: Restarting\n", dev->name); |
2019 | dev_action_stop(fi, event, arg); | 2019 | dev_action_stop(fi, event, arg); |
@@ -2193,7 +2193,7 @@ transmit_skb(struct channel *ch, struct sk_buff *skb) | |||
2193 | 2193 | ||
2194 | DBF_TEXT(trace, 5, __FUNCTION__); | 2194 | DBF_TEXT(trace, 5, __FUNCTION__); |
2195 | /* we need to acquire the lock for testing the state | 2195 | /* we need to acquire the lock for testing the state |
2196 | * otherwise we can have an IRQ changing the state to | 2196 | * otherwise we can have an IRQ changing the state to |
2197 | * TXIDLE after the test but before acquiring the lock. | 2197 | * TXIDLE after the test but before acquiring the lock. |
2198 | */ | 2198 | */ |
2199 | spin_lock_irqsave(&ch->collect_lock, saveflags); | 2199 | spin_lock_irqsave(&ch->collect_lock, saveflags); |
@@ -2393,7 +2393,7 @@ ctc_tx(struct sk_buff *skb, struct net_device * dev) | |||
2393 | 2393 | ||
2394 | /** | 2394 | /** |
2395 | * If channels are not running, try to restart them | 2395 | * If channels are not running, try to restart them |
2396 | * and throw away packet. | 2396 | * and throw away packet. |
2397 | */ | 2397 | */ |
2398 | if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { | 2398 | if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { |
2399 | fsm_event(privptr->fsm, DEV_EVENT_START, dev); | 2399 | fsm_event(privptr->fsm, DEV_EVENT_START, dev); |
@@ -2738,7 +2738,7 @@ ctc_remove_files(struct device *dev) | |||
2738 | /** | 2738 | /** |
2739 | * Add ctc specific attributes. | 2739 | * Add ctc specific attributes. |
2740 | * Add ctc private data. | 2740 | * Add ctc private data. |
2741 | * | 2741 | * |
2742 | * @param cgdev pointer to ccwgroup_device just added | 2742 | * @param cgdev pointer to ccwgroup_device just added |
2743 | * | 2743 | * |
2744 | * @returns 0 on success, !0 on failure. | 2744 | * @returns 0 on success, !0 on failure. |
@@ -2869,7 +2869,7 @@ ctc_new_device(struct ccwgroup_device *cgdev) | |||
2869 | DBF_TEXT(setup, 3, buffer); | 2869 | DBF_TEXT(setup, 3, buffer); |
2870 | 2870 | ||
2871 | type = get_channel_type(&cgdev->cdev[0]->id); | 2871 | type = get_channel_type(&cgdev->cdev[0]->id); |
2872 | 2872 | ||
2873 | snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id); | 2873 | snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id); |
2874 | snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id); | 2874 | snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id); |
2875 | 2875 | ||
@@ -2907,7 +2907,7 @@ ctc_new_device(struct ccwgroup_device *cgdev) | |||
2907 | channel_get(type, direction == READ ? read_id : write_id, | 2907 | channel_get(type, direction == READ ? read_id : write_id, |
2908 | direction); | 2908 | direction); |
2909 | if (privptr->channel[direction] == NULL) { | 2909 | if (privptr->channel[direction] == NULL) { |
2910 | if (direction == WRITE) | 2910 | if (direction == WRITE) |
2911 | channel_free(privptr->channel[READ]); | 2911 | channel_free(privptr->channel[READ]); |
2912 | 2912 | ||
2913 | ctc_free_netdevice(dev, 1); | 2913 | ctc_free_netdevice(dev, 1); |
@@ -2955,7 +2955,7 @@ ctc_shutdown_device(struct ccwgroup_device *cgdev) | |||
2955 | { | 2955 | { |
2956 | struct ctc_priv *priv; | 2956 | struct ctc_priv *priv; |
2957 | struct net_device *ndev; | 2957 | struct net_device *ndev; |
2958 | 2958 | ||
2959 | DBF_TEXT(setup, 3, __FUNCTION__); | 2959 | DBF_TEXT(setup, 3, __FUNCTION__); |
2960 | pr_debug("%s() called\n", __FUNCTION__); | 2960 | pr_debug("%s() called\n", __FUNCTION__); |
2961 | 2961 | ||
diff --git a/drivers/s390/net/ctctty.c b/drivers/s390/net/ctctty.c index 5cdcdbf92962..af54d1de07bf 100644 --- a/drivers/s390/net/ctctty.c +++ b/drivers/s390/net/ctctty.c | |||
@@ -130,7 +130,7 @@ ctc_tty_readmodem(ctc_tty_info *info) | |||
130 | if ((tty = info->tty)) { | 130 | if ((tty = info->tty)) { |
131 | if (info->mcr & UART_MCR_RTS) { | 131 | if (info->mcr & UART_MCR_RTS) { |
132 | struct sk_buff *skb; | 132 | struct sk_buff *skb; |
133 | 133 | ||
134 | if ((skb = skb_dequeue(&info->rx_queue))) { | 134 | if ((skb = skb_dequeue(&info->rx_queue))) { |
135 | int len = skb->len; | 135 | int len = skb->len; |
136 | tty_insert_flip_string(tty, skb->data, len); | 136 | tty_insert_flip_string(tty, skb->data, len); |
@@ -328,7 +328,7 @@ ctc_tty_inject(ctc_tty_info *info, char c) | |||
328 | { | 328 | { |
329 | int skb_res; | 329 | int skb_res; |
330 | struct sk_buff *skb; | 330 | struct sk_buff *skb; |
331 | 331 | ||
332 | DBF_TEXT(trace, 4, __FUNCTION__); | 332 | DBF_TEXT(trace, 4, __FUNCTION__); |
333 | if (ctc_tty_shuttingdown) | 333 | if (ctc_tty_shuttingdown) |
334 | return; | 334 | return; |
@@ -497,7 +497,7 @@ ctc_tty_write(struct tty_struct *tty, const u_char * buf, int count) | |||
497 | c = (count < CTC_TTY_XMIT_SIZE) ? count : CTC_TTY_XMIT_SIZE; | 497 | c = (count < CTC_TTY_XMIT_SIZE) ? count : CTC_TTY_XMIT_SIZE; |
498 | if (c <= 0) | 498 | if (c <= 0) |
499 | break; | 499 | break; |
500 | 500 | ||
501 | skb_res = info->netdev->hard_header_len + sizeof(info->mcr) + | 501 | skb_res = info->netdev->hard_header_len + sizeof(info->mcr) + |
502 | + sizeof(__u32); | 502 | + sizeof(__u32); |
503 | skb = dev_alloc_skb(skb_res + c); | 503 | skb = dev_alloc_skb(skb_res + c); |
@@ -828,7 +828,7 @@ ctc_tty_block_til_ready(struct tty_struct *tty, struct file *filp, ctc_tty_info | |||
828 | if (tty_hung_up_p(filp) || | 828 | if (tty_hung_up_p(filp) || |
829 | (info->flags & CTC_ASYNC_CLOSING)) { | 829 | (info->flags & CTC_ASYNC_CLOSING)) { |
830 | if (info->flags & CTC_ASYNC_CLOSING) | 830 | if (info->flags & CTC_ASYNC_CLOSING) |
831 | wait_event(info->close_wait, | 831 | wait_event(info->close_wait, |
832 | !(info->flags & CTC_ASYNC_CLOSING)); | 832 | !(info->flags & CTC_ASYNC_CLOSING)); |
833 | #ifdef MODEM_DO_RESTART | 833 | #ifdef MODEM_DO_RESTART |
834 | if (info->flags & CTC_ASYNC_HUP_NOTIFY) | 834 | if (info->flags & CTC_ASYNC_HUP_NOTIFY) |
@@ -1247,7 +1247,7 @@ ctc_tty_unregister_netdev(struct net_device *dev) { | |||
1247 | void | 1247 | void |
1248 | ctc_tty_cleanup(void) { | 1248 | ctc_tty_cleanup(void) { |
1249 | unsigned long saveflags; | 1249 | unsigned long saveflags; |
1250 | 1250 | ||
1251 | DBF_TEXT(trace, 2, __FUNCTION__); | 1251 | DBF_TEXT(trace, 2, __FUNCTION__); |
1252 | spin_lock_irqsave(&ctc_tty_lock, saveflags); | 1252 | spin_lock_irqsave(&ctc_tty_lock, saveflags); |
1253 | ctc_tty_shuttingdown = 1; | 1253 | ctc_tty_shuttingdown = 1; |
diff --git a/drivers/s390/net/cu3088.c b/drivers/s390/net/cu3088.c index b12533104c1f..e965f03a7291 100644 --- a/drivers/s390/net/cu3088.c +++ b/drivers/s390/net/cu3088.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
@@ -77,7 +77,7 @@ group_write(struct device_driver *drv, const char *buf, size_t count) | |||
77 | int len; | 77 | int len; |
78 | 78 | ||
79 | if (!(end = strchr(start, delim[i]))) | 79 | if (!(end = strchr(start, delim[i]))) |
80 | return count; | 80 | return -EINVAL; |
81 | len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1); | 81 | len = min_t(ptrdiff_t, BUS_ID_SIZE, end - start + 1); |
82 | strlcpy (bus_ids[i], start, len); | 82 | strlcpy (bus_ids[i], start, len); |
83 | argv[i] = bus_ids[i]; | 83 | argv[i] = bus_ids[i]; |
@@ -94,7 +94,7 @@ static DRIVER_ATTR(group, 0200, NULL, group_write); | |||
94 | 94 | ||
95 | /* Register-unregister for ctc&lcs */ | 95 | /* Register-unregister for ctc&lcs */ |
96 | int | 96 | int |
97 | register_cu3088_discipline(struct ccwgroup_driver *dcp) | 97 | register_cu3088_discipline(struct ccwgroup_driver *dcp) |
98 | { | 98 | { |
99 | int rc; | 99 | int rc; |
100 | 100 | ||
@@ -109,7 +109,7 @@ register_cu3088_discipline(struct ccwgroup_driver *dcp) | |||
109 | rc = driver_create_file(&dcp->driver, &driver_attr_group); | 109 | rc = driver_create_file(&dcp->driver, &driver_attr_group); |
110 | if (rc) | 110 | if (rc) |
111 | ccwgroup_driver_unregister(dcp); | 111 | ccwgroup_driver_unregister(dcp); |
112 | 112 | ||
113 | return rc; | 113 | return rc; |
114 | 114 | ||
115 | } | 115 | } |
@@ -137,7 +137,7 @@ static int __init | |||
137 | cu3088_init (void) | 137 | cu3088_init (void) |
138 | { | 138 | { |
139 | int rc; | 139 | int rc; |
140 | 140 | ||
141 | cu3088_root_dev = s390_root_dev_register("cu3088"); | 141 | cu3088_root_dev = s390_root_dev_register("cu3088"); |
142 | if (IS_ERR(cu3088_root_dev)) | 142 | if (IS_ERR(cu3088_root_dev)) |
143 | return PTR_ERR(cu3088_root_dev); | 143 | return PTR_ERR(cu3088_root_dev); |
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c index 6190be9dca99..e0c7deb98831 100644 --- a/drivers/s390/net/iucv.c +++ b/drivers/s390/net/iucv.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * IUCV network driver | 2 | * IUCV network driver |
3 | * | 3 | * |
4 | * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation | 4 | * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation |
@@ -28,7 +28,7 @@ | |||
28 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 28 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
29 | * | 29 | * |
30 | */ | 30 | */ |
31 | 31 | ||
32 | /* #define DEBUG */ | 32 | /* #define DEBUG */ |
33 | 33 | ||
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
@@ -81,7 +81,7 @@ iucv_bus_match (struct device *dev, struct device_driver *drv) | |||
81 | struct bus_type iucv_bus = { | 81 | struct bus_type iucv_bus = { |
82 | .name = "iucv", | 82 | .name = "iucv", |
83 | .match = iucv_bus_match, | 83 | .match = iucv_bus_match, |
84 | }; | 84 | }; |
85 | 85 | ||
86 | struct device *iucv_root; | 86 | struct device *iucv_root; |
87 | 87 | ||
@@ -297,7 +297,7 @@ MODULE_LICENSE("GPL"); | |||
297 | /* | 297 | /* |
298 | * Debugging stuff | 298 | * Debugging stuff |
299 | *******************************************************************************/ | 299 | *******************************************************************************/ |
300 | 300 | ||
301 | 301 | ||
302 | #ifdef DEBUG | 302 | #ifdef DEBUG |
303 | static int debuglevel = 0; | 303 | static int debuglevel = 0; |
@@ -344,7 +344,7 @@ do { \ | |||
344 | /* | 344 | /* |
345 | * Internal functions | 345 | * Internal functions |
346 | *******************************************************************************/ | 346 | *******************************************************************************/ |
347 | 347 | ||
348 | /** | 348 | /** |
349 | * print start banner | 349 | * print start banner |
350 | */ | 350 | */ |
@@ -810,7 +810,7 @@ iucv_register_program (__u8 pgmname[16], | |||
810 | sizeof (new_handler->id.userid)); | 810 | sizeof (new_handler->id.userid)); |
811 | EBC_TOUPPER (new_handler->id.userid, | 811 | EBC_TOUPPER (new_handler->id.userid, |
812 | sizeof (new_handler->id.userid)); | 812 | sizeof (new_handler->id.userid)); |
813 | 813 | ||
814 | if (pgmmask) { | 814 | if (pgmmask) { |
815 | memcpy (new_handler->id.mask, pgmmask, | 815 | memcpy (new_handler->id.mask, pgmmask, |
816 | sizeof (new_handler->id.mask)); | 816 | sizeof (new_handler->id.mask)); |
@@ -1229,7 +1229,7 @@ iucv_purge (__u16 pathid, __u32 msgid, __u32 srccls, __u32 *audit) | |||
1229 | /* parm->ipaudit has only 3 bytes */ | 1229 | /* parm->ipaudit has only 3 bytes */ |
1230 | *audit >>= 8; | 1230 | *audit >>= 8; |
1231 | } | 1231 | } |
1232 | 1232 | ||
1233 | release_param(parm); | 1233 | release_param(parm); |
1234 | 1234 | ||
1235 | iucv_debug(1, "b2f0_result = %ld", b2f0_result); | 1235 | iucv_debug(1, "b2f0_result = %ld", b2f0_result); |
@@ -2330,14 +2330,14 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) | |||
2330 | temp_buff1[j] &= (h->id.mask)[j]; | 2330 | temp_buff1[j] &= (h->id.mask)[j]; |
2331 | temp_buff2[j] &= (h->id.mask)[j]; | 2331 | temp_buff2[j] &= (h->id.mask)[j]; |
2332 | } | 2332 | } |
2333 | 2333 | ||
2334 | iucv_dumpit("temp_buff1:", | 2334 | iucv_dumpit("temp_buff1:", |
2335 | temp_buff1, sizeof(temp_buff1)); | 2335 | temp_buff1, sizeof(temp_buff1)); |
2336 | iucv_dumpit("temp_buff2", | 2336 | iucv_dumpit("temp_buff2", |
2337 | temp_buff2, sizeof(temp_buff2)); | 2337 | temp_buff2, sizeof(temp_buff2)); |
2338 | 2338 | ||
2339 | if (!memcmp (temp_buff1, temp_buff2, 24)) { | 2339 | if (!memcmp (temp_buff1, temp_buff2, 24)) { |
2340 | 2340 | ||
2341 | iucv_debug(2, | 2341 | iucv_debug(2, |
2342 | "found a matching handler"); | 2342 | "found a matching handler"); |
2343 | break; | 2343 | break; |
@@ -2368,7 +2368,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) | |||
2368 | } else | 2368 | } else |
2369 | iucv_sever(int_buf->ippathid, no_listener); | 2369 | iucv_sever(int_buf->ippathid, no_listener); |
2370 | break; | 2370 | break; |
2371 | 2371 | ||
2372 | case 0x02: /*connection complete */ | 2372 | case 0x02: /*connection complete */ |
2373 | if (messagesDisabled) { | 2373 | if (messagesDisabled) { |
2374 | iucv_setmask(~0); | 2374 | iucv_setmask(~0); |
@@ -2387,7 +2387,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) | |||
2387 | } else | 2387 | } else |
2388 | iucv_sever(int_buf->ippathid, no_listener); | 2388 | iucv_sever(int_buf->ippathid, no_listener); |
2389 | break; | 2389 | break; |
2390 | 2390 | ||
2391 | case 0x03: /* connection severed */ | 2391 | case 0x03: /* connection severed */ |
2392 | if (messagesDisabled) { | 2392 | if (messagesDisabled) { |
2393 | iucv_setmask(~0); | 2393 | iucv_setmask(~0); |
@@ -2398,13 +2398,13 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) | |||
2398 | interrupt->ConnectionSevered( | 2398 | interrupt->ConnectionSevered( |
2399 | (iucv_ConnectionSevered *)int_buf, | 2399 | (iucv_ConnectionSevered *)int_buf, |
2400 | h->pgm_data); | 2400 | h->pgm_data); |
2401 | 2401 | ||
2402 | else | 2402 | else |
2403 | iucv_sever (int_buf->ippathid, no_listener); | 2403 | iucv_sever (int_buf->ippathid, no_listener); |
2404 | } else | 2404 | } else |
2405 | iucv_sever(int_buf->ippathid, no_listener); | 2405 | iucv_sever(int_buf->ippathid, no_listener); |
2406 | break; | 2406 | break; |
2407 | 2407 | ||
2408 | case 0x04: /* connection quiesced */ | 2408 | case 0x04: /* connection quiesced */ |
2409 | if (messagesDisabled) { | 2409 | if (messagesDisabled) { |
2410 | iucv_setmask(~0); | 2410 | iucv_setmask(~0); |
@@ -2420,7 +2420,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) | |||
2420 | "ConnectionQuiesced not called"); | 2420 | "ConnectionQuiesced not called"); |
2421 | } | 2421 | } |
2422 | break; | 2422 | break; |
2423 | 2423 | ||
2424 | case 0x05: /* connection resumed */ | 2424 | case 0x05: /* connection resumed */ |
2425 | if (messagesDisabled) { | 2425 | if (messagesDisabled) { |
2426 | iucv_setmask(~0); | 2426 | iucv_setmask(~0); |
@@ -2436,7 +2436,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) | |||
2436 | "ConnectionResumed not called"); | 2436 | "ConnectionResumed not called"); |
2437 | } | 2437 | } |
2438 | break; | 2438 | break; |
2439 | 2439 | ||
2440 | case 0x06: /* priority message complete */ | 2440 | case 0x06: /* priority message complete */ |
2441 | case 0x07: /* nonpriority message complete */ | 2441 | case 0x07: /* nonpriority message complete */ |
2442 | if (h) { | 2442 | if (h) { |
@@ -2449,7 +2449,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) | |||
2449 | "MessageComplete not called"); | 2449 | "MessageComplete not called"); |
2450 | } | 2450 | } |
2451 | break; | 2451 | break; |
2452 | 2452 | ||
2453 | case 0x08: /* priority message pending */ | 2453 | case 0x08: /* priority message pending */ |
2454 | case 0x09: /* nonpriority message pending */ | 2454 | case 0x09: /* nonpriority message pending */ |
2455 | if (h) { | 2455 | if (h) { |
@@ -2467,7 +2467,7 @@ iucv_do_int(iucv_GeneralInterrupt * int_buf) | |||
2467 | __FUNCTION__); | 2467 | __FUNCTION__); |
2468 | break; | 2468 | break; |
2469 | } /* end switch */ | 2469 | } /* end switch */ |
2470 | 2470 | ||
2471 | iucv_debug(2, "exiting pathid %d, type %02X", | 2471 | iucv_debug(2, "exiting pathid %d, type %02X", |
2472 | int_buf->ippathid, int_buf->iptype); | 2472 | int_buf->ippathid, int_buf->iptype); |
2473 | 2473 | ||
diff --git a/drivers/s390/net/iucv.h b/drivers/s390/net/iucv.h index 0c4644d3d2f3..5b6b1b7241c9 100644 --- a/drivers/s390/net/iucv.h +++ b/drivers/s390/net/iucv.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * S390 version | 5 | * S390 version |
6 | * Copyright (C) 2000 IBM Corporation | 6 | * Copyright (C) 2000 IBM Corporation |
7 | * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) | 7 | * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) |
8 | * Xenia Tkatschow (xenia@us.ibm.com) | 8 | * Xenia Tkatschow (xenia@us.ibm.com) |
9 | * | 9 | * |
10 | * | 10 | * |
@@ -16,17 +16,17 @@ | |||
16 | * CP Programming Services book, also available on the web | 16 | * CP Programming Services book, also available on the web |
17 | * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 | 17 | * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 |
18 | * | 18 | * |
19 | * Definition of Return Codes | 19 | * Definition of Return Codes |
20 | * -All positive return codes including zero are reflected back | 20 | * -All positive return codes including zero are reflected back |
21 | * from CP except for iucv_register_program. The definition of each | 21 | * from CP except for iucv_register_program. The definition of each |
22 | * return code can be found in CP Programming Services book. | 22 | * return code can be found in CP Programming Services book. |
23 | * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 | 23 | * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 |
24 | * - Return Code of: | 24 | * - Return Code of: |
25 | * (-EINVAL) Invalid value | 25 | * (-EINVAL) Invalid value |
26 | * (-ENOMEM) storage allocation failed | 26 | * (-ENOMEM) storage allocation failed |
27 | * pgmask defined in iucv_register_program will be set depending on input | 27 | * pgmask defined in iucv_register_program will be set depending on input |
28 | * paramters. | 28 | * paramters. |
29 | * | 29 | * |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
@@ -124,13 +124,13 @@ iucv_hex_dump(unsigned char *buf, size_t len) | |||
124 | #define iucv_handle_t void * | 124 | #define iucv_handle_t void * |
125 | 125 | ||
126 | /* flags1: | 126 | /* flags1: |
127 | * All flags are defined in the field IPFLAGS1 of each function | 127 | * All flags are defined in the field IPFLAGS1 of each function |
128 | * and can be found in CP Programming Services. | 128 | * and can be found in CP Programming Services. |
129 | * IPLOCAL - Indicates the connect can only be satisfied on the | 129 | * IPLOCAL - Indicates the connect can only be satisfied on the |
130 | * local system | 130 | * local system |
131 | * IPPRTY - Indicates a priority message | 131 | * IPPRTY - Indicates a priority message |
132 | * IPQUSCE - Indicates you do not want to receive messages on a | 132 | * IPQUSCE - Indicates you do not want to receive messages on a |
133 | * path until an iucv_resume is issued | 133 | * path until an iucv_resume is issued |
134 | * IPRMDATA - Indicates that the message is in the parameter list | 134 | * IPRMDATA - Indicates that the message is in the parameter list |
135 | */ | 135 | */ |
136 | #define IPLOCAL 0x01 | 136 | #define IPLOCAL 0x01 |
@@ -154,14 +154,14 @@ iucv_hex_dump(unsigned char *buf, size_t len) | |||
154 | #define AllInterrupts 0xf8 | 154 | #define AllInterrupts 0xf8 |
155 | /* | 155 | /* |
156 | * Mapping of external interrupt buffers should be used with the corresponding | 156 | * Mapping of external interrupt buffers should be used with the corresponding |
157 | * interrupt types. | 157 | * interrupt types. |
158 | * Names: iucv_ConnectionPending -> connection pending | 158 | * Names: iucv_ConnectionPending -> connection pending |
159 | * iucv_ConnectionComplete -> connection complete | 159 | * iucv_ConnectionComplete -> connection complete |
160 | * iucv_ConnectionSevered -> connection severed | 160 | * iucv_ConnectionSevered -> connection severed |
161 | * iucv_ConnectionQuiesced -> connection quiesced | 161 | * iucv_ConnectionQuiesced -> connection quiesced |
162 | * iucv_ConnectionResumed -> connection resumed | 162 | * iucv_ConnectionResumed -> connection resumed |
163 | * iucv_MessagePending -> message pending | 163 | * iucv_MessagePending -> message pending |
164 | * iucv_MessageComplete -> message complete | 164 | * iucv_MessageComplete -> message complete |
165 | */ | 165 | */ |
166 | typedef struct { | 166 | typedef struct { |
167 | u16 ippathid; | 167 | u16 ippathid; |
@@ -260,16 +260,16 @@ typedef struct { | |||
260 | uchar res2[3]; | 260 | uchar res2[3]; |
261 | } iucv_MessageComplete; | 261 | } iucv_MessageComplete; |
262 | 262 | ||
263 | /* | 263 | /* |
264 | * iucv_interrupt_ops_t: Is a vector of functions that handle | 264 | * iucv_interrupt_ops_t: Is a vector of functions that handle |
265 | * IUCV interrupts. | 265 | * IUCV interrupts. |
266 | * Parameter list: | 266 | * Parameter list: |
267 | * eib - is a pointer to a 40-byte area described | 267 | * eib - is a pointer to a 40-byte area described |
268 | * with one of the structures above. | 268 | * with one of the structures above. |
269 | * pgm_data - this data is strictly for the | 269 | * pgm_data - this data is strictly for the |
270 | * interrupt handler that is passed by | 270 | * interrupt handler that is passed by |
271 | * the application. This may be an address | 271 | * the application. This may be an address |
272 | * or token. | 272 | * or token. |
273 | */ | 273 | */ |
274 | typedef struct { | 274 | typedef struct { |
275 | void (*ConnectionPending) (iucv_ConnectionPending * eib, | 275 | void (*ConnectionPending) (iucv_ConnectionPending * eib, |
@@ -287,8 +287,8 @@ typedef struct { | |||
287 | } iucv_interrupt_ops_t; | 287 | } iucv_interrupt_ops_t; |
288 | 288 | ||
289 | /* | 289 | /* |
290 | *iucv_array_t : Defines buffer array. | 290 | *iucv_array_t : Defines buffer array. |
291 | * Inside the array may be 31- bit addresses and 31-bit lengths. | 291 | * Inside the array may be 31- bit addresses and 31-bit lengths. |
292 | */ | 292 | */ |
293 | typedef struct { | 293 | typedef struct { |
294 | u32 address; | 294 | u32 address; |
@@ -299,19 +299,19 @@ extern struct bus_type iucv_bus; | |||
299 | extern struct device *iucv_root; | 299 | extern struct device *iucv_root; |
300 | 300 | ||
301 | /* -prototypes- */ | 301 | /* -prototypes- */ |
302 | /* | 302 | /* |
303 | * Name: iucv_register_program | 303 | * Name: iucv_register_program |
304 | * Purpose: Registers an application with IUCV | 304 | * Purpose: Registers an application with IUCV |
305 | * Input: prmname - user identification | 305 | * Input: prmname - user identification |
306 | * userid - machine identification | 306 | * userid - machine identification |
307 | * pgmmask - indicates which bits in the prmname and userid combined will be | 307 | * pgmmask - indicates which bits in the prmname and userid combined will be |
308 | * used to determine who is given control | 308 | * used to determine who is given control |
309 | * ops - address of vector of interrupt handlers | 309 | * ops - address of vector of interrupt handlers |
310 | * pgm_data- application data passed to interrupt handlers | 310 | * pgm_data- application data passed to interrupt handlers |
311 | * Output: NA | 311 | * Output: NA |
312 | * Return: address of handler | 312 | * Return: address of handler |
313 | * (0) - Error occurred, registration not completed. | 313 | * (0) - Error occurred, registration not completed. |
314 | * NOTE: Exact cause of failure will be recorded in syslog. | 314 | * NOTE: Exact cause of failure will be recorded in syslog. |
315 | */ | 315 | */ |
316 | iucv_handle_t iucv_register_program (uchar pgmname[16], | 316 | iucv_handle_t iucv_register_program (uchar pgmname[16], |
317 | uchar userid[8], | 317 | uchar userid[8], |
@@ -319,13 +319,13 @@ iucv_handle_t iucv_register_program (uchar pgmname[16], | |||
319 | iucv_interrupt_ops_t * ops, | 319 | iucv_interrupt_ops_t * ops, |
320 | void *pgm_data); | 320 | void *pgm_data); |
321 | 321 | ||
322 | /* | 322 | /* |
323 | * Name: iucv_unregister_program | 323 | * Name: iucv_unregister_program |
324 | * Purpose: Unregister application with IUCV | 324 | * Purpose: Unregister application with IUCV |
325 | * Input: address of handler | 325 | * Input: address of handler |
326 | * Output: NA | 326 | * Output: NA |
327 | * Return: (0) - Normal return | 327 | * Return: (0) - Normal return |
328 | * (-EINVAL) - Internal error, wild pointer | 328 | * (-EINVAL) - Internal error, wild pointer |
329 | */ | 329 | */ |
330 | int iucv_unregister_program (iucv_handle_t handle); | 330 | int iucv_unregister_program (iucv_handle_t handle); |
331 | 331 | ||
@@ -333,7 +333,7 @@ int iucv_unregister_program (iucv_handle_t handle); | |||
333 | * Name: iucv_accept | 333 | * Name: iucv_accept |
334 | * Purpose: This function is issued after the user receives a Connection Pending external | 334 | * Purpose: This function is issued after the user receives a Connection Pending external |
335 | * interrupt and now wishes to complete the IUCV communication path. | 335 | * interrupt and now wishes to complete the IUCV communication path. |
336 | * Input: pathid - u16 , Path identification number | 336 | * Input: pathid - u16 , Path identification number |
337 | * msglim_reqstd - u16, The number of outstanding messages requested. | 337 | * msglim_reqstd - u16, The number of outstanding messages requested. |
338 | * user_data - uchar[16], Data specified by the iucv_connect function. | 338 | * user_data - uchar[16], Data specified by the iucv_connect function. |
339 | * flags1 - int, Contains options for this path. | 339 | * flags1 - int, Contains options for this path. |
@@ -358,34 +358,34 @@ int iucv_accept (u16 pathid, | |||
358 | void *pgm_data, int *flags1_out, u16 * msglim); | 358 | void *pgm_data, int *flags1_out, u16 * msglim); |
359 | 359 | ||
360 | /* | 360 | /* |
361 | * Name: iucv_connect | 361 | * Name: iucv_connect |
362 | * Purpose: This function establishes an IUCV path. Although the connect may complete | 362 | * Purpose: This function establishes an IUCV path. Although the connect may complete |
363 | * successfully, you are not able to use the path until you receive an IUCV | 363 | * successfully, you are not able to use the path until you receive an IUCV |
364 | * Connection Complete external interrupt. | 364 | * Connection Complete external interrupt. |
365 | * Input: pathid - u16 *, Path identification number | 365 | * Input: pathid - u16 *, Path identification number |
366 | * msglim_reqstd - u16, Number of outstanding messages requested | 366 | * msglim_reqstd - u16, Number of outstanding messages requested |
367 | * user_data - uchar[16], 16-byte user data | 367 | * user_data - uchar[16], 16-byte user data |
368 | * userid - uchar[8], User identification | 368 | * userid - uchar[8], User identification |
369 | * system_name - uchar[8], 8-byte identifying the system name | 369 | * system_name - uchar[8], 8-byte identifying the system name |
370 | * flags1 - int, Contains options for this path. | 370 | * flags1 - int, Contains options for this path. |
371 | * -IPPRTY - 0x20, Specifies if you want to send priority message. | 371 | * -IPPRTY - 0x20, Specifies if you want to send priority message. |
372 | * -IPRMDATA - 0x80, Specifies whether your program can handle a message | 372 | * -IPRMDATA - 0x80, Specifies whether your program can handle a message |
373 | * in the parameter list. | 373 | * in the parameter list. |
374 | * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being | 374 | * -IPQUSCE - 0x40, Specifies whether you want to quiesce the path being |
375 | * established. | 375 | * established. |
376 | * -IPLOCAL - 0X01, Allows an application to force the partner to be on | 376 | * -IPLOCAL - 0X01, Allows an application to force the partner to be on |
377 | * the local system. If local is specified then target class cannot be | 377 | * the local system. If local is specified then target class cannot be |
378 | * specified. | 378 | * specified. |
379 | * flags1_out - int * Contains information about the path | 379 | * flags1_out - int * Contains information about the path |
380 | * - IPPRTY - 0x20, Indicates you may send priority messages. | 380 | * - IPPRTY - 0x20, Indicates you may send priority messages. |
381 | * msglim - * u16, Number of outstanding messages | 381 | * msglim - * u16, Number of outstanding messages |
382 | * handle - iucv_handle_t, Address of handler | 382 | * handle - iucv_handle_t, Address of handler |
383 | * pgm_data - void *, Application data passed to interrupt handlers | 383 | * pgm_data - void *, Application data passed to interrupt handlers |
384 | * Output: return code from CP IUCV call | 384 | * Output: return code from CP IUCV call |
385 | * rc - return code from iucv_declare_buffer | 385 | * rc - return code from iucv_declare_buffer |
386 | * -EINVAL - Invalid handle passed by application | 386 | * -EINVAL - Invalid handle passed by application |
387 | * -EINVAL - Pathid address is NULL | 387 | * -EINVAL - Pathid address is NULL |
388 | * add_pathid_result - Return code from internal function add_pathid | 388 | * add_pathid_result - Return code from internal function add_pathid |
389 | */ | 389 | */ |
390 | int | 390 | int |
391 | iucv_connect (u16 * pathid, | 391 | iucv_connect (u16 * pathid, |
@@ -397,16 +397,16 @@ int | |||
397 | int *flags1_out, | 397 | int *flags1_out, |
398 | u16 * msglim, iucv_handle_t handle, void *pgm_data); | 398 | u16 * msglim, iucv_handle_t handle, void *pgm_data); |
399 | 399 | ||
400 | /* | 400 | /* |
401 | * Name: iucv_purge | 401 | * Name: iucv_purge |
402 | * Purpose: This function cancels a message that you have sent. | 402 | * Purpose: This function cancels a message that you have sent. |
403 | * Input: pathid - Path identification number. | 403 | * Input: pathid - Path identification number. |
404 | * msgid - Specifies the message ID of the message to be purged. | 404 | * msgid - Specifies the message ID of the message to be purged. |
405 | * srccls - Specifies the source message class. | 405 | * srccls - Specifies the source message class. |
406 | * Output: audit - Contains information about asynchronous error | 406 | * Output: audit - Contains information about asynchronous error |
407 | * that may have affected the normal completion | 407 | * that may have affected the normal completion |
408 | * of this message. | 408 | * of this message. |
409 | * Return: Return code from CP IUCV call. | 409 | * Return: Return code from CP IUCV call. |
410 | */ | 410 | */ |
411 | int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit); | 411 | int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit); |
412 | /* | 412 | /* |
@@ -426,38 +426,38 @@ ulong iucv_query_maxconn (void); | |||
426 | */ | 426 | */ |
427 | ulong iucv_query_bufsize (void); | 427 | ulong iucv_query_bufsize (void); |
428 | 428 | ||
429 | /* | 429 | /* |
430 | * Name: iucv_quiesce | 430 | * Name: iucv_quiesce |
431 | * Purpose: This function temporarily suspends incoming messages on an | 431 | * Purpose: This function temporarily suspends incoming messages on an |
432 | * IUCV path. You can later reactivate the path by invoking | 432 | * IUCV path. You can later reactivate the path by invoking |
433 | * the iucv_resume function. | 433 | * the iucv_resume function. |
434 | * Input: pathid - Path identification number | 434 | * Input: pathid - Path identification number |
435 | * user_data - 16-bytes of user data | 435 | * user_data - 16-bytes of user data |
436 | * Output: NA | 436 | * Output: NA |
437 | * Return: Return code from CP IUCV call. | 437 | * Return: Return code from CP IUCV call. |
438 | */ | 438 | */ |
439 | int iucv_quiesce (u16 pathid, uchar user_data[16]); | 439 | int iucv_quiesce (u16 pathid, uchar user_data[16]); |
440 | 440 | ||
441 | /* | 441 | /* |
442 | * Name: iucv_receive | 442 | * Name: iucv_receive |
443 | * Purpose: This function receives messages that are being sent to you | 443 | * Purpose: This function receives messages that are being sent to you |
444 | * over established paths. Data will be returned in buffer for length of | 444 | * over established paths. Data will be returned in buffer for length of |
445 | * buflen. | 445 | * buflen. |
446 | * Input: | 446 | * Input: |
447 | * pathid - Path identification number. | 447 | * pathid - Path identification number. |
448 | * buffer - Address of buffer to receive. | 448 | * buffer - Address of buffer to receive. |
449 | * buflen - Length of buffer to receive. | 449 | * buflen - Length of buffer to receive. |
450 | * msgid - Specifies the message ID. | 450 | * msgid - Specifies the message ID. |
451 | * trgcls - Specifies target class. | 451 | * trgcls - Specifies target class. |
452 | * Output: | 452 | * Output: |
453 | * flags1_out: int *, Contains information about this path. | 453 | * flags1_out: int *, Contains information about this path. |
454 | * IPNORPY - 0x10 Specifies this is a one-way message and no reply is | 454 | * IPNORPY - 0x10 Specifies this is a one-way message and no reply is |
455 | * expected. | 455 | * expected. |
456 | * IPPRTY - 0x20 Specifies if you want to send priority message. | 456 | * IPPRTY - 0x20 Specifies if you want to send priority message. |
457 | * IPRMDATA - 0x80 specifies the data is contained in the parameter list | 457 | * IPRMDATA - 0x80 specifies the data is contained in the parameter list |
458 | * residual_buffer - address of buffer updated by the number | 458 | * residual_buffer - address of buffer updated by the number |
459 | * of bytes you have received. | 459 | * of bytes you have received. |
460 | * residual_length - | 460 | * residual_length - |
461 | * Contains one of the following values, if the receive buffer is: | 461 | * Contains one of the following values, if the receive buffer is: |
462 | * The same length as the message, this field is zero. | 462 | * The same length as the message, this field is zero. |
463 | * Longer than the message, this field contains the number of | 463 | * Longer than the message, this field contains the number of |
@@ -466,8 +466,8 @@ int iucv_quiesce (u16 pathid, uchar user_data[16]); | |||
466 | * count (that is, the number of bytes remaining in the | 466 | * count (that is, the number of bytes remaining in the |
467 | * message that does not fit into the buffer. In this | 467 | * message that does not fit into the buffer. In this |
468 | * case b2f0_result = 5. | 468 | * case b2f0_result = 5. |
469 | * Return: Return code from CP IUCV call. | 469 | * Return: Return code from CP IUCV call. |
470 | * (-EINVAL) - buffer address is pointing to NULL | 470 | * (-EINVAL) - buffer address is pointing to NULL |
471 | */ | 471 | */ |
472 | int iucv_receive (u16 pathid, | 472 | int iucv_receive (u16 pathid, |
473 | u32 msgid, | 473 | u32 msgid, |
@@ -477,16 +477,16 @@ int iucv_receive (u16 pathid, | |||
477 | int *flags1_out, | 477 | int *flags1_out, |
478 | ulong * residual_buffer, ulong * residual_length); | 478 | ulong * residual_buffer, ulong * residual_length); |
479 | 479 | ||
480 | /* | 480 | /* |
481 | * Name: iucv_receive_array | 481 | * Name: iucv_receive_array |
482 | * Purpose: This function receives messages that are being sent to you | 482 | * Purpose: This function receives messages that are being sent to you |
483 | * over established paths. Data will be returned in first buffer for | 483 | * over established paths. Data will be returned in first buffer for |
484 | * length of first buffer. | 484 | * length of first buffer. |
485 | * Input: pathid - Path identification number. | 485 | * Input: pathid - Path identification number. |
486 | * msgid - specifies the message ID. | 486 | * msgid - specifies the message ID. |
487 | * trgcls - Specifies target class. | 487 | * trgcls - Specifies target class. |
488 | * buffer - Address of array of buffers. | 488 | * buffer - Address of array of buffers. |
489 | * buflen - Total length of buffers. | 489 | * buflen - Total length of buffers. |
490 | * Output: | 490 | * Output: |
491 | * flags1_out: int *, Contains information about this path. | 491 | * flags1_out: int *, Contains information about this path. |
492 | * IPNORPY - 0x10 Specifies this is a one-way message and no reply is | 492 | * IPNORPY - 0x10 Specifies this is a one-way message and no reply is |
@@ -504,8 +504,8 @@ int iucv_receive (u16 pathid, | |||
504 | * count (that is, the number of bytes remaining in the | 504 | * count (that is, the number of bytes remaining in the |
505 | * message that does not fit into the buffer. In this | 505 | * message that does not fit into the buffer. In this |
506 | * case b2f0_result = 5. | 506 | * case b2f0_result = 5. |
507 | * Return: Return code from CP IUCV call. | 507 | * Return: Return code from CP IUCV call. |
508 | * (-EINVAL) - Buffer address is NULL. | 508 | * (-EINVAL) - Buffer address is NULL. |
509 | */ | 509 | */ |
510 | int iucv_receive_array (u16 pathid, | 510 | int iucv_receive_array (u16 pathid, |
511 | u32 msgid, | 511 | u32 msgid, |
@@ -515,44 +515,44 @@ int iucv_receive_array (u16 pathid, | |||
515 | int *flags1_out, | 515 | int *flags1_out, |
516 | ulong * residual_buffer, ulong * residual_length); | 516 | ulong * residual_buffer, ulong * residual_length); |
517 | 517 | ||
518 | /* | 518 | /* |
519 | * Name: iucv_reject | 519 | * Name: iucv_reject |
520 | * Purpose: The reject function refuses a specified message. Between the | 520 | * Purpose: The reject function refuses a specified message. Between the |
521 | * time you are notified of a message and the time that you | 521 | * time you are notified of a message and the time that you |
522 | * complete the message, the message may be rejected. | 522 | * complete the message, the message may be rejected. |
523 | * Input: pathid - Path identification number. | 523 | * Input: pathid - Path identification number. |
524 | * msgid - Specifies the message ID. | 524 | * msgid - Specifies the message ID. |
525 | * trgcls - Specifies target class. | 525 | * trgcls - Specifies target class. |
526 | * Output: NA | 526 | * Output: NA |
527 | * Return: Return code from CP IUCV call. | 527 | * Return: Return code from CP IUCV call. |
528 | */ | 528 | */ |
529 | int iucv_reject (u16 pathid, u32 msgid, u32 trgcls); | 529 | int iucv_reject (u16 pathid, u32 msgid, u32 trgcls); |
530 | 530 | ||
531 | /* | 531 | /* |
532 | * Name: iucv_reply | 532 | * Name: iucv_reply |
533 | * Purpose: This function responds to the two-way messages that you | 533 | * Purpose: This function responds to the two-way messages that you |
534 | * receive. You must identify completely the message to | 534 | * receive. You must identify completely the message to |
535 | * which you wish to reply. ie, pathid, msgid, and trgcls. | 535 | * which you wish to reply. ie, pathid, msgid, and trgcls. |
536 | * Input: pathid - Path identification number. | 536 | * Input: pathid - Path identification number. |
537 | * msgid - Specifies the message ID. | 537 | * msgid - Specifies the message ID. |
538 | * trgcls - Specifies target class. | 538 | * trgcls - Specifies target class. |
539 | * flags1 - Option for path. | 539 | * flags1 - Option for path. |
540 | * IPPRTY- 0x20, Specifies if you want to send priority message. | 540 | * IPPRTY- 0x20, Specifies if you want to send priority message. |
541 | * buffer - Address of reply buffer. | 541 | * buffer - Address of reply buffer. |
542 | * buflen - Length of reply buffer. | 542 | * buflen - Length of reply buffer. |
543 | * Output: residual_buffer - Address of buffer updated by the number | 543 | * Output: residual_buffer - Address of buffer updated by the number |
544 | * of bytes you have moved. | 544 | * of bytes you have moved. |
545 | * residual_length - Contains one of the following values: | 545 | * residual_length - Contains one of the following values: |
546 | * If the answer buffer is the same length as the reply, this field | 546 | * If the answer buffer is the same length as the reply, this field |
547 | * contains zero. | 547 | * contains zero. |
548 | * If the answer buffer is longer than the reply, this field contains | 548 | * If the answer buffer is longer than the reply, this field contains |
549 | * the number of bytes remaining in the buffer. | 549 | * the number of bytes remaining in the buffer. |
550 | * If the answer buffer is shorter than the reply, this field contains | 550 | * If the answer buffer is shorter than the reply, this field contains |
551 | * a residual count (that is, the number of bytes remianing in the | 551 | * a residual count (that is, the number of bytes remianing in the |
552 | * reply that does not fit into the buffer. In this | 552 | * reply that does not fit into the buffer. In this |
553 | * case b2f0_result = 5. | 553 | * case b2f0_result = 5. |
554 | * Return: Return code from CP IUCV call. | 554 | * Return: Return code from CP IUCV call. |
555 | * (-EINVAL) - Buffer address is NULL. | 555 | * (-EINVAL) - Buffer address is NULL. |
556 | */ | 556 | */ |
557 | int iucv_reply (u16 pathid, | 557 | int iucv_reply (u16 pathid, |
558 | u32 msgid, | 558 | u32 msgid, |
@@ -561,20 +561,20 @@ int iucv_reply (u16 pathid, | |||
561 | void *buffer, ulong buflen, ulong * residual_buffer, | 561 | void *buffer, ulong buflen, ulong * residual_buffer, |
562 | ulong * residual_length); | 562 | ulong * residual_length); |
563 | 563 | ||
564 | /* | 564 | /* |
565 | * Name: iucv_reply_array | 565 | * Name: iucv_reply_array |
566 | * Purpose: This function responds to the two-way messages that you | 566 | * Purpose: This function responds to the two-way messages that you |
567 | * receive. You must identify completely the message to | 567 | * receive. You must identify completely the message to |
568 | * which you wish to reply. ie, pathid, msgid, and trgcls. | 568 | * which you wish to reply. ie, pathid, msgid, and trgcls. |
569 | * The array identifies a list of addresses and lengths of | 569 | * The array identifies a list of addresses and lengths of |
570 | * discontiguous buffers that contains the reply data. | 570 | * discontiguous buffers that contains the reply data. |
571 | * Input: pathid - Path identification number | 571 | * Input: pathid - Path identification number |
572 | * msgid - Specifies the message ID. | 572 | * msgid - Specifies the message ID. |
573 | * trgcls - Specifies target class. | 573 | * trgcls - Specifies target class. |
574 | * flags1 - Option for path. | 574 | * flags1 - Option for path. |
575 | * IPPRTY- 0x20, Specifies if you want to send priority message. | 575 | * IPPRTY- 0x20, Specifies if you want to send priority message. |
576 | * buffer - Address of array of reply buffers. | 576 | * buffer - Address of array of reply buffers. |
577 | * buflen - Total length of reply buffers. | 577 | * buflen - Total length of reply buffers. |
578 | * Output: residual_buffer - Address of buffer which IUCV is currently working on. | 578 | * Output: residual_buffer - Address of buffer which IUCV is currently working on. |
579 | * residual_length - Contains one of the following values: | 579 | * residual_length - Contains one of the following values: |
580 | * If the answer buffer is the same length as the reply, this field | 580 | * If the answer buffer is the same length as the reply, this field |
@@ -585,8 +585,8 @@ int iucv_reply (u16 pathid, | |||
585 | * a residual count (that is, the number of bytes remianing in the | 585 | * a residual count (that is, the number of bytes remianing in the |
586 | * reply that does not fit into the buffer. In this | 586 | * reply that does not fit into the buffer. In this |
587 | * case b2f0_result = 5. | 587 | * case b2f0_result = 5. |
588 | * Return: Return code from CP IUCV call. | 588 | * Return: Return code from CP IUCV call. |
589 | * (-EINVAL) - Buffer address is NULL. | 589 | * (-EINVAL) - Buffer address is NULL. |
590 | */ | 590 | */ |
591 | int iucv_reply_array (u16 pathid, | 591 | int iucv_reply_array (u16 pathid, |
592 | u32 msgid, | 592 | u32 msgid, |
@@ -596,77 +596,77 @@ int iucv_reply_array (u16 pathid, | |||
596 | ulong buflen, ulong * residual_address, | 596 | ulong buflen, ulong * residual_address, |
597 | ulong * residual_length); | 597 | ulong * residual_length); |
598 | 598 | ||
599 | /* | 599 | /* |
600 | * Name: iucv_reply_prmmsg | 600 | * Name: iucv_reply_prmmsg |
601 | * Purpose: This function responds to the two-way messages that you | 601 | * Purpose: This function responds to the two-way messages that you |
602 | * receive. You must identify completely the message to | 602 | * receive. You must identify completely the message to |
603 | * which you wish to reply. ie, pathid, msgid, and trgcls. | 603 | * which you wish to reply. ie, pathid, msgid, and trgcls. |
604 | * Prmmsg signifies the data is moved into the | 604 | * Prmmsg signifies the data is moved into the |
605 | * parameter list. | 605 | * parameter list. |
606 | * Input: pathid - Path identification number. | 606 | * Input: pathid - Path identification number. |
607 | * msgid - Specifies the message ID. | 607 | * msgid - Specifies the message ID. |
608 | * trgcls - Specifies target class. | 608 | * trgcls - Specifies target class. |
609 | * flags1 - Option for path. | 609 | * flags1 - Option for path. |
610 | * IPPRTY- 0x20 Specifies if you want to send priority message. | 610 | * IPPRTY- 0x20 Specifies if you want to send priority message. |
611 | * prmmsg - 8-bytes of data to be placed into the parameter. | 611 | * prmmsg - 8-bytes of data to be placed into the parameter. |
612 | * list. | 612 | * list. |
613 | * Output: NA | 613 | * Output: NA |
614 | * Return: Return code from CP IUCV call. | 614 | * Return: Return code from CP IUCV call. |
615 | */ | 615 | */ |
616 | int iucv_reply_prmmsg (u16 pathid, | 616 | int iucv_reply_prmmsg (u16 pathid, |
617 | u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]); | 617 | u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]); |
618 | 618 | ||
619 | /* | 619 | /* |
620 | * Name: iucv_resume | 620 | * Name: iucv_resume |
621 | * Purpose: This function restores communications over a quiesced path | 621 | * Purpose: This function restores communications over a quiesced path |
622 | * Input: pathid - Path identification number. | 622 | * Input: pathid - Path identification number. |
623 | * user_data - 16-bytes of user data. | 623 | * user_data - 16-bytes of user data. |
624 | * Output: NA | 624 | * Output: NA |
625 | * Return: Return code from CP IUCV call. | 625 | * Return: Return code from CP IUCV call. |
626 | */ | 626 | */ |
627 | int iucv_resume (u16 pathid, uchar user_data[16]); | 627 | int iucv_resume (u16 pathid, uchar user_data[16]); |
628 | 628 | ||
629 | /* | 629 | /* |
630 | * Name: iucv_send | 630 | * Name: iucv_send |
631 | * Purpose: This function transmits data to another application. | 631 | * Purpose: This function transmits data to another application. |
632 | * Data to be transmitted is in a buffer and this is a | 632 | * Data to be transmitted is in a buffer and this is a |
633 | * one-way message and the receiver will not reply to the | 633 | * one-way message and the receiver will not reply to the |
634 | * message. | 634 | * message. |
635 | * Input: pathid - Path identification number. | 635 | * Input: pathid - Path identification number. |
636 | * trgcls - Specifies target class. | 636 | * trgcls - Specifies target class. |
637 | * srccls - Specifies the source message class. | 637 | * srccls - Specifies the source message class. |
638 | * msgtag - Specifies a tag to be associated with the message. | 638 | * msgtag - Specifies a tag to be associated with the message. |
639 | * flags1 - Option for path. | 639 | * flags1 - Option for path. |
640 | * IPPRTY- 0x20 Specifies if you want to send priority message. | 640 | * IPPRTY- 0x20 Specifies if you want to send priority message. |
641 | * buffer - Address of send buffer. | 641 | * buffer - Address of send buffer. |
642 | * buflen - Length of send buffer. | 642 | * buflen - Length of send buffer. |
643 | * Output: msgid - Specifies the message ID. | 643 | * Output: msgid - Specifies the message ID. |
644 | * Return: Return code from CP IUCV call. | 644 | * Return: Return code from CP IUCV call. |
645 | * (-EINVAL) - Buffer address is NULL. | 645 | * (-EINVAL) - Buffer address is NULL. |
646 | */ | 646 | */ |
647 | int iucv_send (u16 pathid, | 647 | int iucv_send (u16 pathid, |
648 | u32 * msgid, | 648 | u32 * msgid, |
649 | u32 trgcls, | 649 | u32 trgcls, |
650 | u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen); | 650 | u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen); |
651 | 651 | ||
652 | /* | 652 | /* |
653 | * Name: iucv_send_array | 653 | * Name: iucv_send_array |
654 | * Purpose: This function transmits data to another application. | 654 | * Purpose: This function transmits data to another application. |
655 | * The contents of buffer is the address of the array of | 655 | * The contents of buffer is the address of the array of |
656 | * addresses and lengths of discontiguous buffers that hold | 656 | * addresses and lengths of discontiguous buffers that hold |
657 | * the message text. This is a one-way message and the | 657 | * the message text. This is a one-way message and the |
658 | * receiver will not reply to the message. | 658 | * receiver will not reply to the message. |
659 | * Input: pathid - Path identification number. | 659 | * Input: pathid - Path identification number. |
660 | * trgcls - Specifies target class. | 660 | * trgcls - Specifies target class. |
661 | * srccls - Specifies the source message class. | 661 | * srccls - Specifies the source message class. |
662 | * msgtag - Specifies a tag to be associated witht the message. | 662 | * msgtag - Specifies a tag to be associated witht the message. |
663 | * flags1 - Option for path. | 663 | * flags1 - Option for path. |
664 | * IPPRTY- specifies if you want to send priority message. | 664 | * IPPRTY- specifies if you want to send priority message. |
665 | * buffer - Address of array of send buffers. | 665 | * buffer - Address of array of send buffers. |
666 | * buflen - Total length of send buffers. | 666 | * buflen - Total length of send buffers. |
667 | * Output: msgid - Specifies the message ID. | 667 | * Output: msgid - Specifies the message ID. |
668 | * Return: Return code from CP IUCV call. | 668 | * Return: Return code from CP IUCV call. |
669 | * (-EINVAL) - Buffer address is NULL. | 669 | * (-EINVAL) - Buffer address is NULL. |
670 | */ | 670 | */ |
671 | int iucv_send_array (u16 pathid, | 671 | int iucv_send_array (u16 pathid, |
672 | u32 * msgid, | 672 | u32 * msgid, |
@@ -675,48 +675,48 @@ int iucv_send_array (u16 pathid, | |||
675 | u32 msgtag, | 675 | u32 msgtag, |
676 | int flags1, iucv_array_t * buffer, ulong buflen); | 676 | int flags1, iucv_array_t * buffer, ulong buflen); |
677 | 677 | ||
678 | /* | 678 | /* |
679 | * Name: iucv_send_prmmsg | 679 | * Name: iucv_send_prmmsg |
680 | * Purpose: This function transmits data to another application. | 680 | * Purpose: This function transmits data to another application. |
681 | * Prmmsg specifies that the 8-bytes of data are to be moved | 681 | * Prmmsg specifies that the 8-bytes of data are to be moved |
682 | * into the parameter list. This is a one-way message and the | 682 | * into the parameter list. This is a one-way message and the |
683 | * receiver will not reply to the message. | 683 | * receiver will not reply to the message. |
684 | * Input: pathid - Path identification number. | 684 | * Input: pathid - Path identification number. |
685 | * trgcls - Specifies target class. | 685 | * trgcls - Specifies target class. |
686 | * srccls - Specifies the source message class. | 686 | * srccls - Specifies the source message class. |
687 | * msgtag - Specifies a tag to be associated with the message. | 687 | * msgtag - Specifies a tag to be associated with the message. |
688 | * flags1 - Option for path. | 688 | * flags1 - Option for path. |
689 | * IPPRTY- 0x20 specifies if you want to send priority message. | 689 | * IPPRTY- 0x20 specifies if you want to send priority message. |
690 | * prmmsg - 8-bytes of data to be placed into parameter list. | 690 | * prmmsg - 8-bytes of data to be placed into parameter list. |
691 | * Output: msgid - Specifies the message ID. | 691 | * Output: msgid - Specifies the message ID. |
692 | * Return: Return code from CP IUCV call. | 692 | * Return: Return code from CP IUCV call. |
693 | */ | 693 | */ |
694 | int iucv_send_prmmsg (u16 pathid, | 694 | int iucv_send_prmmsg (u16 pathid, |
695 | u32 * msgid, | 695 | u32 * msgid, |
696 | u32 trgcls, | 696 | u32 trgcls, |
697 | u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]); | 697 | u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]); |
698 | 698 | ||
699 | /* | 699 | /* |
700 | * Name: iucv_send2way | 700 | * Name: iucv_send2way |
701 | * Purpose: This function transmits data to another application. | 701 | * Purpose: This function transmits data to another application. |
702 | * Data to be transmitted is in a buffer. The receiver | 702 | * Data to be transmitted is in a buffer. The receiver |
703 | * of the send is expected to reply to the message and | 703 | * of the send is expected to reply to the message and |
704 | * a buffer is provided into which IUCV moves the reply | 704 | * a buffer is provided into which IUCV moves the reply |
705 | * to this message. | 705 | * to this message. |
706 | * Input: pathid - Path identification number. | 706 | * Input: pathid - Path identification number. |
707 | * trgcls - Specifies target class. | 707 | * trgcls - Specifies target class. |
708 | * srccls - Specifies the source message class. | 708 | * srccls - Specifies the source message class. |
709 | * msgtag - Specifies a tag associated with the message. | 709 | * msgtag - Specifies a tag associated with the message. |
710 | * flags1 - Option for path. | 710 | * flags1 - Option for path. |
711 | * IPPRTY- 0x20 Specifies if you want to send priority message. | 711 | * IPPRTY- 0x20 Specifies if you want to send priority message. |
712 | * buffer - Address of send buffer. | 712 | * buffer - Address of send buffer. |
713 | * buflen - Length of send buffer. | 713 | * buflen - Length of send buffer. |
714 | * ansbuf - Address of buffer into which IUCV moves the reply of | 714 | * ansbuf - Address of buffer into which IUCV moves the reply of |
715 | * this message. | 715 | * this message. |
716 | * anslen - Address of length of buffer. | 716 | * anslen - Address of length of buffer. |
717 | * Output: msgid - Specifies the message ID. | 717 | * Output: msgid - Specifies the message ID. |
718 | * Return: Return code from CP IUCV call. | 718 | * Return: Return code from CP IUCV call. |
719 | * (-EINVAL) - Buffer or ansbuf address is NULL. | 719 | * (-EINVAL) - Buffer or ansbuf address is NULL. |
720 | */ | 720 | */ |
721 | int iucv_send2way (u16 pathid, | 721 | int iucv_send2way (u16 pathid, |
722 | u32 * msgid, | 722 | u32 * msgid, |
@@ -726,28 +726,28 @@ int iucv_send2way (u16 pathid, | |||
726 | int flags1, | 726 | int flags1, |
727 | void *buffer, ulong buflen, void *ansbuf, ulong anslen); | 727 | void *buffer, ulong buflen, void *ansbuf, ulong anslen); |
728 | 728 | ||
729 | /* | 729 | /* |
730 | * Name: iucv_send2way_array | 730 | * Name: iucv_send2way_array |
731 | * Purpose: This function transmits data to another application. | 731 | * Purpose: This function transmits data to another application. |
732 | * The contents of buffer is the address of the array of | 732 | * The contents of buffer is the address of the array of |
733 | * addresses and lengths of discontiguous buffers that hold | 733 | * addresses and lengths of discontiguous buffers that hold |
734 | * the message text. The receiver of the send is expected to | 734 | * the message text. The receiver of the send is expected to |
735 | * reply to the message and a buffer is provided into which | 735 | * reply to the message and a buffer is provided into which |
736 | * IUCV moves the reply to this message. | 736 | * IUCV moves the reply to this message. |
737 | * Input: pathid - Path identification number. | 737 | * Input: pathid - Path identification number. |
738 | * trgcls - Specifies target class. | 738 | * trgcls - Specifies target class. |
739 | * srccls - Specifies the source message class. | 739 | * srccls - Specifies the source message class. |
740 | * msgtag - Specifies a tag to be associated with the message. | 740 | * msgtag - Specifies a tag to be associated with the message. |
741 | * flags1 - Option for path. | 741 | * flags1 - Option for path. |
742 | * IPPRTY- 0x20 Specifies if you want to send priority message. | 742 | * IPPRTY- 0x20 Specifies if you want to send priority message. |
743 | * buffer - Sddress of array of send buffers. | 743 | * buffer - Sddress of array of send buffers. |
744 | * buflen - Total length of send buffers. | 744 | * buflen - Total length of send buffers. |
745 | * ansbuf - Address of array of buffer into which IUCV moves the reply | 745 | * ansbuf - Address of array of buffer into which IUCV moves the reply |
746 | * of this message. | 746 | * of this message. |
747 | * anslen - Address of length reply buffers. | 747 | * anslen - Address of length reply buffers. |
748 | * Output: msgid - Specifies the message ID. | 748 | * Output: msgid - Specifies the message ID. |
749 | * Return: Return code from CP IUCV call. | 749 | * Return: Return code from CP IUCV call. |
750 | * (-EINVAL) - Buffer address is NULL. | 750 | * (-EINVAL) - Buffer address is NULL. |
751 | */ | 751 | */ |
752 | int iucv_send2way_array (u16 pathid, | 752 | int iucv_send2way_array (u16 pathid, |
753 | u32 * msgid, | 753 | u32 * msgid, |
@@ -758,27 +758,27 @@ int iucv_send2way_array (u16 pathid, | |||
758 | iucv_array_t * buffer, | 758 | iucv_array_t * buffer, |
759 | ulong buflen, iucv_array_t * ansbuf, ulong anslen); | 759 | ulong buflen, iucv_array_t * ansbuf, ulong anslen); |
760 | 760 | ||
761 | /* | 761 | /* |
762 | * Name: iucv_send2way_prmmsg | 762 | * Name: iucv_send2way_prmmsg |
763 | * Purpose: This function transmits data to another application. | 763 | * Purpose: This function transmits data to another application. |
764 | * Prmmsg specifies that the 8-bytes of data are to be moved | 764 | * Prmmsg specifies that the 8-bytes of data are to be moved |
765 | * into the parameter list. This is a two-way message and the | 765 | * into the parameter list. This is a two-way message and the |
766 | * receiver of the message is expected to reply. A buffer | 766 | * receiver of the message is expected to reply. A buffer |
767 | * is provided into which IUCV moves the reply to this | 767 | * is provided into which IUCV moves the reply to this |
768 | * message. | 768 | * message. |
769 | * Input: pathid - Rath identification number. | 769 | * Input: pathid - Rath identification number. |
770 | * trgcls - Specifies target class. | 770 | * trgcls - Specifies target class. |
771 | * srccls - Specifies the source message class. | 771 | * srccls - Specifies the source message class. |
772 | * msgtag - Specifies a tag to be associated with the message. | 772 | * msgtag - Specifies a tag to be associated with the message. |
773 | * flags1 - Option for path. | 773 | * flags1 - Option for path. |
774 | * IPPRTY- 0x20 Specifies if you want to send priority message. | 774 | * IPPRTY- 0x20 Specifies if you want to send priority message. |
775 | * prmmsg - 8-bytes of data to be placed in parameter list. | 775 | * prmmsg - 8-bytes of data to be placed in parameter list. |
776 | * ansbuf - Address of buffer into which IUCV moves the reply of | 776 | * ansbuf - Address of buffer into which IUCV moves the reply of |
777 | * this message. | 777 | * this message. |
778 | * anslen - Address of length of buffer. | 778 | * anslen - Address of length of buffer. |
779 | * Output: msgid - Specifies the message ID. | 779 | * Output: msgid - Specifies the message ID. |
780 | * Return: Return code from CP IUCV call. | 780 | * Return: Return code from CP IUCV call. |
781 | * (-EINVAL) - Buffer address is NULL. | 781 | * (-EINVAL) - Buffer address is NULL. |
782 | */ | 782 | */ |
783 | int iucv_send2way_prmmsg (u16 pathid, | 783 | int iucv_send2way_prmmsg (u16 pathid, |
784 | u32 * msgid, | 784 | u32 * msgid, |
@@ -788,29 +788,29 @@ int iucv_send2way_prmmsg (u16 pathid, | |||
788 | ulong flags1, | 788 | ulong flags1, |
789 | uchar prmmsg[8], void *ansbuf, ulong anslen); | 789 | uchar prmmsg[8], void *ansbuf, ulong anslen); |
790 | 790 | ||
791 | /* | 791 | /* |
792 | * Name: iucv_send2way_prmmsg_array | 792 | * Name: iucv_send2way_prmmsg_array |
793 | * Purpose: This function transmits data to another application. | 793 | * Purpose: This function transmits data to another application. |
794 | * Prmmsg specifies that the 8-bytes of data are to be moved | 794 | * Prmmsg specifies that the 8-bytes of data are to be moved |
795 | * into the parameter list. This is a two-way message and the | 795 | * into the parameter list. This is a two-way message and the |
796 | * receiver of the message is expected to reply. A buffer | 796 | * receiver of the message is expected to reply. A buffer |
797 | * is provided into which IUCV moves the reply to this | 797 | * is provided into which IUCV moves the reply to this |
798 | * message. The contents of ansbuf is the address of the | 798 | * message. The contents of ansbuf is the address of the |
799 | * array of addresses and lengths of discontiguous buffers | 799 | * array of addresses and lengths of discontiguous buffers |
800 | * that contain the reply. | 800 | * that contain the reply. |
801 | * Input: pathid - Path identification number. | 801 | * Input: pathid - Path identification number. |
802 | * trgcls - Specifies target class. | 802 | * trgcls - Specifies target class. |
803 | * srccls - Specifies the source message class. | 803 | * srccls - Specifies the source message class. |
804 | * msgtag - Specifies a tag to be associated with the message. | 804 | * msgtag - Specifies a tag to be associated with the message. |
805 | * flags1 - Option for path. | 805 | * flags1 - Option for path. |
806 | * IPPRTY- 0x20 specifies if you want to send priority message. | 806 | * IPPRTY- 0x20 specifies if you want to send priority message. |
807 | * prmmsg - 8-bytes of data to be placed into the parameter list. | 807 | * prmmsg - 8-bytes of data to be placed into the parameter list. |
808 | * ansbuf - Address of array of buffer into which IUCV moves the reply | 808 | * ansbuf - Address of array of buffer into which IUCV moves the reply |
809 | * of this message. | 809 | * of this message. |
810 | * anslen - Address of length of reply buffers. | 810 | * anslen - Address of length of reply buffers. |
811 | * Output: msgid - Specifies the message ID. | 811 | * Output: msgid - Specifies the message ID. |
812 | * Return: Return code from CP IUCV call. | 812 | * Return: Return code from CP IUCV call. |
813 | * (-EINVAL) - Ansbuf address is NULL. | 813 | * (-EINVAL) - Ansbuf address is NULL. |
814 | */ | 814 | */ |
815 | int iucv_send2way_prmmsg_array (u16 pathid, | 815 | int iucv_send2way_prmmsg_array (u16 pathid, |
816 | u32 * msgid, | 816 | u32 * msgid, |
@@ -821,29 +821,29 @@ int iucv_send2way_prmmsg_array (u16 pathid, | |||
821 | uchar prmmsg[8], | 821 | uchar prmmsg[8], |
822 | iucv_array_t * ansbuf, ulong anslen); | 822 | iucv_array_t * ansbuf, ulong anslen); |
823 | 823 | ||
824 | /* | 824 | /* |
825 | * Name: iucv_setmask | 825 | * Name: iucv_setmask |
826 | * Purpose: This function enables or disables the following IUCV | 826 | * Purpose: This function enables or disables the following IUCV |
827 | * external interruptions: Nonpriority and priority message | 827 | * external interruptions: Nonpriority and priority message |
828 | * interrupts, nonpriority and priority reply interrupts. | 828 | * interrupts, nonpriority and priority reply interrupts. |
829 | * Input: SetMaskFlag - options for interrupts | 829 | * Input: SetMaskFlag - options for interrupts |
830 | * 0x80 - Nonpriority_MessagePendingInterruptsFlag | 830 | * 0x80 - Nonpriority_MessagePendingInterruptsFlag |
831 | * 0x40 - Priority_MessagePendingInterruptsFlag | 831 | * 0x40 - Priority_MessagePendingInterruptsFlag |
832 | * 0x20 - Nonpriority_MessageCompletionInterruptsFlag | 832 | * 0x20 - Nonpriority_MessageCompletionInterruptsFlag |
833 | * 0x10 - Priority_MessageCompletionInterruptsFlag | 833 | * 0x10 - Priority_MessageCompletionInterruptsFlag |
834 | * 0x08 - IUCVControlInterruptsFlag | 834 | * 0x08 - IUCVControlInterruptsFlag |
835 | * Output: NA | 835 | * Output: NA |
836 | * Return: Return code from CP IUCV call. | 836 | * Return: Return code from CP IUCV call. |
837 | */ | 837 | */ |
838 | int iucv_setmask (int SetMaskFlag); | 838 | int iucv_setmask (int SetMaskFlag); |
839 | 839 | ||
840 | /* | 840 | /* |
841 | * Name: iucv_sever | 841 | * Name: iucv_sever |
842 | * Purpose: This function terminates an IUCV path. | 842 | * Purpose: This function terminates an IUCV path. |
843 | * Input: pathid - Path identification number. | 843 | * Input: pathid - Path identification number. |
844 | * user_data - 16-bytes of user data. | 844 | * user_data - 16-bytes of user data. |
845 | * Output: NA | 845 | * Output: NA |
846 | * Return: Return code from CP IUCV call. | 846 | * Return: Return code from CP IUCV call. |
847 | * (-EINVAL) - Interal error, wild pointer. | 847 | * (-EINVAL) - Interal error, wild pointer. |
848 | */ | 848 | */ |
849 | int iucv_sever (u16 pathid, uchar user_data[16]); | 849 | int iucv_sever (u16 pathid, uchar user_data[16]); |
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index e65da921a827..f94419b334f7 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -68,6 +68,7 @@ static void lcs_tasklet(unsigned long); | |||
68 | static void lcs_start_kernel_thread(struct lcs_card *card); | 68 | static void lcs_start_kernel_thread(struct lcs_card *card); |
69 | static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); | 69 | static void lcs_get_frames_cb(struct lcs_channel *, struct lcs_buffer *); |
70 | static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); | 70 | static int lcs_send_delipm(struct lcs_card *, struct lcs_ipm_list *); |
71 | static int lcs_recovery(void *ptr); | ||
71 | 72 | ||
72 | /** | 73 | /** |
73 | * Debug Facility Stuff | 74 | * Debug Facility Stuff |
@@ -429,12 +430,6 @@ lcs_setup_card(struct lcs_card *card) | |||
429 | card->tx_buffer = NULL; | 430 | card->tx_buffer = NULL; |
430 | card->tx_emitted = 0; | 431 | card->tx_emitted = 0; |
431 | 432 | ||
432 | /* Initialize kernel thread task used for LGW commands. */ | ||
433 | INIT_WORK(&card->kernel_thread_starter, | ||
434 | (void *)lcs_start_kernel_thread,card); | ||
435 | card->thread_start_mask = 0; | ||
436 | card->thread_allowed_mask = 0; | ||
437 | card->thread_running_mask = 0; | ||
438 | init_waitqueue_head(&card->wait_q); | 433 | init_waitqueue_head(&card->wait_q); |
439 | spin_lock_init(&card->lock); | 434 | spin_lock_init(&card->lock); |
440 | spin_lock_init(&card->ipm_lock); | 435 | spin_lock_init(&card->ipm_lock); |
@@ -675,8 +670,9 @@ lcs_ready_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) | |||
675 | int index, rc; | 670 | int index, rc; |
676 | 671 | ||
677 | LCS_DBF_TEXT(5, trace, "rdybuff"); | 672 | LCS_DBF_TEXT(5, trace, "rdybuff"); |
678 | BUG_ON(buffer->state != BUF_STATE_LOCKED && | 673 | if (buffer->state != BUF_STATE_LOCKED && |
679 | buffer->state != BUF_STATE_PROCESSED); | 674 | buffer->state != BUF_STATE_PROCESSED) |
675 | BUG(); | ||
680 | spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); | 676 | spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); |
681 | buffer->state = BUF_STATE_READY; | 677 | buffer->state = BUF_STATE_READY; |
682 | index = buffer - channel->iob; | 678 | index = buffer - channel->iob; |
@@ -700,7 +696,8 @@ __lcs_processed_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) | |||
700 | int index, prev, next; | 696 | int index, prev, next; |
701 | 697 | ||
702 | LCS_DBF_TEXT(5, trace, "prcsbuff"); | 698 | LCS_DBF_TEXT(5, trace, "prcsbuff"); |
703 | BUG_ON(buffer->state != BUF_STATE_READY); | 699 | if (buffer->state != BUF_STATE_READY) |
700 | BUG(); | ||
704 | buffer->state = BUF_STATE_PROCESSED; | 701 | buffer->state = BUF_STATE_PROCESSED; |
705 | index = buffer - channel->iob; | 702 | index = buffer - channel->iob; |
706 | prev = (index - 1) & (LCS_NUM_BUFFS - 1); | 703 | prev = (index - 1) & (LCS_NUM_BUFFS - 1); |
@@ -732,8 +729,9 @@ lcs_release_buffer(struct lcs_channel *channel, struct lcs_buffer *buffer) | |||
732 | unsigned long flags; | 729 | unsigned long flags; |
733 | 730 | ||
734 | LCS_DBF_TEXT(5, trace, "relbuff"); | 731 | LCS_DBF_TEXT(5, trace, "relbuff"); |
735 | BUG_ON(buffer->state != BUF_STATE_LOCKED && | 732 | if (buffer->state != BUF_STATE_LOCKED && |
736 | buffer->state != BUF_STATE_PROCESSED); | 733 | buffer->state != BUF_STATE_PROCESSED) |
734 | BUG(); | ||
737 | spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); | 735 | spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags); |
738 | buffer->state = BUF_STATE_EMPTY; | 736 | buffer->state = BUF_STATE_EMPTY; |
739 | spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); | 737 | spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags); |
@@ -1147,8 +1145,6 @@ list_modified: | |||
1147 | list_add_tail(&ipm->list, &card->ipm_list); | 1145 | list_add_tail(&ipm->list, &card->ipm_list); |
1148 | } | 1146 | } |
1149 | spin_unlock_irqrestore(&card->ipm_lock, flags); | 1147 | spin_unlock_irqrestore(&card->ipm_lock, flags); |
1150 | if (card->state == DEV_STATE_UP) | ||
1151 | netif_wake_queue(card->dev); | ||
1152 | } | 1148 | } |
1153 | 1149 | ||
1154 | /** | 1150 | /** |
@@ -1231,17 +1227,17 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev) | |||
1231 | if (ipm != NULL) | 1227 | if (ipm != NULL) |
1232 | continue; /* Address already in list. */ | 1228 | continue; /* Address already in list. */ |
1233 | ipm = (struct lcs_ipm_list *) | 1229 | ipm = (struct lcs_ipm_list *) |
1234 | kmalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); | 1230 | kzalloc(sizeof(struct lcs_ipm_list), GFP_ATOMIC); |
1235 | if (ipm == NULL) { | 1231 | if (ipm == NULL) { |
1236 | PRINT_INFO("Not enough memory to add " | 1232 | PRINT_INFO("Not enough memory to add " |
1237 | "new multicast entry!\n"); | 1233 | "new multicast entry!\n"); |
1238 | break; | 1234 | break; |
1239 | } | 1235 | } |
1240 | memset(ipm, 0, sizeof(struct lcs_ipm_list)); | ||
1241 | memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); | 1236 | memcpy(&ipm->ipm.mac_addr, buf, LCS_MAC_LENGTH); |
1242 | ipm->ipm.ip_addr = im4->multiaddr; | 1237 | ipm->ipm.ip_addr = im4->multiaddr; |
1243 | ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED; | 1238 | ipm->ipm_state = LCS_IPM_STATE_SET_REQUIRED; |
1244 | spin_lock_irqsave(&card->ipm_lock, flags); | 1239 | spin_lock_irqsave(&card->ipm_lock, flags); |
1240 | LCS_DBF_HEX(2,trace,&ipm->ipm.ip_addr,4); | ||
1245 | list_add(&ipm->list, &card->ipm_list); | 1241 | list_add(&ipm->list, &card->ipm_list); |
1246 | spin_unlock_irqrestore(&card->ipm_lock, flags); | 1242 | spin_unlock_irqrestore(&card->ipm_lock, flags); |
1247 | } | 1243 | } |
@@ -1269,7 +1265,15 @@ lcs_register_mc_addresses(void *data) | |||
1269 | read_unlock(&in4_dev->mc_list_lock); | 1265 | read_unlock(&in4_dev->mc_list_lock); |
1270 | in_dev_put(in4_dev); | 1266 | in_dev_put(in4_dev); |
1271 | 1267 | ||
1268 | netif_carrier_off(card->dev); | ||
1269 | netif_tx_disable(card->dev); | ||
1270 | wait_event(card->write.wait_q, | ||
1271 | (card->write.state != CH_STATE_RUNNING)); | ||
1272 | lcs_fix_multicast_list(card); | 1272 | lcs_fix_multicast_list(card); |
1273 | if (card->state == DEV_STATE_UP) { | ||
1274 | netif_carrier_on(card->dev); | ||
1275 | netif_wake_queue(card->dev); | ||
1276 | } | ||
1273 | out: | 1277 | out: |
1274 | lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD); | 1278 | lcs_clear_thread_running_bit(card, LCS_SET_MC_THREAD); |
1275 | return 0; | 1279 | return 0; |
@@ -1286,7 +1290,7 @@ lcs_set_multicast_list(struct net_device *dev) | |||
1286 | LCS_DBF_TEXT(4, trace, "setmulti"); | 1290 | LCS_DBF_TEXT(4, trace, "setmulti"); |
1287 | card = (struct lcs_card *) dev->priv; | 1291 | card = (struct lcs_card *) dev->priv; |
1288 | 1292 | ||
1289 | if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) | 1293 | if (!lcs_set_thread_start_bit(card, LCS_SET_MC_THREAD)) |
1290 | schedule_work(&card->kernel_thread_starter); | 1294 | schedule_work(&card->kernel_thread_starter); |
1291 | } | 1295 | } |
1292 | 1296 | ||
@@ -1318,6 +1322,53 @@ lcs_check_irb_error(struct ccw_device *cdev, struct irb *irb) | |||
1318 | return PTR_ERR(irb); | 1322 | return PTR_ERR(irb); |
1319 | } | 1323 | } |
1320 | 1324 | ||
1325 | static int | ||
1326 | lcs_get_problem(struct ccw_device *cdev, struct irb *irb) | ||
1327 | { | ||
1328 | int dstat, cstat; | ||
1329 | char *sense; | ||
1330 | |||
1331 | sense = (char *) irb->ecw; | ||
1332 | cstat = irb->scsw.cstat; | ||
1333 | dstat = irb->scsw.dstat; | ||
1334 | |||
1335 | if (cstat & (SCHN_STAT_CHN_CTRL_CHK | SCHN_STAT_INTF_CTRL_CHK | | ||
1336 | SCHN_STAT_CHN_DATA_CHK | SCHN_STAT_CHAIN_CHECK | | ||
1337 | SCHN_STAT_PROT_CHECK | SCHN_STAT_PROG_CHECK)) { | ||
1338 | LCS_DBF_TEXT(2, trace, "CGENCHK"); | ||
1339 | return 1; | ||
1340 | } | ||
1341 | if (dstat & DEV_STAT_UNIT_CHECK) { | ||
1342 | if (sense[LCS_SENSE_BYTE_1] & | ||
1343 | LCS_SENSE_RESETTING_EVENT) { | ||
1344 | LCS_DBF_TEXT(2, trace, "REVIND"); | ||
1345 | return 1; | ||
1346 | } | ||
1347 | if (sense[LCS_SENSE_BYTE_0] & | ||
1348 | LCS_SENSE_CMD_REJECT) { | ||
1349 | LCS_DBF_TEXT(2, trace, "CMDREJ"); | ||
1350 | return 0; | ||
1351 | } | ||
1352 | if ((!sense[LCS_SENSE_BYTE_0]) && | ||
1353 | (!sense[LCS_SENSE_BYTE_1]) && | ||
1354 | (!sense[LCS_SENSE_BYTE_2]) && | ||
1355 | (!sense[LCS_SENSE_BYTE_3])) { | ||
1356 | LCS_DBF_TEXT(2, trace, "ZEROSEN"); | ||
1357 | return 0; | ||
1358 | } | ||
1359 | LCS_DBF_TEXT(2, trace, "DGENCHK"); | ||
1360 | return 1; | ||
1361 | } | ||
1362 | return 0; | ||
1363 | } | ||
1364 | |||
1365 | void | ||
1366 | lcs_schedule_recovery(struct lcs_card *card) | ||
1367 | { | ||
1368 | LCS_DBF_TEXT(2, trace, "startrec"); | ||
1369 | if (!lcs_set_thread_start_bit(card, LCS_RECOVERY_THREAD)) | ||
1370 | schedule_work(&card->kernel_thread_starter); | ||
1371 | } | ||
1321 | 1372 | ||
1322 | /** | 1373 | /** |
1323 | * IRQ Handler for LCS channels | 1374 | * IRQ Handler for LCS channels |
@@ -1327,7 +1378,8 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1327 | { | 1378 | { |
1328 | struct lcs_card *card; | 1379 | struct lcs_card *card; |
1329 | struct lcs_channel *channel; | 1380 | struct lcs_channel *channel; |
1330 | int index; | 1381 | int rc, index; |
1382 | int cstat, dstat; | ||
1331 | 1383 | ||
1332 | if (lcs_check_irb_error(cdev, irb)) | 1384 | if (lcs_check_irb_error(cdev, irb)) |
1333 | return; | 1385 | return; |
@@ -1338,14 +1390,27 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1338 | else | 1390 | else |
1339 | channel = &card->write; | 1391 | channel = &card->write; |
1340 | 1392 | ||
1393 | cstat = irb->scsw.cstat; | ||
1394 | dstat = irb->scsw.dstat; | ||
1341 | LCS_DBF_TEXT_(5, trace, "Rint%s",cdev->dev.bus_id); | 1395 | LCS_DBF_TEXT_(5, trace, "Rint%s",cdev->dev.bus_id); |
1342 | LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.cstat, irb->scsw.dstat); | 1396 | LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.cstat, irb->scsw.dstat); |
1343 | LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.fctl, irb->scsw.actl); | 1397 | LCS_DBF_TEXT_(5, trace, "%4x%4x",irb->scsw.fctl, irb->scsw.actl); |
1344 | 1398 | ||
1399 | /* Check for channel and device errors presented */ | ||
1400 | rc = lcs_get_problem(cdev, irb); | ||
1401 | if (rc || (dstat & DEV_STAT_UNIT_EXCEP)) { | ||
1402 | PRINT_WARN("check on device %s, dstat=0x%X, cstat=0x%X \n", | ||
1403 | cdev->dev.bus_id, dstat, cstat); | ||
1404 | if (rc) { | ||
1405 | lcs_schedule_recovery(card); | ||
1406 | wake_up(&card->wait_q); | ||
1407 | return; | ||
1408 | } | ||
1409 | } | ||
1345 | /* How far in the ccw chain have we processed? */ | 1410 | /* How far in the ccw chain have we processed? */ |
1346 | if ((channel->state != CH_STATE_INIT) && | 1411 | if ((channel->state != CH_STATE_INIT) && |
1347 | (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { | 1412 | (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) { |
1348 | index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) | 1413 | index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) |
1349 | - channel->ccws; | 1414 | - channel->ccws; |
1350 | if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) || | 1415 | if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) || |
1351 | (irb->scsw.cstat & SCHN_STAT_PCI)) | 1416 | (irb->scsw.cstat & SCHN_STAT_PCI)) |
@@ -1367,7 +1432,6 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1367 | else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED) | 1432 | else if (irb->scsw.actl & SCSW_ACTL_SUSPENDED) |
1368 | /* CCW execution stopped on a suspend bit. */ | 1433 | /* CCW execution stopped on a suspend bit. */ |
1369 | channel->state = CH_STATE_SUSPENDED; | 1434 | channel->state = CH_STATE_SUSPENDED; |
1370 | |||
1371 | if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) { | 1435 | if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) { |
1372 | if (irb->scsw.cc != 0) { | 1436 | if (irb->scsw.cc != 0) { |
1373 | ccw_device_halt(channel->ccwdev, (addr_t) channel); | 1437 | ccw_device_halt(channel->ccwdev, (addr_t) channel); |
@@ -1376,7 +1440,6 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1376 | /* The channel has been stopped by halt_IO. */ | 1440 | /* The channel has been stopped by halt_IO. */ |
1377 | channel->state = CH_STATE_HALTED; | 1441 | channel->state = CH_STATE_HALTED; |
1378 | } | 1442 | } |
1379 | |||
1380 | if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) { | 1443 | if (irb->scsw.fctl & SCSW_FCTL_CLEAR_FUNC) { |
1381 | channel->state = CH_STATE_CLEARED; | 1444 | channel->state = CH_STATE_CLEARED; |
1382 | } | 1445 | } |
@@ -1452,7 +1515,7 @@ lcs_txbuffer_cb(struct lcs_channel *channel, struct lcs_buffer *buffer) | |||
1452 | lcs_release_buffer(channel, buffer); | 1515 | lcs_release_buffer(channel, buffer); |
1453 | card = (struct lcs_card *) | 1516 | card = (struct lcs_card *) |
1454 | ((char *) channel - offsetof(struct lcs_card, write)); | 1517 | ((char *) channel - offsetof(struct lcs_card, write)); |
1455 | if (netif_queue_stopped(card->dev)) | 1518 | if (netif_queue_stopped(card->dev) && netif_carrier_ok(card->dev)) |
1456 | netif_wake_queue(card->dev); | 1519 | netif_wake_queue(card->dev); |
1457 | spin_lock(&card->lock); | 1520 | spin_lock(&card->lock); |
1458 | card->tx_emitted--; | 1521 | card->tx_emitted--; |
@@ -1488,6 +1551,10 @@ __lcs_start_xmit(struct lcs_card *card, struct sk_buff *skb, | |||
1488 | card->stats.tx_carrier_errors++; | 1551 | card->stats.tx_carrier_errors++; |
1489 | return 0; | 1552 | return 0; |
1490 | } | 1553 | } |
1554 | if (skb->protocol == htons(ETH_P_IPV6)) { | ||
1555 | dev_kfree_skb(skb); | ||
1556 | return 0; | ||
1557 | } | ||
1491 | netif_stop_queue(card->dev); | 1558 | netif_stop_queue(card->dev); |
1492 | spin_lock(&card->lock); | 1559 | spin_lock(&card->lock); |
1493 | if (card->tx_buffer != NULL && | 1560 | if (card->tx_buffer != NULL && |
@@ -1633,30 +1700,6 @@ lcs_detect(struct lcs_card *card) | |||
1633 | } | 1700 | } |
1634 | 1701 | ||
1635 | /** | 1702 | /** |
1636 | * reset card | ||
1637 | */ | ||
1638 | static int | ||
1639 | lcs_resetcard(struct lcs_card *card) | ||
1640 | { | ||
1641 | int retries; | ||
1642 | |||
1643 | LCS_DBF_TEXT(2, trace, "rescard"); | ||
1644 | for (retries = 0; retries < 10; retries++) { | ||
1645 | if (lcs_detect(card) == 0) { | ||
1646 | netif_wake_queue(card->dev); | ||
1647 | card->state = DEV_STATE_UP; | ||
1648 | PRINT_INFO("LCS device %s successfully restarted!\n", | ||
1649 | card->dev->name); | ||
1650 | return 0; | ||
1651 | } | ||
1652 | msleep(3000); | ||
1653 | } | ||
1654 | PRINT_ERR("Error in Reseting LCS card!\n"); | ||
1655 | return -EIO; | ||
1656 | } | ||
1657 | |||
1658 | |||
1659 | /** | ||
1660 | * LCS Stop card | 1703 | * LCS Stop card |
1661 | */ | 1704 | */ |
1662 | static int | 1705 | static int |
@@ -1680,126 +1723,18 @@ lcs_stopcard(struct lcs_card *card) | |||
1680 | } | 1723 | } |
1681 | 1724 | ||
1682 | /** | 1725 | /** |
1683 | * LGW initiated commands | ||
1684 | */ | ||
1685 | static int | ||
1686 | lcs_lgw_startlan_thread(void *data) | ||
1687 | { | ||
1688 | struct lcs_card *card; | ||
1689 | |||
1690 | card = (struct lcs_card *) data; | ||
1691 | daemonize("lgwstpln"); | ||
1692 | |||
1693 | if (!lcs_do_run_thread(card, LCS_STARTLAN_THREAD)) | ||
1694 | return 0; | ||
1695 | LCS_DBF_TEXT(4, trace, "lgwstpln"); | ||
1696 | if (card->dev) | ||
1697 | netif_stop_queue(card->dev); | ||
1698 | if (lcs_startlan(card) == 0) { | ||
1699 | netif_wake_queue(card->dev); | ||
1700 | card->state = DEV_STATE_UP; | ||
1701 | PRINT_INFO("LCS Startlan for device %s succeeded!\n", | ||
1702 | card->dev->name); | ||
1703 | |||
1704 | } else | ||
1705 | PRINT_ERR("LCS Startlan for device %s failed!\n", | ||
1706 | card->dev->name); | ||
1707 | lcs_clear_thread_running_bit(card, LCS_STARTLAN_THREAD); | ||
1708 | return 0; | ||
1709 | } | ||
1710 | |||
1711 | /** | ||
1712 | * Send startup command initiated by Lan Gateway | ||
1713 | */ | ||
1714 | static int | ||
1715 | lcs_lgw_startup_thread(void *data) | ||
1716 | { | ||
1717 | int rc; | ||
1718 | |||
1719 | struct lcs_card *card; | ||
1720 | |||
1721 | card = (struct lcs_card *) data; | ||
1722 | daemonize("lgwstaln"); | ||
1723 | |||
1724 | if (!lcs_do_run_thread(card, LCS_STARTUP_THREAD)) | ||
1725 | return 0; | ||
1726 | LCS_DBF_TEXT(4, trace, "lgwstaln"); | ||
1727 | if (card->dev) | ||
1728 | netif_stop_queue(card->dev); | ||
1729 | rc = lcs_send_startup(card, LCS_INITIATOR_LGW); | ||
1730 | if (rc != 0) { | ||
1731 | PRINT_ERR("Startup for LCS device %s initiated " \ | ||
1732 | "by LGW failed!\nReseting card ...\n", | ||
1733 | card->dev->name); | ||
1734 | /* do a card reset */ | ||
1735 | rc = lcs_resetcard(card); | ||
1736 | if (rc == 0) | ||
1737 | goto Done; | ||
1738 | } | ||
1739 | rc = lcs_startlan(card); | ||
1740 | if (rc == 0) { | ||
1741 | netif_wake_queue(card->dev); | ||
1742 | card->state = DEV_STATE_UP; | ||
1743 | } | ||
1744 | Done: | ||
1745 | if (rc == 0) | ||
1746 | PRINT_INFO("LCS Startup for device %s succeeded!\n", | ||
1747 | card->dev->name); | ||
1748 | else | ||
1749 | PRINT_ERR("LCS Startup for device %s failed!\n", | ||
1750 | card->dev->name); | ||
1751 | lcs_clear_thread_running_bit(card, LCS_STARTUP_THREAD); | ||
1752 | return 0; | ||
1753 | } | ||
1754 | |||
1755 | |||
1756 | /** | ||
1757 | * send stoplan command initiated by Lan Gateway | ||
1758 | */ | ||
1759 | static int | ||
1760 | lcs_lgw_stoplan_thread(void *data) | ||
1761 | { | ||
1762 | struct lcs_card *card; | ||
1763 | int rc; | ||
1764 | |||
1765 | card = (struct lcs_card *) data; | ||
1766 | daemonize("lgwstop"); | ||
1767 | |||
1768 | if (!lcs_do_run_thread(card, LCS_STOPLAN_THREAD)) | ||
1769 | return 0; | ||
1770 | LCS_DBF_TEXT(4, trace, "lgwstop"); | ||
1771 | if (card->dev) | ||
1772 | netif_stop_queue(card->dev); | ||
1773 | if (lcs_send_stoplan(card, LCS_INITIATOR_LGW) == 0) | ||
1774 | PRINT_INFO("Stoplan for %s initiated by LGW succeeded!\n", | ||
1775 | card->dev->name); | ||
1776 | else | ||
1777 | PRINT_ERR("Stoplan %s initiated by LGW failed!\n", | ||
1778 | card->dev->name); | ||
1779 | /*Try to reset the card, stop it on failure */ | ||
1780 | rc = lcs_resetcard(card); | ||
1781 | if (rc != 0) | ||
1782 | rc = lcs_stopcard(card); | ||
1783 | lcs_clear_thread_running_bit(card, LCS_STOPLAN_THREAD); | ||
1784 | return rc; | ||
1785 | } | ||
1786 | |||
1787 | /** | ||
1788 | * Kernel Thread helper functions for LGW initiated commands | 1726 | * Kernel Thread helper functions for LGW initiated commands |
1789 | */ | 1727 | */ |
1790 | static void | 1728 | static void |
1791 | lcs_start_kernel_thread(struct lcs_card *card) | 1729 | lcs_start_kernel_thread(struct lcs_card *card) |
1792 | { | 1730 | { |
1793 | LCS_DBF_TEXT(5, trace, "krnthrd"); | 1731 | LCS_DBF_TEXT(5, trace, "krnthrd"); |
1794 | if (lcs_do_start_thread(card, LCS_STARTUP_THREAD)) | 1732 | if (lcs_do_start_thread(card, LCS_RECOVERY_THREAD)) |
1795 | kernel_thread(lcs_lgw_startup_thread, (void *) card, SIGCHLD); | 1733 | kernel_thread(lcs_recovery, (void *) card, SIGCHLD); |
1796 | if (lcs_do_start_thread(card, LCS_STARTLAN_THREAD)) | ||
1797 | kernel_thread(lcs_lgw_startlan_thread, (void *) card, SIGCHLD); | ||
1798 | if (lcs_do_start_thread(card, LCS_STOPLAN_THREAD)) | ||
1799 | kernel_thread(lcs_lgw_stoplan_thread, (void *) card, SIGCHLD); | ||
1800 | #ifdef CONFIG_IP_MULTICAST | 1734 | #ifdef CONFIG_IP_MULTICAST |
1801 | if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) | 1735 | if (lcs_do_start_thread(card, LCS_SET_MC_THREAD)) |
1802 | kernel_thread(lcs_register_mc_addresses, (void *) card, SIGCHLD); | 1736 | kernel_thread(lcs_register_mc_addresses, |
1737 | (void *) card, SIGCHLD); | ||
1803 | #endif | 1738 | #endif |
1804 | } | 1739 | } |
1805 | 1740 | ||
@@ -1813,19 +1748,14 @@ lcs_get_control(struct lcs_card *card, struct lcs_cmd *cmd) | |||
1813 | if (cmd->initiator == LCS_INITIATOR_LGW) { | 1748 | if (cmd->initiator == LCS_INITIATOR_LGW) { |
1814 | switch(cmd->cmd_code) { | 1749 | switch(cmd->cmd_code) { |
1815 | case LCS_CMD_STARTUP: | 1750 | case LCS_CMD_STARTUP: |
1816 | if (!lcs_set_thread_start_bit(card, | ||
1817 | LCS_STARTUP_THREAD)) | ||
1818 | schedule_work(&card->kernel_thread_starter); | ||
1819 | break; | ||
1820 | case LCS_CMD_STARTLAN: | 1751 | case LCS_CMD_STARTLAN: |
1821 | if (!lcs_set_thread_start_bit(card, | 1752 | lcs_schedule_recovery(card); |
1822 | LCS_STARTLAN_THREAD)) | ||
1823 | schedule_work(&card->kernel_thread_starter); | ||
1824 | break; | 1753 | break; |
1825 | case LCS_CMD_STOPLAN: | 1754 | case LCS_CMD_STOPLAN: |
1826 | if (!lcs_set_thread_start_bit(card, | 1755 | PRINT_WARN("Stoplan for %s initiated by LGW.\n", |
1827 | LCS_STOPLAN_THREAD)) | 1756 | card->dev->name); |
1828 | schedule_work(&card->kernel_thread_starter); | 1757 | if (card->dev) |
1758 | netif_carrier_off(card->dev); | ||
1829 | break; | 1759 | break; |
1830 | default: | 1760 | default: |
1831 | PRINT_INFO("UNRECOGNIZED LGW COMMAND\n"); | 1761 | PRINT_INFO("UNRECOGNIZED LGW COMMAND\n"); |
@@ -1941,8 +1871,11 @@ lcs_stop_device(struct net_device *dev) | |||
1941 | 1871 | ||
1942 | LCS_DBF_TEXT(2, trace, "stopdev"); | 1872 | LCS_DBF_TEXT(2, trace, "stopdev"); |
1943 | card = (struct lcs_card *) dev->priv; | 1873 | card = (struct lcs_card *) dev->priv; |
1944 | netif_stop_queue(dev); | 1874 | netif_carrier_off(dev); |
1875 | netif_tx_disable(dev); | ||
1945 | dev->flags &= ~IFF_UP; | 1876 | dev->flags &= ~IFF_UP; |
1877 | wait_event(card->write.wait_q, | ||
1878 | (card->write.state != CH_STATE_RUNNING)); | ||
1946 | rc = lcs_stopcard(card); | 1879 | rc = lcs_stopcard(card); |
1947 | if (rc) | 1880 | if (rc) |
1948 | PRINT_ERR("Try it again!\n "); | 1881 | PRINT_ERR("Try it again!\n "); |
@@ -1968,6 +1901,7 @@ lcs_open_device(struct net_device *dev) | |||
1968 | 1901 | ||
1969 | } else { | 1902 | } else { |
1970 | dev->flags |= IFF_UP; | 1903 | dev->flags |= IFF_UP; |
1904 | netif_carrier_on(dev); | ||
1971 | netif_wake_queue(dev); | 1905 | netif_wake_queue(dev); |
1972 | card->state = DEV_STATE_UP; | 1906 | card->state = DEV_STATE_UP; |
1973 | } | 1907 | } |
@@ -2059,10 +1993,31 @@ lcs_timeout_store (struct device *dev, struct device_attribute *attr, const char | |||
2059 | 1993 | ||
2060 | DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store); | 1994 | DEVICE_ATTR(lancmd_timeout, 0644, lcs_timeout_show, lcs_timeout_store); |
2061 | 1995 | ||
1996 | static ssize_t | ||
1997 | lcs_dev_recover_store(struct device *dev, struct device_attribute *attr, | ||
1998 | const char *buf, size_t count) | ||
1999 | { | ||
2000 | struct lcs_card *card = dev->driver_data; | ||
2001 | char *tmp; | ||
2002 | int i; | ||
2003 | |||
2004 | if (!card) | ||
2005 | return -EINVAL; | ||
2006 | if (card->state != DEV_STATE_UP) | ||
2007 | return -EPERM; | ||
2008 | i = simple_strtoul(buf, &tmp, 16); | ||
2009 | if (i == 1) | ||
2010 | lcs_schedule_recovery(card); | ||
2011 | return count; | ||
2012 | } | ||
2013 | |||
2014 | static DEVICE_ATTR(recover, 0200, NULL, lcs_dev_recover_store); | ||
2015 | |||
2062 | static struct attribute * lcs_attrs[] = { | 2016 | static struct attribute * lcs_attrs[] = { |
2063 | &dev_attr_portno.attr, | 2017 | &dev_attr_portno.attr, |
2064 | &dev_attr_type.attr, | 2018 | &dev_attr_type.attr, |
2065 | &dev_attr_lancmd_timeout.attr, | 2019 | &dev_attr_lancmd_timeout.attr, |
2020 | &dev_attr_recover.attr, | ||
2066 | NULL, | 2021 | NULL, |
2067 | }; | 2022 | }; |
2068 | 2023 | ||
@@ -2099,6 +2054,12 @@ lcs_probe_device(struct ccwgroup_device *ccwgdev) | |||
2099 | ccwgdev->dev.driver_data = card; | 2054 | ccwgdev->dev.driver_data = card; |
2100 | ccwgdev->cdev[0]->handler = lcs_irq; | 2055 | ccwgdev->cdev[0]->handler = lcs_irq; |
2101 | ccwgdev->cdev[1]->handler = lcs_irq; | 2056 | ccwgdev->cdev[1]->handler = lcs_irq; |
2057 | card->gdev = ccwgdev; | ||
2058 | INIT_WORK(&card->kernel_thread_starter, | ||
2059 | (void *) lcs_start_kernel_thread, card); | ||
2060 | card->thread_start_mask = 0; | ||
2061 | card->thread_allowed_mask = 0; | ||
2062 | card->thread_running_mask = 0; | ||
2102 | return 0; | 2063 | return 0; |
2103 | } | 2064 | } |
2104 | 2065 | ||
@@ -2200,6 +2161,7 @@ netdev_out: | |||
2200 | if (recover_state == DEV_STATE_RECOVER) { | 2161 | if (recover_state == DEV_STATE_RECOVER) { |
2201 | lcs_set_multicast_list(card->dev); | 2162 | lcs_set_multicast_list(card->dev); |
2202 | card->dev->flags |= IFF_UP; | 2163 | card->dev->flags |= IFF_UP; |
2164 | netif_carrier_on(card->dev); | ||
2203 | netif_wake_queue(card->dev); | 2165 | netif_wake_queue(card->dev); |
2204 | card->state = DEV_STATE_UP; | 2166 | card->state = DEV_STATE_UP; |
2205 | } else { | 2167 | } else { |
@@ -2229,7 +2191,7 @@ out: | |||
2229 | * lcs_shutdown_device, called when setting the group device offline. | 2191 | * lcs_shutdown_device, called when setting the group device offline. |
2230 | */ | 2192 | */ |
2231 | static int | 2193 | static int |
2232 | lcs_shutdown_device(struct ccwgroup_device *ccwgdev) | 2194 | __lcs_shutdown_device(struct ccwgroup_device *ccwgdev, int recovery_mode) |
2233 | { | 2195 | { |
2234 | struct lcs_card *card; | 2196 | struct lcs_card *card; |
2235 | enum lcs_dev_states recover_state; | 2197 | enum lcs_dev_states recover_state; |
@@ -2239,9 +2201,11 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev) | |||
2239 | card = (struct lcs_card *)ccwgdev->dev.driver_data; | 2201 | card = (struct lcs_card *)ccwgdev->dev.driver_data; |
2240 | if (!card) | 2202 | if (!card) |
2241 | return -ENODEV; | 2203 | return -ENODEV; |
2242 | lcs_set_allowed_threads(card, 0); | 2204 | if (recovery_mode == 0) { |
2243 | if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD)) | 2205 | lcs_set_allowed_threads(card, 0); |
2244 | return -ERESTARTSYS; | 2206 | if (lcs_wait_for_threads(card, LCS_SET_MC_THREAD)) |
2207 | return -ERESTARTSYS; | ||
2208 | } | ||
2245 | LCS_DBF_HEX(3, setup, &card, sizeof(void*)); | 2209 | LCS_DBF_HEX(3, setup, &card, sizeof(void*)); |
2246 | recover_state = card->state; | 2210 | recover_state = card->state; |
2247 | 2211 | ||
@@ -2256,6 +2220,43 @@ lcs_shutdown_device(struct ccwgroup_device *ccwgdev) | |||
2256 | return 0; | 2220 | return 0; |
2257 | } | 2221 | } |
2258 | 2222 | ||
2223 | static int | ||
2224 | lcs_shutdown_device(struct ccwgroup_device *ccwgdev) | ||
2225 | { | ||
2226 | return __lcs_shutdown_device(ccwgdev, 0); | ||
2227 | } | ||
2228 | |||
2229 | /** | ||
2230 | * drive lcs recovery after startup and startlan initiated by Lan Gateway | ||
2231 | */ | ||
2232 | static int | ||
2233 | lcs_recovery(void *ptr) | ||
2234 | { | ||
2235 | struct lcs_card *card; | ||
2236 | struct ccwgroup_device *gdev; | ||
2237 | int rc; | ||
2238 | |||
2239 | card = (struct lcs_card *) ptr; | ||
2240 | daemonize("lcs_recover"); | ||
2241 | |||
2242 | LCS_DBF_TEXT(4, trace, "recover1"); | ||
2243 | if (!lcs_do_run_thread(card, LCS_RECOVERY_THREAD)) | ||
2244 | return 0; | ||
2245 | LCS_DBF_TEXT(4, trace, "recover2"); | ||
2246 | gdev = card->gdev; | ||
2247 | PRINT_WARN("Recovery of device %s started...\n", gdev->dev.bus_id); | ||
2248 | rc = __lcs_shutdown_device(gdev, 1); | ||
2249 | rc = lcs_new_device(gdev); | ||
2250 | if (!rc) | ||
2251 | PRINT_INFO("Device %s successfully recovered!\n", | ||
2252 | card->dev->name); | ||
2253 | else | ||
2254 | PRINT_INFO("Device %s could not be recovered!\n", | ||
2255 | card->dev->name); | ||
2256 | lcs_clear_thread_running_bit(card, LCS_RECOVERY_THREAD); | ||
2257 | return 0; | ||
2258 | } | ||
2259 | |||
2259 | /** | 2260 | /** |
2260 | * lcs_remove_device, free buffers and card | 2261 | * lcs_remove_device, free buffers and card |
2261 | */ | 2262 | */ |
diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h index 2fad5e40c2e4..93143932983b 100644 --- a/drivers/s390/net/lcs.h +++ b/drivers/s390/net/lcs.h | |||
@@ -73,13 +73,17 @@ do { \ | |||
73 | /** | 73 | /** |
74 | * LCS sense byte definitions | 74 | * LCS sense byte definitions |
75 | */ | 75 | */ |
76 | #define LCS_SENSE_BYTE_0 0 | ||
77 | #define LCS_SENSE_BYTE_1 1 | ||
78 | #define LCS_SENSE_BYTE_2 2 | ||
79 | #define LCS_SENSE_BYTE_3 3 | ||
76 | #define LCS_SENSE_INTERFACE_DISCONNECT 0x01 | 80 | #define LCS_SENSE_INTERFACE_DISCONNECT 0x01 |
77 | #define LCS_SENSE_EQUIPMENT_CHECK 0x10 | 81 | #define LCS_SENSE_EQUIPMENT_CHECK 0x10 |
78 | #define LCS_SENSE_BUS_OUT_CHECK 0x20 | 82 | #define LCS_SENSE_BUS_OUT_CHECK 0x20 |
79 | #define LCS_SENSE_INTERVENTION_REQUIRED 0x40 | 83 | #define LCS_SENSE_INTERVENTION_REQUIRED 0x40 |
80 | #define LCS_SENSE_CMD_REJECT 0x80 | 84 | #define LCS_SENSE_CMD_REJECT 0x80 |
81 | #define LCS_SENSE_RESETTING_EVENT 0x0080 | 85 | #define LCS_SENSE_RESETTING_EVENT 0x80 |
82 | #define LCS_SENSE_DEVICE_ONLINE 0x0020 | 86 | #define LCS_SENSE_DEVICE_ONLINE 0x20 |
83 | 87 | ||
84 | /** | 88 | /** |
85 | * LCS packet type definitions | 89 | * LCS packet type definitions |
@@ -152,10 +156,9 @@ enum lcs_dev_states { | |||
152 | 156 | ||
153 | enum lcs_threads { | 157 | enum lcs_threads { |
154 | LCS_SET_MC_THREAD = 1, | 158 | LCS_SET_MC_THREAD = 1, |
155 | LCS_STARTLAN_THREAD = 2, | 159 | LCS_RECOVERY_THREAD = 2, |
156 | LCS_STOPLAN_THREAD = 4, | ||
157 | LCS_STARTUP_THREAD = 8, | ||
158 | }; | 160 | }; |
161 | |||
159 | /** | 162 | /** |
160 | * LCS struct declarations | 163 | * LCS struct declarations |
161 | */ | 164 | */ |
@@ -286,6 +289,7 @@ struct lcs_card { | |||
286 | struct net_device_stats stats; | 289 | struct net_device_stats stats; |
287 | unsigned short (*lan_type_trans)(struct sk_buff *skb, | 290 | unsigned short (*lan_type_trans)(struct sk_buff *skb, |
288 | struct net_device *dev); | 291 | struct net_device *dev); |
292 | struct ccwgroup_device *gdev; | ||
289 | struct lcs_channel read; | 293 | struct lcs_channel read; |
290 | struct lcs_channel write; | 294 | struct lcs_channel write; |
291 | struct lcs_buffer *tx_buffer; | 295 | struct lcs_buffer *tx_buffer; |
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index 260a93c8c442..b452cc1afd55 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c | |||
@@ -30,7 +30,7 @@ | |||
30 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 30 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #undef DEBUG | 34 | #undef DEBUG |
35 | 35 | ||
36 | #include <linux/module.h> | 36 | #include <linux/module.h> |
@@ -65,7 +65,7 @@ MODULE_AUTHOR | |||
65 | ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)"); | 65 | ("(C) 2001 IBM Corporation by Fritz Elfert (felfert@millenux.com)"); |
66 | MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); | 66 | MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); |
67 | 67 | ||
68 | 68 | ||
69 | #define PRINTK_HEADER " iucv: " /* for debugging */ | 69 | #define PRINTK_HEADER " iucv: " /* for debugging */ |
70 | 70 | ||
71 | static struct device_driver netiucv_driver = { | 71 | static struct device_driver netiucv_driver = { |
@@ -202,7 +202,7 @@ netiucv_printname(char *name) | |||
202 | *p = '\0'; | 202 | *p = '\0'; |
203 | return tmp; | 203 | return tmp; |
204 | } | 204 | } |
205 | 205 | ||
206 | /** | 206 | /** |
207 | * States of the interface statemachine. | 207 | * States of the interface statemachine. |
208 | */ | 208 | */ |
@@ -244,7 +244,7 @@ static const char *dev_event_names[] = { | |||
244 | "Connection up", | 244 | "Connection up", |
245 | "Connection down", | 245 | "Connection down", |
246 | }; | 246 | }; |
247 | 247 | ||
248 | /** | 248 | /** |
249 | * Events of the connection statemachine | 249 | * Events of the connection statemachine |
250 | */ | 250 | */ |
@@ -364,7 +364,7 @@ static const char *conn_state_names[] = { | |||
364 | "Connect error", | 364 | "Connect error", |
365 | }; | 365 | }; |
366 | 366 | ||
367 | 367 | ||
368 | /** | 368 | /** |
369 | * Debug Facility Stuff | 369 | * Debug Facility Stuff |
370 | */ | 370 | */ |
@@ -516,7 +516,7 @@ static void | |||
516 | fsm_action_nop(fsm_instance *fi, int event, void *arg) | 516 | fsm_action_nop(fsm_instance *fi, int event, void *arg) |
517 | { | 517 | { |
518 | } | 518 | } |
519 | 519 | ||
520 | /** | 520 | /** |
521 | * Actions of the connection statemachine | 521 | * Actions of the connection statemachine |
522 | *****************************************************************************/ | 522 | *****************************************************************************/ |
@@ -993,7 +993,7 @@ static const fsm_node conn_fsm[] = { | |||
993 | 993 | ||
994 | static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node); | 994 | static const int CONN_FSM_LEN = sizeof(conn_fsm) / sizeof(fsm_node); |
995 | 995 | ||
996 | 996 | ||
997 | /** | 997 | /** |
998 | * Actions for interface - statemachine. | 998 | * Actions for interface - statemachine. |
999 | *****************************************************************************/ | 999 | *****************************************************************************/ |
@@ -1182,7 +1182,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) { | |||
1182 | 1182 | ||
1183 | fsm_newstate(conn->fsm, CONN_STATE_TX); | 1183 | fsm_newstate(conn->fsm, CONN_STATE_TX); |
1184 | conn->prof.send_stamp = xtime; | 1184 | conn->prof.send_stamp = xtime; |
1185 | 1185 | ||
1186 | rc = iucv_send(conn->pathid, NULL, 0, 0, 1 /* single_flag */, | 1186 | rc = iucv_send(conn->pathid, NULL, 0, 0, 1 /* single_flag */, |
1187 | 0, nskb->data, nskb->len); | 1187 | 0, nskb->data, nskb->len); |
1188 | /* Shut up, gcc! nskb is always below 2G. */ | 1188 | /* Shut up, gcc! nskb is always below 2G. */ |
@@ -1220,7 +1220,7 @@ netiucv_transmit_skb(struct iucv_connection *conn, struct sk_buff *skb) { | |||
1220 | 1220 | ||
1221 | return rc; | 1221 | return rc; |
1222 | } | 1222 | } |
1223 | 1223 | ||
1224 | /** | 1224 | /** |
1225 | * Interface API for upper network layers | 1225 | * Interface API for upper network layers |
1226 | *****************************************************************************/ | 1226 | *****************************************************************************/ |
@@ -1291,7 +1291,7 @@ static int netiucv_tx(struct sk_buff *skb, struct net_device *dev) | |||
1291 | 1291 | ||
1292 | /** | 1292 | /** |
1293 | * If connection is not running, try to restart it | 1293 | * If connection is not running, try to restart it |
1294 | * and throw away packet. | 1294 | * and throw away packet. |
1295 | */ | 1295 | */ |
1296 | if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { | 1296 | if (fsm_getstate(privptr->fsm) != DEV_STATE_RUNNING) { |
1297 | fsm_event(privptr->fsm, DEV_EVENT_START, dev); | 1297 | fsm_event(privptr->fsm, DEV_EVENT_START, dev); |
@@ -1538,7 +1538,7 @@ static ssize_t | |||
1538 | maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1538 | maxcq_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1539 | { | 1539 | { |
1540 | struct netiucv_priv *priv = dev->driver_data; | 1540 | struct netiucv_priv *priv = dev->driver_data; |
1541 | 1541 | ||
1542 | IUCV_DBF_TEXT(trace, 4, __FUNCTION__); | 1542 | IUCV_DBF_TEXT(trace, 4, __FUNCTION__); |
1543 | priv->conn->prof.maxcqueue = 0; | 1543 | priv->conn->prof.maxcqueue = 0; |
1544 | return count; | 1544 | return count; |
@@ -1559,7 +1559,7 @@ static ssize_t | |||
1559 | sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1559 | sdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1560 | { | 1560 | { |
1561 | struct netiucv_priv *priv = dev->driver_data; | 1561 | struct netiucv_priv *priv = dev->driver_data; |
1562 | 1562 | ||
1563 | IUCV_DBF_TEXT(trace, 4, __FUNCTION__); | 1563 | IUCV_DBF_TEXT(trace, 4, __FUNCTION__); |
1564 | priv->conn->prof.doios_single = 0; | 1564 | priv->conn->prof.doios_single = 0; |
1565 | return count; | 1565 | return count; |
@@ -1580,7 +1580,7 @@ static ssize_t | |||
1580 | mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1580 | mdoio_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1581 | { | 1581 | { |
1582 | struct netiucv_priv *priv = dev->driver_data; | 1582 | struct netiucv_priv *priv = dev->driver_data; |
1583 | 1583 | ||
1584 | IUCV_DBF_TEXT(trace, 5, __FUNCTION__); | 1584 | IUCV_DBF_TEXT(trace, 5, __FUNCTION__); |
1585 | priv->conn->prof.doios_multi = 0; | 1585 | priv->conn->prof.doios_multi = 0; |
1586 | return count; | 1586 | return count; |
@@ -1601,7 +1601,7 @@ static ssize_t | |||
1601 | txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1601 | txlen_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1602 | { | 1602 | { |
1603 | struct netiucv_priv *priv = dev->driver_data; | 1603 | struct netiucv_priv *priv = dev->driver_data; |
1604 | 1604 | ||
1605 | IUCV_DBF_TEXT(trace, 4, __FUNCTION__); | 1605 | IUCV_DBF_TEXT(trace, 4, __FUNCTION__); |
1606 | priv->conn->prof.txlen = 0; | 1606 | priv->conn->prof.txlen = 0; |
1607 | return count; | 1607 | return count; |
@@ -1622,7 +1622,7 @@ static ssize_t | |||
1622 | txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1622 | txtime_write (struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1623 | { | 1623 | { |
1624 | struct netiucv_priv *priv = dev->driver_data; | 1624 | struct netiucv_priv *priv = dev->driver_data; |
1625 | 1625 | ||
1626 | IUCV_DBF_TEXT(trace, 4, __FUNCTION__); | 1626 | IUCV_DBF_TEXT(trace, 4, __FUNCTION__); |
1627 | priv->conn->prof.tx_time = 0; | 1627 | priv->conn->prof.tx_time = 0; |
1628 | return count; | 1628 | return count; |
@@ -2000,7 +2000,7 @@ conn_write(struct device_driver *drv, const char *buf, size_t count) | |||
2000 | } | 2000 | } |
2001 | 2001 | ||
2002 | PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username)); | 2002 | PRINT_INFO("%s: '%s'\n", dev->name, netiucv_printname(username)); |
2003 | 2003 | ||
2004 | return count; | 2004 | return count; |
2005 | 2005 | ||
2006 | out_free_ndev: | 2006 | out_free_ndev: |
@@ -2099,7 +2099,7 @@ static int __init | |||
2099 | netiucv_init(void) | 2099 | netiucv_init(void) |
2100 | { | 2100 | { |
2101 | int ret; | 2101 | int ret; |
2102 | 2102 | ||
2103 | ret = iucv_register_dbf_views(); | 2103 | ret = iucv_register_dbf_views(); |
2104 | if (ret) { | 2104 | if (ret) { |
2105 | PRINT_WARN("netiucv_init failed, " | 2105 | PRINT_WARN("netiucv_init failed, " |
@@ -2128,7 +2128,7 @@ netiucv_init(void) | |||
2128 | } | 2128 | } |
2129 | return ret; | 2129 | return ret; |
2130 | } | 2130 | } |
2131 | 2131 | ||
2132 | module_init(netiucv_init); | 2132 | module_init(netiucv_init); |
2133 | module_exit(netiucv_exit); | 2133 | module_exit(netiucv_exit); |
2134 | MODULE_LICENSE("GPL"); | 2134 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 4df0fcd7b10b..619f4a0c7160 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h | |||
@@ -376,7 +376,7 @@ struct qeth_hdr_osn { | |||
376 | __u8 reserved3[18]; | 376 | __u8 reserved3[18]; |
377 | __u32 ccid; | 377 | __u32 ccid; |
378 | } __attribute__ ((packed)); | 378 | } __attribute__ ((packed)); |
379 | 379 | ||
380 | struct qeth_hdr { | 380 | struct qeth_hdr { |
381 | union { | 381 | union { |
382 | struct qeth_hdr_layer2 l2; | 382 | struct qeth_hdr_layer2 l2; |
@@ -825,7 +825,7 @@ struct qeth_card { | |||
825 | int use_hard_stop; | 825 | int use_hard_stop; |
826 | int (*orig_hard_header)(struct sk_buff *,struct net_device *, | 826 | int (*orig_hard_header)(struct sk_buff *,struct net_device *, |
827 | unsigned short,void *,void *,unsigned); | 827 | unsigned short,void *,void *,unsigned); |
828 | struct qeth_osn_info osn_info; | 828 | struct qeth_osn_info osn_info; |
829 | }; | 829 | }; |
830 | 830 | ||
831 | struct qeth_card_list_struct { | 831 | struct qeth_card_list_struct { |
@@ -944,7 +944,7 @@ qeth_get_netdev_flags(struct qeth_card *card) | |||
944 | return 0; | 944 | return 0; |
945 | switch (card->info.type) { | 945 | switch (card->info.type) { |
946 | case QETH_CARD_TYPE_IQD: | 946 | case QETH_CARD_TYPE_IQD: |
947 | case QETH_CARD_TYPE_OSN: | 947 | case QETH_CARD_TYPE_OSN: |
948 | return IFF_NOARP; | 948 | return IFF_NOARP; |
949 | #ifdef CONFIG_QETH_IPV6 | 949 | #ifdef CONFIG_QETH_IPV6 |
950 | default: | 950 | default: |
@@ -981,7 +981,7 @@ static inline int | |||
981 | qeth_get_max_mtu_for_card(int cardtype) | 981 | qeth_get_max_mtu_for_card(int cardtype) |
982 | { | 982 | { |
983 | switch (cardtype) { | 983 | switch (cardtype) { |
984 | 984 | ||
985 | case QETH_CARD_TYPE_UNKNOWN: | 985 | case QETH_CARD_TYPE_UNKNOWN: |
986 | case QETH_CARD_TYPE_OSAE: | 986 | case QETH_CARD_TYPE_OSAE: |
987 | case QETH_CARD_TYPE_OSN: | 987 | case QETH_CARD_TYPE_OSN: |
@@ -1097,9 +1097,9 @@ qeth_string_to_ipaddr4(const char *buf, __u8 *addr) | |||
1097 | int count = 0, rc = 0; | 1097 | int count = 0, rc = 0; |
1098 | int in[4]; | 1098 | int in[4]; |
1099 | 1099 | ||
1100 | rc = sscanf(buf, "%d.%d.%d.%d%n", | 1100 | rc = sscanf(buf, "%d.%d.%d.%d%n", |
1101 | &in[0], &in[1], &in[2], &in[3], &count); | 1101 | &in[0], &in[1], &in[2], &in[3], &count); |
1102 | if (rc != 4 || count) | 1102 | if (rc != 4 || count<=0) |
1103 | return -EINVAL; | 1103 | return -EINVAL; |
1104 | for (count = 0; count < 4; count++) { | 1104 | for (count = 0; count < 4; count++) { |
1105 | if (in[count] > 255) | 1105 | if (in[count] > 255) |
@@ -1131,7 +1131,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr) | |||
1131 | 1131 | ||
1132 | cnt = out = found = save_cnt = num2 = 0; | 1132 | cnt = out = found = save_cnt = num2 = 0; |
1133 | end = start = (char *) buf; | 1133 | end = start = (char *) buf; |
1134 | in = (__u16 *) addr; | 1134 | in = (__u16 *) addr; |
1135 | memset(in, 0, 16); | 1135 | memset(in, 0, 16); |
1136 | while (end) { | 1136 | while (end) { |
1137 | end = strchr(end,':'); | 1137 | end = strchr(end,':'); |
@@ -1139,7 +1139,7 @@ qeth_string_to_ipaddr6(const char *buf, __u8 *addr) | |||
1139 | end = (char *)buf + (strlen(buf)); | 1139 | end = (char *)buf + (strlen(buf)); |
1140 | out = 1; | 1140 | out = 1; |
1141 | } | 1141 | } |
1142 | if ((end - start)) { | 1142 | if ((end - start)) { |
1143 | memset(num, 0, 5); | 1143 | memset(num, 0, 5); |
1144 | memcpy(num, start, end - start); | 1144 | memcpy(num, start, end - start); |
1145 | if (!qeth_isxdigit(num)) | 1145 | if (!qeth_isxdigit(num)) |
@@ -1241,5 +1241,5 @@ qeth_osn_register(unsigned char *read_dev_no, | |||
1241 | 1241 | ||
1242 | extern void | 1242 | extern void |
1243 | qeth_osn_deregister(struct net_device *); | 1243 | qeth_osn_deregister(struct net_device *); |
1244 | 1244 | ||
1245 | #endif /* __QETH_H__ */ | 1245 | #endif /* __QETH_H__ */ |
diff --git a/drivers/s390/net/qeth_eddp.c b/drivers/s390/net/qeth_eddp.c index 44e226f211e7..0bab60a20309 100644 --- a/drivers/s390/net/qeth_eddp.c +++ b/drivers/s390/net/qeth_eddp.c | |||
@@ -81,7 +81,7 @@ void | |||
81 | qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf) | 81 | qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *buf) |
82 | { | 82 | { |
83 | struct qeth_eddp_context_reference *ref; | 83 | struct qeth_eddp_context_reference *ref; |
84 | 84 | ||
85 | QETH_DBF_TEXT(trace, 6, "eddprctx"); | 85 | QETH_DBF_TEXT(trace, 6, "eddprctx"); |
86 | while (!list_empty(&buf->ctx_list)){ | 86 | while (!list_empty(&buf->ctx_list)){ |
87 | ref = list_entry(buf->ctx_list.next, | 87 | ref = list_entry(buf->ctx_list.next, |
@@ -135,7 +135,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue, | |||
135 | "buffer!\n"); | 135 | "buffer!\n"); |
136 | goto out; | 136 | goto out; |
137 | } | 137 | } |
138 | } | 138 | } |
139 | /* check if the whole next skb fits into current buffer */ | 139 | /* check if the whole next skb fits into current buffer */ |
140 | if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) - | 140 | if ((QETH_MAX_BUFFER_ELEMENTS(queue->card) - |
141 | buf->next_element_to_fill) | 141 | buf->next_element_to_fill) |
@@ -148,7 +148,7 @@ qeth_eddp_fill_buffer(struct qeth_qdio_out_q *queue, | |||
148 | * and increment ctx's refcnt */ | 148 | * and increment ctx's refcnt */ |
149 | must_refcnt = 1; | 149 | must_refcnt = 1; |
150 | continue; | 150 | continue; |
151 | } | 151 | } |
152 | if (must_refcnt){ | 152 | if (must_refcnt){ |
153 | must_refcnt = 0; | 153 | must_refcnt = 0; |
154 | if (qeth_eddp_buf_ref_context(buf, ctx)){ | 154 | if (qeth_eddp_buf_ref_context(buf, ctx)){ |
@@ -266,7 +266,7 @@ qeth_eddp_copy_data_tcp(char *dst, struct qeth_eddp_data *eddp, int len, | |||
266 | int left_in_frag; | 266 | int left_in_frag; |
267 | int copy_len; | 267 | int copy_len; |
268 | u8 *src; | 268 | u8 *src; |
269 | 269 | ||
270 | QETH_DBF_TEXT(trace, 5, "eddpcdtc"); | 270 | QETH_DBF_TEXT(trace, 5, "eddpcdtc"); |
271 | if (skb_shinfo(eddp->skb)->nr_frags == 0) { | 271 | if (skb_shinfo(eddp->skb)->nr_frags == 0) { |
272 | memcpy(dst, eddp->skb->data + eddp->skb_offset, len); | 272 | memcpy(dst, eddp->skb->data + eddp->skb_offset, len); |
@@ -408,7 +408,7 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, | |||
408 | struct tcphdr *tcph; | 408 | struct tcphdr *tcph; |
409 | int data_len; | 409 | int data_len; |
410 | u32 hcsum; | 410 | u32 hcsum; |
411 | 411 | ||
412 | QETH_DBF_TEXT(trace, 5, "eddpftcp"); | 412 | QETH_DBF_TEXT(trace, 5, "eddpftcp"); |
413 | eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; | 413 | eddp->skb_offset = sizeof(struct qeth_hdr) + eddp->nhl + eddp->thl; |
414 | if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { | 414 | if (eddp->qh.hdr.l2.id == QETH_HEADER_TYPE_LAYER2) { |
@@ -465,13 +465,13 @@ __qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, | |||
465 | eddp->th.tcp.h.seq += data_len; | 465 | eddp->th.tcp.h.seq += data_len; |
466 | } | 466 | } |
467 | } | 467 | } |
468 | 468 | ||
469 | static inline int | 469 | static inline int |
470 | qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, | 470 | qeth_eddp_fill_context_tcp(struct qeth_eddp_context *ctx, |
471 | struct sk_buff *skb, struct qeth_hdr *qhdr) | 471 | struct sk_buff *skb, struct qeth_hdr *qhdr) |
472 | { | 472 | { |
473 | struct qeth_eddp_data *eddp = NULL; | 473 | struct qeth_eddp_data *eddp = NULL; |
474 | 474 | ||
475 | QETH_DBF_TEXT(trace, 5, "eddpficx"); | 475 | QETH_DBF_TEXT(trace, 5, "eddpficx"); |
476 | /* create our segmentation headers and copy original headers */ | 476 | /* create our segmentation headers and copy original headers */ |
477 | if (skb->protocol == ETH_P_IP) | 477 | if (skb->protocol == ETH_P_IP) |
@@ -512,7 +512,7 @@ qeth_eddp_calc_num_pages(struct qeth_eddp_context *ctx, struct sk_buff *skb, | |||
512 | int hdr_len) | 512 | int hdr_len) |
513 | { | 513 | { |
514 | int skbs_per_page; | 514 | int skbs_per_page; |
515 | 515 | ||
516 | QETH_DBF_TEXT(trace, 5, "eddpcanp"); | 516 | QETH_DBF_TEXT(trace, 5, "eddpcanp"); |
517 | /* can we put multiple skbs in one page? */ | 517 | /* can we put multiple skbs in one page? */ |
518 | skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len); | 518 | skbs_per_page = PAGE_SIZE / (skb_shinfo(skb)->tso_size + hdr_len); |
@@ -588,7 +588,7 @@ qeth_eddp_create_context_tcp(struct qeth_card *card, struct sk_buff *skb, | |||
588 | struct qeth_hdr *qhdr) | 588 | struct qeth_hdr *qhdr) |
589 | { | 589 | { |
590 | struct qeth_eddp_context *ctx = NULL; | 590 | struct qeth_eddp_context *ctx = NULL; |
591 | 591 | ||
592 | QETH_DBF_TEXT(trace, 5, "creddpct"); | 592 | QETH_DBF_TEXT(trace, 5, "creddpct"); |
593 | if (skb->protocol == ETH_P_IP) | 593 | if (skb->protocol == ETH_P_IP) |
594 | ctx = qeth_eddp_create_context_generic(card, skb, | 594 | ctx = qeth_eddp_create_context_generic(card, skb, |
diff --git a/drivers/s390/net/qeth_fs.h b/drivers/s390/net/qeth_fs.h index e422b41c656e..61faf05517d6 100644 --- a/drivers/s390/net/qeth_fs.h +++ b/drivers/s390/net/qeth_fs.h | |||
@@ -42,7 +42,7 @@ qeth_create_device_attributes_osn(struct device *dev); | |||
42 | 42 | ||
43 | extern void | 43 | extern void |
44 | qeth_remove_device_attributes_osn(struct device *dev); | 44 | qeth_remove_device_attributes_osn(struct device *dev); |
45 | 45 | ||
46 | extern int | 46 | extern int |
47 | qeth_create_driver_attributes(void); | 47 | qeth_create_driver_attributes(void); |
48 | 48 | ||
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index cb14642d97aa..9e671a48cd2f 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -513,7 +513,7 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) | |||
513 | 513 | ||
514 | QETH_DBF_TEXT(setup, 3, "setoffl"); | 514 | QETH_DBF_TEXT(setup, 3, "setoffl"); |
515 | QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); | 515 | QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); |
516 | 516 | ||
517 | if (card->dev && netif_carrier_ok(card->dev)) | 517 | if (card->dev && netif_carrier_ok(card->dev)) |
518 | netif_carrier_off(card->dev); | 518 | netif_carrier_off(card->dev); |
519 | recover_flag = card->state; | 519 | recover_flag = card->state; |
@@ -604,13 +604,13 @@ __qeth_ref_ip_on_card(struct qeth_card *card, struct qeth_ipaddr *todo, | |||
604 | list_for_each_entry(addr, &card->ip_list, entry) { | 604 | list_for_each_entry(addr, &card->ip_list, entry) { |
605 | if (card->options.layer2) { | 605 | if (card->options.layer2) { |
606 | if ((addr->type == todo->type) && | 606 | if ((addr->type == todo->type) && |
607 | (memcmp(&addr->mac, &todo->mac, | 607 | (memcmp(&addr->mac, &todo->mac, |
608 | OSA_ADDR_LEN) == 0)) { | 608 | OSA_ADDR_LEN) == 0)) { |
609 | found = 1; | 609 | found = 1; |
610 | break; | 610 | break; |
611 | } | 611 | } |
612 | continue; | 612 | continue; |
613 | } | 613 | } |
614 | if ((addr->proto == QETH_PROT_IPV4) && | 614 | if ((addr->proto == QETH_PROT_IPV4) && |
615 | (todo->proto == QETH_PROT_IPV4) && | 615 | (todo->proto == QETH_PROT_IPV4) && |
616 | (addr->type == todo->type) && | 616 | (addr->type == todo->type) && |
@@ -694,13 +694,13 @@ __qeth_insert_ip_todo(struct qeth_card *card, struct qeth_ipaddr *addr, int add) | |||
694 | if (card->options.layer2) { | 694 | if (card->options.layer2) { |
695 | if ((tmp->type == addr->type) && | 695 | if ((tmp->type == addr->type) && |
696 | (tmp->is_multicast == addr->is_multicast) && | 696 | (tmp->is_multicast == addr->is_multicast) && |
697 | (memcmp(&tmp->mac, &addr->mac, | 697 | (memcmp(&tmp->mac, &addr->mac, |
698 | OSA_ADDR_LEN) == 0)) { | 698 | OSA_ADDR_LEN) == 0)) { |
699 | found = 1; | 699 | found = 1; |
700 | break; | 700 | break; |
701 | } | 701 | } |
702 | continue; | 702 | continue; |
703 | } | 703 | } |
704 | if ((tmp->proto == QETH_PROT_IPV4) && | 704 | if ((tmp->proto == QETH_PROT_IPV4) && |
705 | (addr->proto == QETH_PROT_IPV4) && | 705 | (addr->proto == QETH_PROT_IPV4) && |
706 | (tmp->type == addr->type) && | 706 | (tmp->type == addr->type) && |
@@ -1173,7 +1173,7 @@ qeth_determine_card_type(struct qeth_card *card) | |||
1173 | "due to hardware limitations!\n"); | 1173 | "due to hardware limitations!\n"); |
1174 | card->qdio.no_out_queues = 1; | 1174 | card->qdio.no_out_queues = 1; |
1175 | card->qdio.default_out_queue = 0; | 1175 | card->qdio.default_out_queue = 0; |
1176 | } | 1176 | } |
1177 | return 0; | 1177 | return 0; |
1178 | } | 1178 | } |
1179 | i++; | 1179 | i++; |
@@ -1198,7 +1198,7 @@ qeth_probe_device(struct ccwgroup_device *gdev) | |||
1198 | return -ENODEV; | 1198 | return -ENODEV; |
1199 | 1199 | ||
1200 | QETH_DBF_TEXT_(setup, 2, "%s", gdev->dev.bus_id); | 1200 | QETH_DBF_TEXT_(setup, 2, "%s", gdev->dev.bus_id); |
1201 | 1201 | ||
1202 | card = qeth_alloc_card(); | 1202 | card = qeth_alloc_card(); |
1203 | if (!card) { | 1203 | if (!card) { |
1204 | put_device(dev); | 1204 | put_device(dev); |
@@ -1220,7 +1220,7 @@ qeth_probe_device(struct ccwgroup_device *gdev) | |||
1220 | put_device(dev); | 1220 | put_device(dev); |
1221 | qeth_free_card(card); | 1221 | qeth_free_card(card); |
1222 | return rc; | 1222 | return rc; |
1223 | } | 1223 | } |
1224 | if ((rc = qeth_setup_card(card))){ | 1224 | if ((rc = qeth_setup_card(card))){ |
1225 | QETH_DBF_TEXT_(setup, 2, "2err%d", rc); | 1225 | QETH_DBF_TEXT_(setup, 2, "2err%d", rc); |
1226 | put_device(dev); | 1226 | put_device(dev); |
@@ -1843,7 +1843,7 @@ struct qeth_cmd_buffer *iob) | |||
1843 | &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH); | 1843 | &card->seqno.pdu_hdr_ack, QETH_SEQ_NO_LENGTH); |
1844 | QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN); | 1844 | QETH_DBF_HEX(control, 2, iob->data, QETH_DBF_CONTROL_LEN); |
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | static int | 1847 | static int |
1848 | qeth_send_control_data(struct qeth_card *card, int len, | 1848 | qeth_send_control_data(struct qeth_card *card, int len, |
1849 | struct qeth_cmd_buffer *iob, | 1849 | struct qeth_cmd_buffer *iob, |
@@ -1937,7 +1937,7 @@ qeth_osn_send_control_data(struct qeth_card *card, int len, | |||
1937 | wake_up(&card->wait_q); | 1937 | wake_up(&card->wait_q); |
1938 | } | 1938 | } |
1939 | return rc; | 1939 | return rc; |
1940 | } | 1940 | } |
1941 | 1941 | ||
1942 | static inline void | 1942 | static inline void |
1943 | qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, | 1943 | qeth_prepare_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, |
@@ -1966,7 +1966,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, | |||
1966 | memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2); | 1966 | memcpy(QETH_IPA_PDU_LEN_PDU3(iob->data), &s2, 2); |
1967 | return qeth_osn_send_control_data(card, s1, iob); | 1967 | return qeth_osn_send_control_data(card, s1, iob); |
1968 | } | 1968 | } |
1969 | 1969 | ||
1970 | static int | 1970 | static int |
1971 | qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, | 1971 | qeth_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, |
1972 | int (*reply_cb) | 1972 | int (*reply_cb) |
@@ -2579,7 +2579,7 @@ qeth_process_inbound_buffer(struct qeth_card *card, | |||
2579 | skb->dev = card->dev; | 2579 | skb->dev = card->dev; |
2580 | if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) | 2580 | if (hdr->hdr.l2.id == QETH_HEADER_TYPE_LAYER2) |
2581 | vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); | 2581 | vlan_tag = qeth_layer2_rebuild_skb(card, skb, hdr); |
2582 | else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) | 2582 | else if (hdr->hdr.l3.id == QETH_HEADER_TYPE_LAYER3) |
2583 | qeth_rebuild_skb(card, skb, hdr); | 2583 | qeth_rebuild_skb(card, skb, hdr); |
2584 | else { /*in case of OSN*/ | 2584 | else { /*in case of OSN*/ |
2585 | skb_push(skb, sizeof(struct qeth_hdr)); | 2585 | skb_push(skb, sizeof(struct qeth_hdr)); |
@@ -2763,7 +2763,7 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, | |||
2763 | index = i % QDIO_MAX_BUFFERS_PER_Q; | 2763 | index = i % QDIO_MAX_BUFFERS_PER_Q; |
2764 | buffer = &card->qdio.in_q->bufs[index]; | 2764 | buffer = &card->qdio.in_q->bufs[index]; |
2765 | if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && | 2765 | if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && |
2766 | qeth_check_qdio_errors(buffer->buffer, | 2766 | qeth_check_qdio_errors(buffer->buffer, |
2767 | qdio_err, siga_err,"qinerr"))) | 2767 | qdio_err, siga_err,"qinerr"))) |
2768 | qeth_process_inbound_buffer(card, buffer, index); | 2768 | qeth_process_inbound_buffer(card, buffer, index); |
2769 | /* clear buffer and give back to hardware */ | 2769 | /* clear buffer and give back to hardware */ |
@@ -3187,7 +3187,7 @@ qeth_alloc_qdio_buffers(struct qeth_card *card) | |||
3187 | if (card->qdio.state == QETH_QDIO_ALLOCATED) | 3187 | if (card->qdio.state == QETH_QDIO_ALLOCATED) |
3188 | return 0; | 3188 | return 0; |
3189 | 3189 | ||
3190 | card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), | 3190 | card->qdio.in_q = kmalloc(sizeof(struct qeth_qdio_q), |
3191 | GFP_KERNEL|GFP_DMA); | 3191 | GFP_KERNEL|GFP_DMA); |
3192 | if (!card->qdio.in_q) | 3192 | if (!card->qdio.in_q) |
3193 | return - ENOMEM; | 3193 | return - ENOMEM; |
@@ -3476,7 +3476,7 @@ qeth_halt_channels(struct qeth_card *card) | |||
3476 | rc3 = qeth_halt_channel(&card->data); | 3476 | rc3 = qeth_halt_channel(&card->data); |
3477 | if (rc1) | 3477 | if (rc1) |
3478 | return rc1; | 3478 | return rc1; |
3479 | if (rc2) | 3479 | if (rc2) |
3480 | return rc2; | 3480 | return rc2; |
3481 | return rc3; | 3481 | return rc3; |
3482 | } | 3482 | } |
@@ -3491,7 +3491,7 @@ qeth_clear_channels(struct qeth_card *card) | |||
3491 | rc3 = qeth_clear_channel(&card->data); | 3491 | rc3 = qeth_clear_channel(&card->data); |
3492 | if (rc1) | 3492 | if (rc1) |
3493 | return rc1; | 3493 | return rc1; |
3494 | if (rc2) | 3494 | if (rc2) |
3495 | return rc2; | 3495 | return rc2; |
3496 | return rc3; | 3496 | return rc3; |
3497 | } | 3497 | } |
@@ -3798,10 +3798,10 @@ qeth_open(struct net_device *dev) | |||
3798 | QETH_DBF_TEXT(trace,4,"nomacadr"); | 3798 | QETH_DBF_TEXT(trace,4,"nomacadr"); |
3799 | return -EPERM; | 3799 | return -EPERM; |
3800 | } | 3800 | } |
3801 | card->dev->flags |= IFF_UP; | ||
3802 | netif_start_queue(dev); | ||
3803 | card->data.state = CH_STATE_UP; | 3801 | card->data.state = CH_STATE_UP; |
3804 | card->state = CARD_STATE_UP; | 3802 | card->state = CARD_STATE_UP; |
3803 | card->dev->flags |= IFF_UP; | ||
3804 | netif_start_queue(dev); | ||
3805 | 3805 | ||
3806 | if (!card->lan_online && netif_carrier_ok(dev)) | 3806 | if (!card->lan_online && netif_carrier_ok(dev)) |
3807 | netif_carrier_off(dev); | 3807 | netif_carrier_off(dev); |
@@ -3817,7 +3817,7 @@ qeth_stop(struct net_device *dev) | |||
3817 | 3817 | ||
3818 | card = (struct qeth_card *) dev->priv; | 3818 | card = (struct qeth_card *) dev->priv; |
3819 | 3819 | ||
3820 | netif_stop_queue(dev); | 3820 | netif_tx_disable(dev); |
3821 | card->dev->flags &= ~IFF_UP; | 3821 | card->dev->flags &= ~IFF_UP; |
3822 | if (card->state == CARD_STATE_UP) | 3822 | if (card->state == CARD_STATE_UP) |
3823 | card->state = CARD_STATE_SOFTSETUP; | 3823 | card->state = CARD_STATE_SOFTSETUP; |
@@ -3958,7 +3958,7 @@ qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb, | |||
3958 | #endif | 3958 | #endif |
3959 | *hdr = (struct qeth_hdr *) | 3959 | *hdr = (struct qeth_hdr *) |
3960 | qeth_push_skb(card, skb, sizeof(struct qeth_hdr)); | 3960 | qeth_push_skb(card, skb, sizeof(struct qeth_hdr)); |
3961 | if (hdr == NULL) | 3961 | if (*hdr == NULL) |
3962 | return -EINVAL; | 3962 | return -EINVAL; |
3963 | return 0; | 3963 | return 0; |
3964 | } | 3964 | } |
@@ -4098,7 +4098,7 @@ qeth_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, | |||
4098 | } | 4098 | } |
4099 | } else { /* passthrough */ | 4099 | } else { /* passthrough */ |
4100 | if((skb->dev->type == ARPHRD_IEEE802_TR) && | 4100 | if((skb->dev->type == ARPHRD_IEEE802_TR) && |
4101 | !memcmp(skb->data + sizeof(struct qeth_hdr) + | 4101 | !memcmp(skb->data + sizeof(struct qeth_hdr) + |
4102 | sizeof(__u16), skb->dev->broadcast, 6)) { | 4102 | sizeof(__u16), skb->dev->broadcast, 6)) { |
4103 | hdr->hdr.l3.flags = QETH_CAST_BROADCAST | | 4103 | hdr->hdr.l3.flags = QETH_CAST_BROADCAST | |
4104 | QETH_HDR_PASSTHRU; | 4104 | QETH_HDR_PASSTHRU; |
@@ -4385,7 +4385,7 @@ out: | |||
4385 | } | 4385 | } |
4386 | 4386 | ||
4387 | static inline int | 4387 | static inline int |
4388 | qeth_get_elements_no(struct qeth_card *card, void *hdr, | 4388 | qeth_get_elements_no(struct qeth_card *card, void *hdr, |
4389 | struct sk_buff *skb, int elems) | 4389 | struct sk_buff *skb, int elems) |
4390 | { | 4390 | { |
4391 | int elements_needed = 0; | 4391 | int elements_needed = 0; |
@@ -4416,6 +4416,8 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) | |||
4416 | enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; | 4416 | enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; |
4417 | struct qeth_eddp_context *ctx = NULL; | 4417 | struct qeth_eddp_context *ctx = NULL; |
4418 | int tx_bytes = skb->len; | 4418 | int tx_bytes = skb->len; |
4419 | unsigned short nr_frags = skb_shinfo(skb)->nr_frags; | ||
4420 | unsigned short tso_size = skb_shinfo(skb)->tso_size; | ||
4419 | int rc; | 4421 | int rc; |
4420 | 4422 | ||
4421 | QETH_DBF_TEXT(trace, 6, "sendpkt"); | 4423 | QETH_DBF_TEXT(trace, 6, "sendpkt"); |
@@ -4441,7 +4443,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) | |||
4441 | return 0; | 4443 | return 0; |
4442 | } | 4444 | } |
4443 | cast_type = qeth_get_cast_type(card, skb); | 4445 | cast_type = qeth_get_cast_type(card, skb); |
4444 | if ((cast_type == RTN_BROADCAST) && | 4446 | if ((cast_type == RTN_BROADCAST) && |
4445 | (card->info.broadcast_capable == 0)){ | 4447 | (card->info.broadcast_capable == 0)){ |
4446 | card->stats.tx_dropped++; | 4448 | card->stats.tx_dropped++; |
4447 | card->stats.tx_errors++; | 4449 | card->stats.tx_errors++; |
@@ -4463,7 +4465,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) | |||
4463 | card->stats.tx_errors++; | 4465 | card->stats.tx_errors++; |
4464 | dev_kfree_skb_any(skb); | 4466 | dev_kfree_skb_any(skb); |
4465 | return NETDEV_TX_OK; | 4467 | return NETDEV_TX_OK; |
4466 | } | 4468 | } |
4467 | elements_needed++; | 4469 | elements_needed++; |
4468 | } else { | 4470 | } else { |
4469 | if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) { | 4471 | if ((rc = qeth_prepare_skb(card, &skb, &hdr, ipv))) { |
@@ -4498,16 +4500,16 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) | |||
4498 | card->stats.tx_packets++; | 4500 | card->stats.tx_packets++; |
4499 | card->stats.tx_bytes += tx_bytes; | 4501 | card->stats.tx_bytes += tx_bytes; |
4500 | #ifdef CONFIG_QETH_PERF_STATS | 4502 | #ifdef CONFIG_QETH_PERF_STATS |
4501 | if (skb_shinfo(skb)->tso_size && | 4503 | if (tso_size && |
4502 | !(large_send == QETH_LARGE_SEND_NO)) { | 4504 | !(large_send == QETH_LARGE_SEND_NO)) { |
4503 | card->perf_stats.large_send_bytes += skb->len; | 4505 | card->perf_stats.large_send_bytes += tx_bytes; |
4504 | card->perf_stats.large_send_cnt++; | 4506 | card->perf_stats.large_send_cnt++; |
4505 | } | 4507 | } |
4506 | if (skb_shinfo(skb)->nr_frags > 0){ | 4508 | if (nr_frags > 0){ |
4507 | card->perf_stats.sg_skbs_sent++; | 4509 | card->perf_stats.sg_skbs_sent++; |
4508 | /* nr_frags + skb->data */ | 4510 | /* nr_frags + skb->data */ |
4509 | card->perf_stats.sg_frags_sent += | 4511 | card->perf_stats.sg_frags_sent += |
4510 | skb_shinfo(skb)->nr_frags + 1; | 4512 | nr_frags + 1; |
4511 | } | 4513 | } |
4512 | #endif /* CONFIG_QETH_PERF_STATS */ | 4514 | #endif /* CONFIG_QETH_PERF_STATS */ |
4513 | } | 4515 | } |
@@ -5373,7 +5375,7 @@ qeth_layer2_send_setdelvlan_cb(struct qeth_card *card, | |||
5373 | cmd = (struct qeth_ipa_cmd *) data; | 5375 | cmd = (struct qeth_ipa_cmd *) data; |
5374 | if (cmd->hdr.return_code) { | 5376 | if (cmd->hdr.return_code) { |
5375 | PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " | 5377 | PRINT_ERR("Error in processing VLAN %i on %s: 0x%x. " |
5376 | "Continuing\n",cmd->data.setdelvlan.vlan_id, | 5378 | "Continuing\n",cmd->data.setdelvlan.vlan_id, |
5377 | QETH_CARD_IFNAME(card), cmd->hdr.return_code); | 5379 | QETH_CARD_IFNAME(card), cmd->hdr.return_code); |
5378 | QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command); | 5380 | QETH_DBF_TEXT_(trace, 2, "L2VL%4x", cmd->hdr.command); |
5379 | QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card)); | 5381 | QETH_DBF_TEXT_(trace, 2, "L2%s", CARD_BUS_ID(card)); |
@@ -5393,7 +5395,7 @@ qeth_layer2_send_setdelvlan(struct qeth_card *card, __u16 i, | |||
5393 | iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); | 5395 | iob = qeth_get_ipacmd_buffer(card, ipacmd, QETH_PROT_IPV4); |
5394 | cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); | 5396 | cmd = (struct qeth_ipa_cmd *)(iob->data+IPA_PDU_HEADER_SIZE); |
5395 | cmd->data.setdelvlan.vlan_id = i; | 5397 | cmd->data.setdelvlan.vlan_id = i; |
5396 | return qeth_send_ipa_cmd(card, iob, | 5398 | return qeth_send_ipa_cmd(card, iob, |
5397 | qeth_layer2_send_setdelvlan_cb, NULL); | 5399 | qeth_layer2_send_setdelvlan_cb, NULL); |
5398 | } | 5400 | } |
5399 | 5401 | ||
@@ -5457,7 +5459,7 @@ qeth_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
5457 | * Examine hardware response to SET_PROMISC_MODE | 5459 | * Examine hardware response to SET_PROMISC_MODE |
5458 | */ | 5460 | */ |
5459 | static int | 5461 | static int |
5460 | qeth_setadp_promisc_mode_cb(struct qeth_card *card, | 5462 | qeth_setadp_promisc_mode_cb(struct qeth_card *card, |
5461 | struct qeth_reply *reply, | 5463 | struct qeth_reply *reply, |
5462 | unsigned long data) | 5464 | unsigned long data) |
5463 | { | 5465 | { |
@@ -5468,10 +5470,10 @@ qeth_setadp_promisc_mode_cb(struct qeth_card *card, | |||
5468 | 5470 | ||
5469 | cmd = (struct qeth_ipa_cmd *) data; | 5471 | cmd = (struct qeth_ipa_cmd *) data; |
5470 | setparms = &(cmd->data.setadapterparms); | 5472 | setparms = &(cmd->data.setadapterparms); |
5471 | 5473 | ||
5472 | qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd); | 5474 | qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd); |
5473 | if (cmd->hdr.return_code) { | 5475 | if (cmd->hdr.return_code) { |
5474 | QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code); | 5476 | QETH_DBF_TEXT_(trace,4,"prmrc%2.2x",cmd->hdr.return_code); |
5475 | setparms->data.mode = SET_PROMISC_MODE_OFF; | 5477 | setparms->data.mode = SET_PROMISC_MODE_OFF; |
5476 | } | 5478 | } |
5477 | card->info.promisc_mode = setparms->data.mode; | 5479 | card->info.promisc_mode = setparms->data.mode; |
@@ -5517,7 +5519,7 @@ qeth_set_multicast_list(struct net_device *dev) | |||
5517 | 5519 | ||
5518 | if (card->info.type == QETH_CARD_TYPE_OSN) | 5520 | if (card->info.type == QETH_CARD_TYPE_OSN) |
5519 | return ; | 5521 | return ; |
5520 | 5522 | ||
5521 | QETH_DBF_TEXT(trace, 3, "setmulti"); | 5523 | QETH_DBF_TEXT(trace, 3, "setmulti"); |
5522 | qeth_delete_mc_addresses(card); | 5524 | qeth_delete_mc_addresses(card); |
5523 | if (card->options.layer2) { | 5525 | if (card->options.layer2) { |
@@ -5575,7 +5577,7 @@ qeth_osn_assist(struct net_device *dev, | |||
5575 | struct qeth_cmd_buffer *iob; | 5577 | struct qeth_cmd_buffer *iob; |
5576 | struct qeth_card *card; | 5578 | struct qeth_card *card; |
5577 | int rc; | 5579 | int rc; |
5578 | 5580 | ||
5579 | QETH_DBF_TEXT(trace, 2, "osnsdmc"); | 5581 | QETH_DBF_TEXT(trace, 2, "osnsdmc"); |
5580 | if (!dev) | 5582 | if (!dev) |
5581 | return -ENODEV; | 5583 | return -ENODEV; |
@@ -5654,7 +5656,7 @@ qeth_osn_deregister(struct net_device * dev) | |||
5654 | card->osn_info.data_cb = NULL; | 5656 | card->osn_info.data_cb = NULL; |
5655 | return; | 5657 | return; |
5656 | } | 5658 | } |
5657 | 5659 | ||
5658 | static void | 5660 | static void |
5659 | qeth_delete_mc_addresses(struct qeth_card *card) | 5661 | qeth_delete_mc_addresses(struct qeth_card *card) |
5660 | { | 5662 | { |
@@ -5818,7 +5820,7 @@ qeth_add_multicast_ipv6(struct qeth_card *card) | |||
5818 | struct inet6_dev *in6_dev; | 5820 | struct inet6_dev *in6_dev; |
5819 | 5821 | ||
5820 | QETH_DBF_TEXT(trace,4,"chkmcv6"); | 5822 | QETH_DBF_TEXT(trace,4,"chkmcv6"); |
5821 | if (!qeth_is_supported(card, IPA_IPV6)) | 5823 | if (!qeth_is_supported(card, IPA_IPV6)) |
5822 | return ; | 5824 | return ; |
5823 | in6_dev = in6_dev_get(card->dev); | 5825 | in6_dev = in6_dev_get(card->dev); |
5824 | if (in6_dev == NULL) | 5826 | if (in6_dev == NULL) |
@@ -6359,12 +6361,9 @@ qeth_netdev_init(struct net_device *dev) | |||
6359 | dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; | 6361 | dev->vlan_rx_kill_vid = qeth_vlan_rx_kill_vid; |
6360 | dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; | 6362 | dev->vlan_rx_add_vid = qeth_vlan_rx_add_vid; |
6361 | #endif | 6363 | #endif |
6362 | dev->hard_header = card->orig_hard_header; | ||
6363 | if (qeth_get_netdev_flags(card) & IFF_NOARP) { | 6364 | if (qeth_get_netdev_flags(card) & IFF_NOARP) { |
6364 | dev->rebuild_header = NULL; | 6365 | dev->rebuild_header = NULL; |
6365 | dev->hard_header = NULL; | 6366 | dev->hard_header = NULL; |
6366 | if (card->options.fake_ll) | ||
6367 | dev->hard_header = qeth_fake_header; | ||
6368 | dev->header_cache_update = NULL; | 6367 | dev->header_cache_update = NULL; |
6369 | dev->hard_header_cache = NULL; | 6368 | dev->hard_header_cache = NULL; |
6370 | } | 6369 | } |
@@ -6373,6 +6372,9 @@ qeth_netdev_init(struct net_device *dev) | |||
6373 | if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) | 6372 | if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) |
6374 | card->dev->dev_id = card->info.unique_id & 0xffff; | 6373 | card->dev->dev_id = card->info.unique_id & 0xffff; |
6375 | #endif | 6374 | #endif |
6375 | if (card->options.fake_ll && | ||
6376 | (qeth_get_netdev_flags(card) & IFF_NOARP)) | ||
6377 | dev->hard_header = qeth_fake_header; | ||
6376 | dev->hard_header_parse = NULL; | 6378 | dev->hard_header_parse = NULL; |
6377 | dev->set_mac_address = qeth_layer2_set_mac_address; | 6379 | dev->set_mac_address = qeth_layer2_set_mac_address; |
6378 | dev->flags |= qeth_get_netdev_flags(card); | 6380 | dev->flags |= qeth_get_netdev_flags(card); |
@@ -6477,6 +6479,9 @@ retry: | |||
6477 | /*network device will be recovered*/ | 6479 | /*network device will be recovered*/ |
6478 | if (card->dev) { | 6480 | if (card->dev) { |
6479 | card->dev->hard_header = card->orig_hard_header; | 6481 | card->dev->hard_header = card->orig_hard_header; |
6482 | if (card->options.fake_ll && | ||
6483 | (qeth_get_netdev_flags(card) & IFF_NOARP)) | ||
6484 | card->dev->hard_header = qeth_fake_header; | ||
6480 | return 0; | 6485 | return 0; |
6481 | } | 6486 | } |
6482 | /* at first set_online allocate netdev */ | 6487 | /* at first set_online allocate netdev */ |
@@ -6584,7 +6589,7 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card, | |||
6584 | 6589 | ||
6585 | cmd = (struct qeth_ipa_cmd *) data; | 6590 | cmd = (struct qeth_ipa_cmd *) data; |
6586 | if (!card->options.layer2 || card->info.guestlan || | 6591 | if (!card->options.layer2 || card->info.guestlan || |
6587 | !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { | 6592 | !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { |
6588 | memcpy(card->dev->dev_addr, | 6593 | memcpy(card->dev->dev_addr, |
6589 | &cmd->data.setadapterparms.data.change_addr.addr, | 6594 | &cmd->data.setadapterparms.data.change_addr.addr, |
6590 | OSA_ADDR_LEN); | 6595 | OSA_ADDR_LEN); |
@@ -7031,14 +7036,12 @@ qeth_softsetup_ipv6(struct qeth_card *card) | |||
7031 | 7036 | ||
7032 | QETH_DBF_TEXT(trace,3,"softipv6"); | 7037 | QETH_DBF_TEXT(trace,3,"softipv6"); |
7033 | 7038 | ||
7034 | netif_stop_queue(card->dev); | ||
7035 | rc = qeth_send_startlan(card, QETH_PROT_IPV6); | 7039 | rc = qeth_send_startlan(card, QETH_PROT_IPV6); |
7036 | if (rc) { | 7040 | if (rc) { |
7037 | PRINT_ERR("IPv6 startlan failed on %s\n", | 7041 | PRINT_ERR("IPv6 startlan failed on %s\n", |
7038 | QETH_CARD_IFNAME(card)); | 7042 | QETH_CARD_IFNAME(card)); |
7039 | return rc; | 7043 | return rc; |
7040 | } | 7044 | } |
7041 | netif_wake_queue(card->dev); | ||
7042 | rc = qeth_query_ipassists(card,QETH_PROT_IPV6); | 7045 | rc = qeth_query_ipassists(card,QETH_PROT_IPV6); |
7043 | if (rc) { | 7046 | if (rc) { |
7044 | PRINT_ERR("IPv6 query ipassist failed on %s\n", | 7047 | PRINT_ERR("IPv6 query ipassist failed on %s\n", |
@@ -7352,7 +7355,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) | |||
7352 | card->options.large_send = type; | 7355 | card->options.large_send = type; |
7353 | return 0; | 7356 | return 0; |
7354 | } | 7357 | } |
7355 | netif_stop_queue(card->dev); | 7358 | if (card->state == CARD_STATE_UP) |
7359 | netif_tx_disable(card->dev); | ||
7356 | card->options.large_send = type; | 7360 | card->options.large_send = type; |
7357 | switch (card->options.large_send) { | 7361 | switch (card->options.large_send) { |
7358 | case QETH_LARGE_SEND_EDDP: | 7362 | case QETH_LARGE_SEND_EDDP: |
@@ -7374,7 +7378,8 @@ qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) | |||
7374 | card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); | 7378 | card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); |
7375 | break; | 7379 | break; |
7376 | } | 7380 | } |
7377 | netif_wake_queue(card->dev); | 7381 | if (card->state == CARD_STATE_UP) |
7382 | netif_wake_queue(card->dev); | ||
7378 | return rc; | 7383 | return rc; |
7379 | } | 7384 | } |
7380 | 7385 | ||
@@ -7427,7 +7432,7 @@ qeth_softsetup_card(struct qeth_card *card) | |||
7427 | if ((rc = qeth_setrouting_v6(card))) | 7432 | if ((rc = qeth_setrouting_v6(card))) |
7428 | QETH_DBF_TEXT_(setup, 2, "5err%d", rc); | 7433 | QETH_DBF_TEXT_(setup, 2, "5err%d", rc); |
7429 | out: | 7434 | out: |
7430 | netif_stop_queue(card->dev); | 7435 | netif_tx_disable(card->dev); |
7431 | return 0; | 7436 | return 0; |
7432 | } | 7437 | } |
7433 | 7438 | ||
@@ -7567,7 +7572,7 @@ qeth_stop_card(struct qeth_card *card, int recovery_mode) | |||
7567 | if (card->read.state == CH_STATE_UP && | 7572 | if (card->read.state == CH_STATE_UP && |
7568 | card->write.state == CH_STATE_UP && | 7573 | card->write.state == CH_STATE_UP && |
7569 | (card->state == CARD_STATE_UP)) { | 7574 | (card->state == CARD_STATE_UP)) { |
7570 | if (recovery_mode && | 7575 | if (recovery_mode && |
7571 | card->info.type != QETH_CARD_TYPE_OSN) { | 7576 | card->info.type != QETH_CARD_TYPE_OSN) { |
7572 | qeth_stop(card->dev); | 7577 | qeth_stop(card->dev); |
7573 | } else { | 7578 | } else { |
@@ -7736,10 +7741,8 @@ static int | |||
7736 | qeth_register_netdev(struct qeth_card *card) | 7741 | qeth_register_netdev(struct qeth_card *card) |
7737 | { | 7742 | { |
7738 | QETH_DBF_TEXT(setup, 3, "regnetd"); | 7743 | QETH_DBF_TEXT(setup, 3, "regnetd"); |
7739 | if (card->dev->reg_state != NETREG_UNINITIALIZED) { | 7744 | if (card->dev->reg_state != NETREG_UNINITIALIZED) |
7740 | qeth_netdev_init(card->dev); | ||
7741 | return 0; | 7745 | return 0; |
7742 | } | ||
7743 | /* sysfs magic */ | 7746 | /* sysfs magic */ |
7744 | SET_NETDEV_DEV(card->dev, &card->gdev->dev); | 7747 | SET_NETDEV_DEV(card->dev, &card->gdev->dev); |
7745 | return register_netdev(card->dev); | 7748 | return register_netdev(card->dev); |
@@ -7750,7 +7753,7 @@ qeth_start_again(struct qeth_card *card, int recovery_mode) | |||
7750 | { | 7753 | { |
7751 | QETH_DBF_TEXT(setup ,2, "startag"); | 7754 | QETH_DBF_TEXT(setup ,2, "startag"); |
7752 | 7755 | ||
7753 | if (recovery_mode && | 7756 | if (recovery_mode && |
7754 | card->info.type != QETH_CARD_TYPE_OSN) { | 7757 | card->info.type != QETH_CARD_TYPE_OSN) { |
7755 | qeth_open(card->dev); | 7758 | qeth_open(card->dev); |
7756 | } else { | 7759 | } else { |
diff --git a/drivers/s390/net/qeth_mpc.h b/drivers/s390/net/qeth_mpc.h index 011c41041029..0477c47471c5 100644 --- a/drivers/s390/net/qeth_mpc.h +++ b/drivers/s390/net/qeth_mpc.h | |||
@@ -445,7 +445,7 @@ enum qeth_ipa_arp_return_codes { | |||
445 | /* Helper functions */ | 445 | /* Helper functions */ |
446 | #define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ | 446 | #define IS_IPA_REPLY(cmd) ((cmd->hdr.initiator == IPA_CMD_INITIATOR_HOST) || \ |
447 | (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY)) | 447 | (cmd->hdr.initiator == IPA_CMD_INITIATOR_OSA_REPLY)) |
448 | 448 | ||
449 | /*****************************************************************************/ | 449 | /*****************************************************************************/ |
450 | /* END OF IP Assist related definitions */ | 450 | /* END OF IP Assist related definitions */ |
451 | /*****************************************************************************/ | 451 | /*****************************************************************************/ |
@@ -490,7 +490,7 @@ extern unsigned char ULP_ENABLE[]; | |||
490 | /* Layer 2 defintions */ | 490 | /* Layer 2 defintions */ |
491 | #define QETH_PROT_LAYER2 0x08 | 491 | #define QETH_PROT_LAYER2 0x08 |
492 | #define QETH_PROT_TCPIP 0x03 | 492 | #define QETH_PROT_TCPIP 0x03 |
493 | #define QETH_PROT_OSN2 0x0a | 493 | #define QETH_PROT_OSN2 0x0a |
494 | #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50) | 494 | #define QETH_ULP_ENABLE_PROT_TYPE(buffer) (buffer+0x50) |
495 | #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19) | 495 | #define QETH_IPA_CMD_PROT_TYPE(buffer) (buffer+0x19) |
496 | 496 | ||
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c index 360d782c7ada..66f2da14e6e3 100644 --- a/drivers/s390/net/qeth_proc.c +++ b/drivers/s390/net/qeth_proc.c | |||
@@ -36,7 +36,7 @@ qeth_procfile_seq_start(struct seq_file *s, loff_t *offset) | |||
36 | { | 36 | { |
37 | struct device *dev = NULL; | 37 | struct device *dev = NULL; |
38 | loff_t nr = 0; | 38 | loff_t nr = 0; |
39 | 39 | ||
40 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); | 40 | down_read(&qeth_ccwgroup_driver.driver.bus->subsys.rwsem); |
41 | if (*offset == 0) | 41 | if (*offset == 0) |
42 | return SEQ_START_TOKEN; | 42 | return SEQ_START_TOKEN; |
@@ -60,8 +60,8 @@ static void * | |||
60 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) | 60 | qeth_procfile_seq_next(struct seq_file *s, void *it, loff_t *offset) |
61 | { | 61 | { |
62 | struct device *prev, *next; | 62 | struct device *prev, *next; |
63 | 63 | ||
64 | if (it == SEQ_START_TOKEN) | 64 | if (it == SEQ_START_TOKEN) |
65 | prev = NULL; | 65 | prev = NULL; |
66 | else | 66 | else |
67 | prev = (struct device *) it; | 67 | prev = (struct device *) it; |
@@ -180,7 +180,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void *it) | |||
180 | struct device *device; | 180 | struct device *device; |
181 | struct qeth_card *card; | 181 | struct qeth_card *card; |
182 | 182 | ||
183 | 183 | ||
184 | if (it == SEQ_START_TOKEN) | 184 | if (it == SEQ_START_TOKEN) |
185 | return 0; | 185 | return 0; |
186 | 186 | ||
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index 882d419e4160..185a9cfbcbdc 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c | |||
@@ -785,7 +785,7 @@ qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, con | |||
785 | } | 785 | } |
786 | if (card->options.large_send == type) | 786 | if (card->options.large_send == type) |
787 | return count; | 787 | return count; |
788 | if ((rc = qeth_set_large_send(card, type))) | 788 | if ((rc = qeth_set_large_send(card, type))) |
789 | return rc; | 789 | return rc; |
790 | return count; | 790 | return count; |
791 | } | 791 | } |
@@ -1682,7 +1682,7 @@ qeth_create_device_attributes(struct device *dev) | |||
1682 | if (card->info.type == QETH_CARD_TYPE_OSN) | 1682 | if (card->info.type == QETH_CARD_TYPE_OSN) |
1683 | return sysfs_create_group(&dev->kobj, | 1683 | return sysfs_create_group(&dev->kobj, |
1684 | &qeth_osn_device_attr_group); | 1684 | &qeth_osn_device_attr_group); |
1685 | 1685 | ||
1686 | if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group))) | 1686 | if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_attr_group))) |
1687 | return ret; | 1687 | return ret; |
1688 | if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){ | 1688 | if ((ret = sysfs_create_group(&dev->kobj, &qeth_device_ipato_group))){ |
@@ -1713,7 +1713,7 @@ qeth_remove_device_attributes(struct device *dev) | |||
1713 | if (card->info.type == QETH_CARD_TYPE_OSN) | 1713 | if (card->info.type == QETH_CARD_TYPE_OSN) |
1714 | return sysfs_remove_group(&dev->kobj, | 1714 | return sysfs_remove_group(&dev->kobj, |
1715 | &qeth_osn_device_attr_group); | 1715 | &qeth_osn_device_attr_group); |
1716 | 1716 | ||
1717 | sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); | 1717 | sysfs_remove_group(&dev->kobj, &qeth_device_attr_group); |
1718 | sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group); | 1718 | sysfs_remove_group(&dev->kobj, &qeth_device_ipato_group); |
1719 | sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group); | 1719 | sysfs_remove_group(&dev->kobj, &qeth_device_vipa_group); |
diff --git a/drivers/s390/net/qeth_tso.h b/drivers/s390/net/qeth_tso.h index 1286ddea450b..24ef40ca9562 100644 --- a/drivers/s390/net/qeth_tso.h +++ b/drivers/s390/net/qeth_tso.h | |||
@@ -117,11 +117,11 @@ __qeth_fill_buffer_frag(struct sk_buff *skb, struct qdio_buffer *buffer, | |||
117 | int fragno; | 117 | int fragno; |
118 | unsigned long addr; | 118 | unsigned long addr; |
119 | int element, cnt, dlen; | 119 | int element, cnt, dlen; |
120 | 120 | ||
121 | fragno = skb_shinfo(skb)->nr_frags; | 121 | fragno = skb_shinfo(skb)->nr_frags; |
122 | element = *next_element_to_fill; | 122 | element = *next_element_to_fill; |
123 | dlen = 0; | 123 | dlen = 0; |
124 | 124 | ||
125 | if (is_tso) | 125 | if (is_tso) |
126 | buffer->element[element].flags = | 126 | buffer->element[element].flags = |
127 | SBAL_FLAGS_MIDDLE_FRAG; | 127 | SBAL_FLAGS_MIDDLE_FRAG; |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 823dfa78c0ba..b046ffa22101 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -3643,6 +3643,8 @@ static void ata_pio_block(struct ata_port *ap) | |||
3643 | 3643 | ||
3644 | ata_pio_sector(qc); | 3644 | ata_pio_sector(qc); |
3645 | } | 3645 | } |
3646 | |||
3647 | ata_altstatus(ap); /* flush */ | ||
3646 | } | 3648 | } |
3647 | 3649 | ||
3648 | static void ata_pio_error(struct ata_port *ap) | 3650 | static void ata_pio_error(struct ata_port *ap) |
@@ -3759,11 +3761,14 @@ static void atapi_packet_task(void *_data) | |||
3759 | spin_lock_irqsave(&ap->host_set->lock, flags); | 3761 | spin_lock_irqsave(&ap->host_set->lock, flags); |
3760 | ap->flags &= ~ATA_FLAG_NOINTR; | 3762 | ap->flags &= ~ATA_FLAG_NOINTR; |
3761 | ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1); | 3763 | ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1); |
3764 | ata_altstatus(ap); /* flush */ | ||
3765 | |||
3762 | if (qc->tf.protocol == ATA_PROT_ATAPI_DMA) | 3766 | if (qc->tf.protocol == ATA_PROT_ATAPI_DMA) |
3763 | ap->ops->bmdma_start(qc); /* initiate bmdma */ | 3767 | ap->ops->bmdma_start(qc); /* initiate bmdma */ |
3764 | spin_unlock_irqrestore(&ap->host_set->lock, flags); | 3768 | spin_unlock_irqrestore(&ap->host_set->lock, flags); |
3765 | } else { | 3769 | } else { |
3766 | ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1); | 3770 | ata_data_xfer(ap, qc->cdb, qc->dev->cdb_len, 1); |
3771 | ata_altstatus(ap); /* flush */ | ||
3767 | 3772 | ||
3768 | /* PIO commands are handled by polling */ | 3773 | /* PIO commands are handled by polling */ |
3769 | ap->hsm_task_state = HSM_ST; | 3774 | ap->hsm_task_state = HSM_ST; |
@@ -4292,6 +4297,7 @@ static int ata_start_drive(struct ata_port *ap, struct ata_device *dev) | |||
4292 | int ata_device_resume(struct ata_port *ap, struct ata_device *dev) | 4297 | int ata_device_resume(struct ata_port *ap, struct ata_device *dev) |
4293 | { | 4298 | { |
4294 | if (ap->flags & ATA_FLAG_SUSPENDED) { | 4299 | if (ap->flags & ATA_FLAG_SUSPENDED) { |
4300 | ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 200000); | ||
4295 | ap->flags &= ~ATA_FLAG_SUSPENDED; | 4301 | ap->flags &= ~ATA_FLAG_SUSPENDED; |
4296 | ata_set_mode(ap); | 4302 | ata_set_mode(ap); |
4297 | } | 4303 | } |
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c index 969f94900431..5cba59ad7dc5 100644 --- a/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/serial/cpm_uart/cpm_uart_core.c | |||
@@ -1164,14 +1164,16 @@ static int __init cpm_uart_console_setup(struct console *co, char *options) | |||
1164 | struct fs_uart_platform_info *pdata; | 1164 | struct fs_uart_platform_info *pdata; |
1165 | struct platform_device* pdev = early_uart_get_pdev(co->index); | 1165 | struct platform_device* pdev = early_uart_get_pdev(co->index); |
1166 | 1166 | ||
1167 | port = | ||
1168 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; | ||
1169 | pinfo = (struct uart_cpm_port *)port; | ||
1170 | if (!pdev) { | 1167 | if (!pdev) { |
1171 | pr_info("cpm_uart: console: compat mode\n"); | 1168 | pr_info("cpm_uart: console: compat mode\n"); |
1172 | /* compatibility - will be cleaned up */ | 1169 | /* compatibility - will be cleaned up */ |
1173 | cpm_uart_init_portdesc(); | 1170 | cpm_uart_init_portdesc(); |
1171 | } | ||
1174 | 1172 | ||
1173 | port = | ||
1174 | (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]]; | ||
1175 | pinfo = (struct uart_cpm_port *)port; | ||
1176 | if (!pdev) { | ||
1175 | if (pinfo->set_lineif) | 1177 | if (pinfo->set_lineif) |
1176 | pinfo->set_lineif(pinfo); | 1178 | pinfo->set_lineif(pinfo); |
1177 | } else { | 1179 | } else { |
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm2.c b/drivers/serial/cpm_uart/cpm_uart_cpm2.c index 4b2de08f46d0..cdba128250a9 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c | |||
@@ -213,7 +213,7 @@ int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con) | |||
213 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); | 213 | L1_CACHE_ALIGN(pinfo->tx_nrfifos * pinfo->tx_fifosize); |
214 | if (is_con) { | 214 | if (is_con) { |
215 | mem_addr = alloc_bootmem(memsz); | 215 | mem_addr = alloc_bootmem(memsz); |
216 | dma_addr = mem_addr; | 216 | dma_addr = virt_to_bus(mem_addr); |
217 | } | 217 | } |
218 | else | 218 | else |
219 | mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, | 219 | mem_addr = dma_alloc_coherent(NULL, memsz, &dma_addr, |
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 1c4396c2962d..2b4f96541b8e 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -1730,3 +1730,4 @@ static void __exit sunsu_exit(void) | |||
1730 | 1730 | ||
1731 | module_init(sunsu_probe); | 1731 | module_init(sunsu_probe); |
1732 | module_exit(sunsu_exit); | 1732 | module_exit(sunsu_exit); |
1733 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 9de4b5a04d70..5fc14563ee3a 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -405,7 +405,7 @@ static int s3c24xx_spi_remove(struct platform_device *dev) | |||
405 | 405 | ||
406 | static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) | 406 | static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) |
407 | { | 407 | { |
408 | struct s3c24xx_spi *hw = platform_get_drvdata(dev); | 408 | struct s3c24xx_spi *hw = platform_get_drvdata(pdev); |
409 | 409 | ||
410 | clk_disable(hw->clk); | 410 | clk_disable(hw->clk); |
411 | return 0; | 411 | return 0; |
@@ -413,7 +413,7 @@ static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) | |||
413 | 413 | ||
414 | static int s3c24xx_spi_resume(struct platform_device *pdev) | 414 | static int s3c24xx_spi_resume(struct platform_device *pdev) |
415 | { | 415 | { |
416 | struct s3c24xx_spi *hw = platform_get_drvdata(dev); | 416 | struct s3c24xx_spi *hw = platform_get_drvdata(pdev); |
417 | 417 | ||
418 | clk_enable(hw->clk); | 418 | clk_enable(hw->clk); |
419 | return 0; | 419 | return 0; |