diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-09-19 04:47:49 -0400 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-09-19 04:47:49 -0400 |
commit | 044a500e46742d39d22f1781cfb64ba93b463e39 (patch) | |
tree | b0313211ea7ba26b90c1083ade0e4c9f486b87db /drivers | |
parent | f6098cf449b81c14a51e48dd22ae47d03126a1de (diff) | |
parent | 6c0741fbdee5bd0f8ed13ac287c4ab18e8ba7d83 (diff) |
Merge branch 'master' of /home/src/linux-2.6/
Diffstat (limited to 'drivers')
37 files changed, 663 insertions, 655 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index 711d2f314ac3..94af920465b5 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c | |||
@@ -750,6 +750,14 @@ static int pf_ready(void) | |||
750 | 750 | ||
751 | static struct request_queue *pf_queue; | 751 | static struct request_queue *pf_queue; |
752 | 752 | ||
753 | static void pf_end_request(int uptodate) | ||
754 | { | ||
755 | if (pf_req) { | ||
756 | end_request(pf_req, uptodate); | ||
757 | pf_req = NULL; | ||
758 | } | ||
759 | } | ||
760 | |||
753 | static void do_pf_request(request_queue_t * q) | 761 | static void do_pf_request(request_queue_t * q) |
754 | { | 762 | { |
755 | if (pf_busy) | 763 | if (pf_busy) |
@@ -765,7 +773,7 @@ repeat: | |||
765 | pf_count = pf_req->current_nr_sectors; | 773 | pf_count = pf_req->current_nr_sectors; |
766 | 774 | ||
767 | if (pf_block + pf_count > get_capacity(pf_req->rq_disk)) { | 775 | if (pf_block + pf_count > get_capacity(pf_req->rq_disk)) { |
768 | end_request(pf_req, 0); | 776 | pf_end_request(0); |
769 | goto repeat; | 777 | goto repeat; |
770 | } | 778 | } |
771 | 779 | ||
@@ -780,7 +788,7 @@ repeat: | |||
780 | pi_do_claimed(pf_current->pi, do_pf_write); | 788 | pi_do_claimed(pf_current->pi, do_pf_write); |
781 | else { | 789 | else { |
782 | pf_busy = 0; | 790 | pf_busy = 0; |
783 | end_request(pf_req, 0); | 791 | pf_end_request(0); |
784 | goto repeat; | 792 | goto repeat; |
785 | } | 793 | } |
786 | } | 794 | } |
@@ -798,9 +806,11 @@ static int pf_next_buf(void) | |||
798 | if (!pf_count) | 806 | if (!pf_count) |
799 | return 1; | 807 | return 1; |
800 | spin_lock_irqsave(&pf_spin_lock, saved_flags); | 808 | spin_lock_irqsave(&pf_spin_lock, saved_flags); |
801 | end_request(pf_req, 1); | 809 | pf_end_request(1); |
802 | pf_count = pf_req->current_nr_sectors; | 810 | if (pf_req) { |
803 | pf_buf = pf_req->buffer; | 811 | pf_count = pf_req->current_nr_sectors; |
812 | pf_buf = pf_req->buffer; | ||
813 | } | ||
804 | spin_unlock_irqrestore(&pf_spin_lock, saved_flags); | 814 | spin_unlock_irqrestore(&pf_spin_lock, saved_flags); |
805 | return 1; | 815 | return 1; |
806 | } | 816 | } |
@@ -810,7 +820,7 @@ static inline void next_request(int success) | |||
810 | unsigned long saved_flags; | 820 | unsigned long saved_flags; |
811 | 821 | ||
812 | spin_lock_irqsave(&pf_spin_lock, saved_flags); | 822 | spin_lock_irqsave(&pf_spin_lock, saved_flags); |
813 | end_request(pf_req, success); | 823 | pf_end_request(success); |
814 | pf_busy = 0; | 824 | pf_busy = 0; |
815 | do_pf_request(pf_queue); | 825 | do_pf_request(pf_queue); |
816 | spin_unlock_irqrestore(&pf_spin_lock, saved_flags); | 826 | spin_unlock_irqrestore(&pf_spin_lock, saved_flags); |
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c index 856c2278e9d0..079ec344eb47 100644 --- a/drivers/block/scsi_ioctl.c +++ b/drivers/block/scsi_ioctl.c | |||
@@ -168,6 +168,7 @@ static int verify_command(struct file *file, unsigned char *cmd) | |||
168 | safe_for_write(WRITE_VERIFY_12), | 168 | safe_for_write(WRITE_VERIFY_12), |
169 | safe_for_write(WRITE_16), | 169 | safe_for_write(WRITE_16), |
170 | safe_for_write(WRITE_LONG), | 170 | safe_for_write(WRITE_LONG), |
171 | safe_for_write(WRITE_LONG_2), | ||
171 | safe_for_write(ERASE), | 172 | safe_for_write(ERASE), |
172 | safe_for_write(GPCMD_MODE_SELECT_10), | 173 | safe_for_write(GPCMD_MODE_SELECT_10), |
173 | safe_for_write(MODE_SELECT), | 174 | safe_for_write(MODE_SELECT), |
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index 99762b6c19ae..de5d6d212674 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c | |||
@@ -252,7 +252,7 @@ hp_zx1_configure (void) | |||
252 | readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); | 252 | readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); |
253 | writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); | 253 | writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); |
254 | readl(hp->ioc_regs+HP_ZX1_TCNFG); | 254 | readl(hp->ioc_regs+HP_ZX1_TCNFG); |
255 | writel(~(HP_ZX1_IOVA_SIZE-1), hp->ioc_regs+HP_ZX1_IMASK); | 255 | writel((unsigned int)(~(HP_ZX1_IOVA_SIZE-1)), hp->ioc_regs+HP_ZX1_IMASK); |
256 | readl(hp->ioc_regs+HP_ZX1_IMASK); | 256 | readl(hp->ioc_regs+HP_ZX1_IMASK); |
257 | writel(hp->iova_base|1, hp->ioc_regs+HP_ZX1_IBASE); | 257 | writel(hp->iova_base|1, hp->ioc_regs+HP_ZX1_IBASE); |
258 | readl(hp->ioc_regs+HP_ZX1_IBASE); | 258 | readl(hp->ioc_regs+HP_ZX1_IBASE); |
diff --git a/drivers/char/epca.c b/drivers/char/epca.c index 58d3738a2b7f..407708a001e4 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c | |||
@@ -534,7 +534,7 @@ static void shutdown(struct channel *ch) | |||
534 | 534 | ||
535 | unsigned long flags; | 535 | unsigned long flags; |
536 | struct tty_struct *tty; | 536 | struct tty_struct *tty; |
537 | struct board_chan *bc; | 537 | struct board_chan __iomem *bc; |
538 | 538 | ||
539 | if (!(ch->asyncflags & ASYNC_INITIALIZED)) | 539 | if (!(ch->asyncflags & ASYNC_INITIALIZED)) |
540 | return; | 540 | return; |
@@ -618,7 +618,7 @@ static int pc_write(struct tty_struct * tty, | |||
618 | struct channel *ch; | 618 | struct channel *ch; |
619 | unsigned long flags; | 619 | unsigned long flags; |
620 | int remain; | 620 | int remain; |
621 | struct board_chan *bc; | 621 | struct board_chan __iomem *bc; |
622 | 622 | ||
623 | /* ---------------------------------------------------------------- | 623 | /* ---------------------------------------------------------------- |
624 | pc_write is primarily called directly by the kernel routine | 624 | pc_write is primarily called directly by the kernel routine |
@@ -685,7 +685,7 @@ static int pc_write(struct tty_struct * tty, | |||
685 | ------------------------------------------------------------------- */ | 685 | ------------------------------------------------------------------- */ |
686 | 686 | ||
687 | dataLen = min(bytesAvailable, dataLen); | 687 | dataLen = min(bytesAvailable, dataLen); |
688 | memcpy(ch->txptr + head, buf, dataLen); | 688 | memcpy_toio(ch->txptr + head, buf, dataLen); |
689 | buf += dataLen; | 689 | buf += dataLen; |
690 | head += dataLen; | 690 | head += dataLen; |
691 | amountCopied += dataLen; | 691 | amountCopied += dataLen; |
@@ -726,7 +726,7 @@ static int pc_write_room(struct tty_struct *tty) | |||
726 | struct channel *ch; | 726 | struct channel *ch; |
727 | unsigned long flags; | 727 | unsigned long flags; |
728 | unsigned int head, tail; | 728 | unsigned int head, tail; |
729 | struct board_chan *bc; | 729 | struct board_chan __iomem *bc; |
730 | 730 | ||
731 | remain = 0; | 731 | remain = 0; |
732 | 732 | ||
@@ -773,7 +773,7 @@ static int pc_chars_in_buffer(struct tty_struct *tty) | |||
773 | int remain; | 773 | int remain; |
774 | unsigned long flags; | 774 | unsigned long flags; |
775 | struct channel *ch; | 775 | struct channel *ch; |
776 | struct board_chan *bc; | 776 | struct board_chan __iomem *bc; |
777 | 777 | ||
778 | /* --------------------------------------------------------- | 778 | /* --------------------------------------------------------- |
779 | verifyChannel returns the channel from the tty struct | 779 | verifyChannel returns the channel from the tty struct |
@@ -830,7 +830,7 @@ static void pc_flush_buffer(struct tty_struct *tty) | |||
830 | unsigned int tail; | 830 | unsigned int tail; |
831 | unsigned long flags; | 831 | unsigned long flags; |
832 | struct channel *ch; | 832 | struct channel *ch; |
833 | struct board_chan *bc; | 833 | struct board_chan __iomem *bc; |
834 | /* --------------------------------------------------------- | 834 | /* --------------------------------------------------------- |
835 | verifyChannel returns the channel from the tty struct | 835 | verifyChannel returns the channel from the tty struct |
836 | if it is valid. This serves as a sanity check. | 836 | if it is valid. This serves as a sanity check. |
@@ -976,7 +976,7 @@ static int pc_open(struct tty_struct *tty, struct file * filp) | |||
976 | struct channel *ch; | 976 | struct channel *ch; |
977 | unsigned long flags; | 977 | unsigned long flags; |
978 | int line, retval, boardnum; | 978 | int line, retval, boardnum; |
979 | struct board_chan *bc; | 979 | struct board_chan __iomem *bc; |
980 | unsigned int head; | 980 | unsigned int head; |
981 | 981 | ||
982 | line = tty->index; | 982 | line = tty->index; |
@@ -1041,7 +1041,7 @@ static int pc_open(struct tty_struct *tty, struct file * filp) | |||
1041 | ch->statusflags = 0; | 1041 | ch->statusflags = 0; |
1042 | 1042 | ||
1043 | /* Save boards current modem status */ | 1043 | /* Save boards current modem status */ |
1044 | ch->imodem = bc->mstat; | 1044 | ch->imodem = readb(&bc->mstat); |
1045 | 1045 | ||
1046 | /* ---------------------------------------------------------------- | 1046 | /* ---------------------------------------------------------------- |
1047 | Set receive head and tail ptrs to each other. This indicates | 1047 | Set receive head and tail ptrs to each other. This indicates |
@@ -1399,10 +1399,10 @@ static void post_fep_init(unsigned int crd) | |||
1399 | { /* Begin post_fep_init */ | 1399 | { /* Begin post_fep_init */ |
1400 | 1400 | ||
1401 | int i; | 1401 | int i; |
1402 | unsigned char *memaddr; | 1402 | void __iomem *memaddr; |
1403 | struct global_data *gd; | 1403 | struct global_data __iomem *gd; |
1404 | struct board_info *bd; | 1404 | struct board_info *bd; |
1405 | struct board_chan *bc; | 1405 | struct board_chan __iomem *bc; |
1406 | struct channel *ch; | 1406 | struct channel *ch; |
1407 | int shrinkmem = 0, lowwater ; | 1407 | int shrinkmem = 0, lowwater ; |
1408 | 1408 | ||
@@ -1461,7 +1461,7 @@ static void post_fep_init(unsigned int crd) | |||
1461 | 8 and 64 of these structures. | 1461 | 8 and 64 of these structures. |
1462 | -------------------------------------------------------------------- */ | 1462 | -------------------------------------------------------------------- */ |
1463 | 1463 | ||
1464 | bc = (struct board_chan *)(memaddr + CHANSTRUCT); | 1464 | bc = memaddr + CHANSTRUCT; |
1465 | 1465 | ||
1466 | /* ------------------------------------------------------------------- | 1466 | /* ------------------------------------------------------------------- |
1467 | The below assignment will set gd to point at the BEGINING of | 1467 | The below assignment will set gd to point at the BEGINING of |
@@ -1470,7 +1470,7 @@ static void post_fep_init(unsigned int crd) | |||
1470 | pointer begins at 0xd10. | 1470 | pointer begins at 0xd10. |
1471 | ---------------------------------------------------------------------- */ | 1471 | ---------------------------------------------------------------------- */ |
1472 | 1472 | ||
1473 | gd = (struct global_data *)(memaddr + GLOBAL); | 1473 | gd = memaddr + GLOBAL; |
1474 | 1474 | ||
1475 | /* -------------------------------------------------------------------- | 1475 | /* -------------------------------------------------------------------- |
1476 | XEPORTS (address 0xc22) points at the number of channels the | 1476 | XEPORTS (address 0xc22) points at the number of channels the |
@@ -1493,6 +1493,7 @@ static void post_fep_init(unsigned int crd) | |||
1493 | 1493 | ||
1494 | for (i = 0; i < bd->numports; i++, ch++, bc++) { /* Begin for each port */ | 1494 | for (i = 0; i < bd->numports; i++, ch++, bc++) { /* Begin for each port */ |
1495 | unsigned long flags; | 1495 | unsigned long flags; |
1496 | u16 tseg, rseg; | ||
1496 | 1497 | ||
1497 | ch->brdchan = bc; | 1498 | ch->brdchan = bc; |
1498 | ch->mailbox = gd; | 1499 | ch->mailbox = gd; |
@@ -1553,50 +1554,53 @@ static void post_fep_init(unsigned int crd) | |||
1553 | shrinkmem = 0; | 1554 | shrinkmem = 0; |
1554 | } | 1555 | } |
1555 | 1556 | ||
1557 | tseg = readw(&bc->tseg); | ||
1558 | rseg = readw(&bc->rseg); | ||
1559 | |||
1556 | switch (bd->type) { | 1560 | switch (bd->type) { |
1557 | 1561 | ||
1558 | case PCIXEM: | 1562 | case PCIXEM: |
1559 | case PCIXRJ: | 1563 | case PCIXRJ: |
1560 | case PCIXR: | 1564 | case PCIXR: |
1561 | /* Cover all the 2MEG cards */ | 1565 | /* Cover all the 2MEG cards */ |
1562 | ch->txptr = memaddr + (((bc->tseg) << 4) & 0x1fffff); | 1566 | ch->txptr = memaddr + ((tseg << 4) & 0x1fffff); |
1563 | ch->rxptr = memaddr + (((bc->rseg) << 4) & 0x1fffff); | 1567 | ch->rxptr = memaddr + ((rseg << 4) & 0x1fffff); |
1564 | ch->txwin = FEPWIN | ((bc->tseg) >> 11); | 1568 | ch->txwin = FEPWIN | (tseg >> 11); |
1565 | ch->rxwin = FEPWIN | ((bc->rseg) >> 11); | 1569 | ch->rxwin = FEPWIN | (rseg >> 11); |
1566 | break; | 1570 | break; |
1567 | 1571 | ||
1568 | case PCXEM: | 1572 | case PCXEM: |
1569 | case EISAXEM: | 1573 | case EISAXEM: |
1570 | /* Cover all the 32K windowed cards */ | 1574 | /* Cover all the 32K windowed cards */ |
1571 | /* Mask equal to window size - 1 */ | 1575 | /* Mask equal to window size - 1 */ |
1572 | ch->txptr = memaddr + (((bc->tseg) << 4) & 0x7fff); | 1576 | ch->txptr = memaddr + ((tseg << 4) & 0x7fff); |
1573 | ch->rxptr = memaddr + (((bc->rseg) << 4) & 0x7fff); | 1577 | ch->rxptr = memaddr + ((rseg << 4) & 0x7fff); |
1574 | ch->txwin = FEPWIN | ((bc->tseg) >> 11); | 1578 | ch->txwin = FEPWIN | (tseg >> 11); |
1575 | ch->rxwin = FEPWIN | ((bc->rseg) >> 11); | 1579 | ch->rxwin = FEPWIN | (rseg >> 11); |
1576 | break; | 1580 | break; |
1577 | 1581 | ||
1578 | case PCXEVE: | 1582 | case PCXEVE: |
1579 | case PCXE: | 1583 | case PCXE: |
1580 | ch->txptr = memaddr + (((bc->tseg - bd->memory_seg) << 4) & 0x1fff); | 1584 | ch->txptr = memaddr + (((tseg - bd->memory_seg) << 4) & 0x1fff); |
1581 | ch->txwin = FEPWIN | ((bc->tseg - bd->memory_seg) >> 9); | 1585 | ch->txwin = FEPWIN | ((tseg - bd->memory_seg) >> 9); |
1582 | ch->rxptr = memaddr + (((bc->rseg - bd->memory_seg) << 4) & 0x1fff); | 1586 | ch->rxptr = memaddr + (((rseg - bd->memory_seg) << 4) & 0x1fff); |
1583 | ch->rxwin = FEPWIN | ((bc->rseg - bd->memory_seg) >>9 ); | 1587 | ch->rxwin = FEPWIN | ((rseg - bd->memory_seg) >>9 ); |
1584 | break; | 1588 | break; |
1585 | 1589 | ||
1586 | case PCXI: | 1590 | case PCXI: |
1587 | case PC64XE: | 1591 | case PC64XE: |
1588 | ch->txptr = memaddr + ((bc->tseg - bd->memory_seg) << 4); | 1592 | ch->txptr = memaddr + ((tseg - bd->memory_seg) << 4); |
1589 | ch->rxptr = memaddr + ((bc->rseg - bd->memory_seg) << 4); | 1593 | ch->rxptr = memaddr + ((rseg - bd->memory_seg) << 4); |
1590 | ch->txwin = ch->rxwin = 0; | 1594 | ch->txwin = ch->rxwin = 0; |
1591 | break; | 1595 | break; |
1592 | 1596 | ||
1593 | } /* End switch bd->type */ | 1597 | } /* End switch bd->type */ |
1594 | 1598 | ||
1595 | ch->txbufhead = 0; | 1599 | ch->txbufhead = 0; |
1596 | ch->txbufsize = bc->tmax + 1; | 1600 | ch->txbufsize = readw(&bc->tmax) + 1; |
1597 | 1601 | ||
1598 | ch->rxbufhead = 0; | 1602 | ch->rxbufhead = 0; |
1599 | ch->rxbufsize = bc->rmax + 1; | 1603 | ch->rxbufsize = readw(&bc->rmax) + 1; |
1600 | 1604 | ||
1601 | lowwater = ch->txbufsize >= 2000 ? 1024 : (ch->txbufsize / 2); | 1605 | lowwater = ch->txbufsize >= 2000 ? 1024 : (ch->txbufsize / 2); |
1602 | 1606 | ||
@@ -1718,11 +1722,11 @@ static void epcapoll(unsigned long ignored) | |||
1718 | static void doevent(int crd) | 1722 | static void doevent(int crd) |
1719 | { /* Begin doevent */ | 1723 | { /* Begin doevent */ |
1720 | 1724 | ||
1721 | void *eventbuf; | 1725 | void __iomem *eventbuf; |
1722 | struct channel *ch, *chan0; | 1726 | struct channel *ch, *chan0; |
1723 | static struct tty_struct *tty; | 1727 | static struct tty_struct *tty; |
1724 | struct board_info *bd; | 1728 | struct board_info *bd; |
1725 | struct board_chan *bc; | 1729 | struct board_chan __iomem *bc; |
1726 | unsigned int tail, head; | 1730 | unsigned int tail, head; |
1727 | int event, channel; | 1731 | int event, channel; |
1728 | int mstat, lstat; | 1732 | int mstat, lstat; |
@@ -1817,7 +1821,7 @@ static void doevent(int crd) | |||
1817 | static void fepcmd(struct channel *ch, int cmd, int word_or_byte, | 1821 | static void fepcmd(struct channel *ch, int cmd, int word_or_byte, |
1818 | int byte2, int ncmds, int bytecmd) | 1822 | int byte2, int ncmds, int bytecmd) |
1819 | { /* Begin fepcmd */ | 1823 | { /* Begin fepcmd */ |
1820 | unchar *memaddr; | 1824 | unchar __iomem *memaddr; |
1821 | unsigned int head, cmdTail, cmdStart, cmdMax; | 1825 | unsigned int head, cmdTail, cmdStart, cmdMax; |
1822 | long count; | 1826 | long count; |
1823 | int n; | 1827 | int n; |
@@ -2000,7 +2004,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch) | |||
2000 | 2004 | ||
2001 | unsigned int cmdHead; | 2005 | unsigned int cmdHead; |
2002 | struct termios *ts; | 2006 | struct termios *ts; |
2003 | struct board_chan *bc; | 2007 | struct board_chan __iomem *bc; |
2004 | unsigned mval, hflow, cflag, iflag; | 2008 | unsigned mval, hflow, cflag, iflag; |
2005 | 2009 | ||
2006 | bc = ch->brdchan; | 2010 | bc = ch->brdchan; |
@@ -2010,7 +2014,7 @@ static void epcaparam(struct tty_struct *tty, struct channel *ch) | |||
2010 | ts = tty->termios; | 2014 | ts = tty->termios; |
2011 | if ((ts->c_cflag & CBAUD) == 0) { /* Begin CBAUD detected */ | 2015 | if ((ts->c_cflag & CBAUD) == 0) { /* Begin CBAUD detected */ |
2012 | cmdHead = readw(&bc->rin); | 2016 | cmdHead = readw(&bc->rin); |
2013 | bc->rout = cmdHead; | 2017 | writew(cmdHead, &bc->rout); |
2014 | cmdHead = readw(&bc->tin); | 2018 | cmdHead = readw(&bc->tin); |
2015 | /* Changing baud in mid-stream transmission can be wonderful */ | 2019 | /* Changing baud in mid-stream transmission can be wonderful */ |
2016 | /* --------------------------------------------------------------- | 2020 | /* --------------------------------------------------------------- |
@@ -2116,7 +2120,7 @@ static void receive_data(struct channel *ch) | |||
2116 | unchar *rptr; | 2120 | unchar *rptr; |
2117 | struct termios *ts = NULL; | 2121 | struct termios *ts = NULL; |
2118 | struct tty_struct *tty; | 2122 | struct tty_struct *tty; |
2119 | struct board_chan *bc; | 2123 | struct board_chan __iomem *bc; |
2120 | int dataToRead, wrapgap, bytesAvailable; | 2124 | int dataToRead, wrapgap, bytesAvailable; |
2121 | unsigned int tail, head; | 2125 | unsigned int tail, head; |
2122 | unsigned int wrapmask; | 2126 | unsigned int wrapmask; |
@@ -2154,7 +2158,7 @@ static void receive_data(struct channel *ch) | |||
2154 | --------------------------------------------------------------------- */ | 2158 | --------------------------------------------------------------------- */ |
2155 | 2159 | ||
2156 | if (!tty || !ts || !(ts->c_cflag & CREAD)) { | 2160 | if (!tty || !ts || !(ts->c_cflag & CREAD)) { |
2157 | bc->rout = head; | 2161 | writew(head, &bc->rout); |
2158 | return; | 2162 | return; |
2159 | } | 2163 | } |
2160 | 2164 | ||
@@ -2270,7 +2274,7 @@ static int info_ioctl(struct tty_struct *tty, struct file * file, | |||
2270 | static int pc_tiocmget(struct tty_struct *tty, struct file *file) | 2274 | static int pc_tiocmget(struct tty_struct *tty, struct file *file) |
2271 | { | 2275 | { |
2272 | struct channel *ch = (struct channel *) tty->driver_data; | 2276 | struct channel *ch = (struct channel *) tty->driver_data; |
2273 | struct board_chan *bc; | 2277 | struct board_chan __iomem *bc; |
2274 | unsigned int mstat, mflag = 0; | 2278 | unsigned int mstat, mflag = 0; |
2275 | unsigned long flags; | 2279 | unsigned long flags; |
2276 | 2280 | ||
@@ -2351,7 +2355,7 @@ static int pc_ioctl(struct tty_struct *tty, struct file * file, | |||
2351 | unsigned long flags; | 2355 | unsigned long flags; |
2352 | unsigned int mflag, mstat; | 2356 | unsigned int mflag, mstat; |
2353 | unsigned char startc, stopc; | 2357 | unsigned char startc, stopc; |
2354 | struct board_chan *bc; | 2358 | struct board_chan __iomem *bc; |
2355 | struct channel *ch = (struct channel *) tty->driver_data; | 2359 | struct channel *ch = (struct channel *) tty->driver_data; |
2356 | void __user *argp = (void __user *)arg; | 2360 | void __user *argp = (void __user *)arg; |
2357 | 2361 | ||
@@ -2633,7 +2637,7 @@ static void pc_start(struct tty_struct *tty) | |||
2633 | spin_lock_irqsave(&epca_lock, flags); | 2637 | spin_lock_irqsave(&epca_lock, flags); |
2634 | /* Just in case output was resumed because of a change in Digi-flow */ | 2638 | /* Just in case output was resumed because of a change in Digi-flow */ |
2635 | if (ch->statusflags & TXSTOPPED) { /* Begin transmit resume requested */ | 2639 | if (ch->statusflags & TXSTOPPED) { /* Begin transmit resume requested */ |
2636 | struct board_chan *bc; | 2640 | struct board_chan __iomem *bc; |
2637 | globalwinon(ch); | 2641 | globalwinon(ch); |
2638 | bc = ch->brdchan; | 2642 | bc = ch->brdchan; |
2639 | if (ch->statusflags & LOWWAIT) | 2643 | if (ch->statusflags & LOWWAIT) |
@@ -2727,7 +2731,7 @@ void digi_send_break(struct channel *ch, int msec) | |||
2727 | static void setup_empty_event(struct tty_struct *tty, struct channel *ch) | 2731 | static void setup_empty_event(struct tty_struct *tty, struct channel *ch) |
2728 | { /* Begin setup_empty_event */ | 2732 | { /* Begin setup_empty_event */ |
2729 | 2733 | ||
2730 | struct board_chan *bc = ch->brdchan; | 2734 | struct board_chan __iomem *bc = ch->brdchan; |
2731 | 2735 | ||
2732 | globalwinon(ch); | 2736 | globalwinon(ch); |
2733 | ch->statusflags |= EMPTYWAIT; | 2737 | ch->statusflags |= EMPTYWAIT; |
diff --git a/drivers/char/epca.h b/drivers/char/epca.h index 20eeb5a70e1a..456d6c8f94a8 100644 --- a/drivers/char/epca.h +++ b/drivers/char/epca.h | |||
@@ -128,17 +128,17 @@ struct channel | |||
128 | unsigned long c_cflag; | 128 | unsigned long c_cflag; |
129 | unsigned long c_lflag; | 129 | unsigned long c_lflag; |
130 | unsigned long c_oflag; | 130 | unsigned long c_oflag; |
131 | unsigned char *txptr; | 131 | unsigned char __iomem *txptr; |
132 | unsigned char *rxptr; | 132 | unsigned char __iomem *rxptr; |
133 | unsigned char *tmp_buf; | 133 | unsigned char *tmp_buf; |
134 | struct board_info *board; | 134 | struct board_info *board; |
135 | struct board_chan *brdchan; | 135 | struct board_chan __iomem *brdchan; |
136 | struct digi_struct digiext; | 136 | struct digi_struct digiext; |
137 | struct tty_struct *tty; | 137 | struct tty_struct *tty; |
138 | wait_queue_head_t open_wait; | 138 | wait_queue_head_t open_wait; |
139 | wait_queue_head_t close_wait; | 139 | wait_queue_head_t close_wait; |
140 | struct work_struct tqueue; | 140 | struct work_struct tqueue; |
141 | struct global_data *mailbox; | 141 | struct global_data __iomem *mailbox; |
142 | }; | 142 | }; |
143 | 143 | ||
144 | struct board_info | 144 | struct board_info |
@@ -149,8 +149,8 @@ struct board_info | |||
149 | unsigned short numports; | 149 | unsigned short numports; |
150 | unsigned long port; | 150 | unsigned long port; |
151 | unsigned long membase; | 151 | unsigned long membase; |
152 | unsigned char __iomem *re_map_port; | 152 | void __iomem *re_map_port; |
153 | unsigned char *re_map_membase; | 153 | void __iomem *re_map_membase; |
154 | unsigned long memory_seg; | 154 | unsigned long memory_seg; |
155 | void ( * memwinon ) (struct board_info *, unsigned int) ; | 155 | void ( * memwinon ) (struct board_info *, unsigned int) ; |
156 | void ( * memwinoff ) (struct board_info *, unsigned int) ; | 156 | void ( * memwinoff ) (struct board_info *, unsigned int) ; |
diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c index 3b865f34a095..b66782398258 100644 --- a/drivers/firmware/dell_rbu.c +++ b/drivers/firmware/dell_rbu.c | |||
@@ -50,7 +50,7 @@ | |||
50 | MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>"); | 50 | MODULE_AUTHOR("Abhay Salunke <abhay_salunke@dell.com>"); |
51 | MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems"); | 51 | MODULE_DESCRIPTION("Driver for updating BIOS image on DELL systems"); |
52 | MODULE_LICENSE("GPL"); | 52 | MODULE_LICENSE("GPL"); |
53 | MODULE_VERSION("1.0"); | 53 | MODULE_VERSION("2.0"); |
54 | 54 | ||
55 | #define BIOS_SCAN_LIMIT 0xffffffff | 55 | #define BIOS_SCAN_LIMIT 0xffffffff |
56 | #define MAX_IMAGE_LENGTH 16 | 56 | #define MAX_IMAGE_LENGTH 16 |
@@ -65,10 +65,11 @@ static struct _rbu_data { | |||
65 | unsigned long packet_write_count; | 65 | unsigned long packet_write_count; |
66 | unsigned long num_packets; | 66 | unsigned long num_packets; |
67 | unsigned long packetsize; | 67 | unsigned long packetsize; |
68 | int entry_created; | ||
68 | } rbu_data; | 69 | } rbu_data; |
69 | 70 | ||
70 | static char image_type[MAX_IMAGE_LENGTH] = "mono"; | 71 | static char image_type[MAX_IMAGE_LENGTH + 1] = "mono"; |
71 | module_param_string(image_type, image_type, sizeof(image_type), 0); | 72 | module_param_string(image_type, image_type, sizeof (image_type), 0); |
72 | MODULE_PARM_DESC(image_type, "BIOS image type. choose- mono or packet"); | 73 | MODULE_PARM_DESC(image_type, "BIOS image type. choose- mono or packet"); |
73 | 74 | ||
74 | struct packet_data { | 75 | struct packet_data { |
@@ -114,7 +115,7 @@ static int fill_last_packet(void *data, size_t length) | |||
114 | 115 | ||
115 | if ((rbu_data.packet_write_count + length) > rbu_data.packetsize) { | 116 | if ((rbu_data.packet_write_count + length) > rbu_data.packetsize) { |
116 | pr_debug("dell_rbu:%s: packet size data " | 117 | pr_debug("dell_rbu:%s: packet size data " |
117 | "overrun\n", __FUNCTION__); | 118 | "overrun\n", __FUNCTION__); |
118 | return -EINVAL; | 119 | return -EINVAL; |
119 | } | 120 | } |
120 | 121 | ||
@@ -146,12 +147,14 @@ static int create_packet(size_t length) | |||
146 | pr_debug("create_packet: packetsize not specified\n"); | 147 | pr_debug("create_packet: packetsize not specified\n"); |
147 | return -EINVAL; | 148 | return -EINVAL; |
148 | } | 149 | } |
150 | spin_unlock(&rbu_data.lock); | ||
151 | newpacket = kmalloc(sizeof (struct packet_data), GFP_KERNEL); | ||
152 | spin_lock(&rbu_data.lock); | ||
149 | 153 | ||
150 | newpacket = kmalloc(sizeof(struct packet_data), GFP_KERNEL); | ||
151 | if (!newpacket) { | 154 | if (!newpacket) { |
152 | printk(KERN_WARNING | 155 | printk(KERN_WARNING |
153 | "dell_rbu:%s: failed to allocate new " | 156 | "dell_rbu:%s: failed to allocate new " |
154 | "packet\n", __FUNCTION__); | 157 | "packet\n", __FUNCTION__); |
155 | return -ENOMEM; | 158 | return -ENOMEM; |
156 | } | 159 | } |
157 | 160 | ||
@@ -160,15 +163,17 @@ static int create_packet(size_t length) | |||
160 | * there is no upper limit on memory | 163 | * there is no upper limit on memory |
161 | * address for packetized mechanism | 164 | * address for packetized mechanism |
162 | */ | 165 | */ |
163 | newpacket->data = (unsigned char *)__get_free_pages(GFP_KERNEL, | 166 | spin_unlock(&rbu_data.lock); |
164 | ordernum); | 167 | newpacket->data = (unsigned char *) __get_free_pages(GFP_KERNEL, |
168 | ordernum); | ||
169 | spin_lock(&rbu_data.lock); | ||
165 | 170 | ||
166 | pr_debug("create_packet: newpacket %p\n", newpacket->data); | 171 | pr_debug("create_packet: newpacket %p\n", newpacket->data); |
167 | 172 | ||
168 | if (!newpacket->data) { | 173 | if (!newpacket->data) { |
169 | printk(KERN_WARNING | 174 | printk(KERN_WARNING |
170 | "dell_rbu:%s: failed to allocate new " | 175 | "dell_rbu:%s: failed to allocate new " |
171 | "packet\n", __FUNCTION__); | 176 | "packet\n", __FUNCTION__); |
172 | kfree(newpacket); | 177 | kfree(newpacket); |
173 | return -ENOMEM; | 178 | return -ENOMEM; |
174 | } | 179 | } |
@@ -204,9 +209,8 @@ static int packetize_data(void *data, size_t length) | |||
204 | return rc; | 209 | return rc; |
205 | } | 210 | } |
206 | 211 | ||
207 | static int | 212 | static int do_packet_read(char *data, struct list_head *ptemp_list, |
208 | do_packet_read(char *data, struct list_head *ptemp_list, | 213 | int length, int bytes_read, int *list_read_count) |
209 | int length, int bytes_read, int *list_read_count) | ||
210 | { | 214 | { |
211 | void *ptemp_buf; | 215 | void *ptemp_buf; |
212 | struct packet_data *newpacket = NULL; | 216 | struct packet_data *newpacket = NULL; |
@@ -239,7 +243,7 @@ do_packet_read(char *data, struct list_head *ptemp_list, | |||
239 | return bytes_copied; | 243 | return bytes_copied; |
240 | } | 244 | } |
241 | 245 | ||
242 | static int packet_read_list(char *data, size_t * pread_length) | 246 | static int packet_read_list(char *data, size_t *pread_length) |
243 | { | 247 | { |
244 | struct list_head *ptemp_list; | 248 | struct list_head *ptemp_list; |
245 | int temp_count = 0; | 249 | int temp_count = 0; |
@@ -258,8 +262,7 @@ static int packet_read_list(char *data, size_t * pread_length) | |||
258 | ptemp_list = (&packet_data_head.list)->next; | 262 | ptemp_list = (&packet_data_head.list)->next; |
259 | while (!list_empty(ptemp_list)) { | 263 | while (!list_empty(ptemp_list)) { |
260 | bytes_copied = do_packet_read(pdest, ptemp_list, | 264 | bytes_copied = do_packet_read(pdest, ptemp_list, |
261 | remaining_bytes, bytes_read, | 265 | remaining_bytes, bytes_read, &temp_count); |
262 | &temp_count); | ||
263 | remaining_bytes -= bytes_copied; | 266 | remaining_bytes -= bytes_copied; |
264 | bytes_read += bytes_copied; | 267 | bytes_read += bytes_copied; |
265 | pdest += bytes_copied; | 268 | pdest += bytes_copied; |
@@ -287,7 +290,7 @@ static void packet_empty_list(void) | |||
287 | ptemp_list = (&packet_data_head.list)->next; | 290 | ptemp_list = (&packet_data_head.list)->next; |
288 | while (!list_empty(ptemp_list)) { | 291 | while (!list_empty(ptemp_list)) { |
289 | newpacket = | 292 | newpacket = |
290 | list_entry(ptemp_list, struct packet_data, list); | 293 | list_entry(ptemp_list, struct packet_data, list); |
291 | pnext_list = ptemp_list->next; | 294 | pnext_list = ptemp_list->next; |
292 | list_del(ptemp_list); | 295 | list_del(ptemp_list); |
293 | ptemp_list = pnext_list; | 296 | ptemp_list = pnext_list; |
@@ -296,8 +299,8 @@ static void packet_empty_list(void) | |||
296 | * to make sure there are no stale RBU packets left in memory | 299 | * to make sure there are no stale RBU packets left in memory |
297 | */ | 300 | */ |
298 | memset(newpacket->data, 0, rbu_data.packetsize); | 301 | memset(newpacket->data, 0, rbu_data.packetsize); |
299 | free_pages((unsigned long)newpacket->data, | 302 | free_pages((unsigned long) newpacket->data, |
300 | newpacket->ordernum); | 303 | newpacket->ordernum); |
301 | kfree(newpacket); | 304 | kfree(newpacket); |
302 | } | 305 | } |
303 | rbu_data.packet_write_count = 0; | 306 | rbu_data.packet_write_count = 0; |
@@ -319,14 +322,13 @@ static void img_update_free(void) | |||
319 | * BIOS image copied in memory. | 322 | * BIOS image copied in memory. |
320 | */ | 323 | */ |
321 | memset(rbu_data.image_update_buffer, 0, | 324 | memset(rbu_data.image_update_buffer, 0, |
322 | rbu_data.image_update_buffer_size); | 325 | rbu_data.image_update_buffer_size); |
323 | if (rbu_data.dma_alloc == 1) | 326 | if (rbu_data.dma_alloc == 1) |
324 | dma_free_coherent(NULL, rbu_data.bios_image_size, | 327 | dma_free_coherent(NULL, rbu_data.bios_image_size, |
325 | rbu_data.image_update_buffer, | 328 | rbu_data.image_update_buffer, dell_rbu_dmaaddr); |
326 | dell_rbu_dmaaddr); | ||
327 | else | 329 | else |
328 | free_pages((unsigned long)rbu_data.image_update_buffer, | 330 | free_pages((unsigned long) rbu_data.image_update_buffer, |
329 | rbu_data.image_update_ordernum); | 331 | rbu_data.image_update_ordernum); |
330 | 332 | ||
331 | /* | 333 | /* |
332 | * Re-initialize the rbu_data variables after a free | 334 | * Re-initialize the rbu_data variables after a free |
@@ -366,7 +368,7 @@ static int img_update_realloc(unsigned long size) | |||
366 | */ | 368 | */ |
367 | if ((size != 0) && (rbu_data.image_update_buffer == NULL)) { | 369 | if ((size != 0) && (rbu_data.image_update_buffer == NULL)) { |
368 | printk(KERN_ERR "dell_rbu:%s: corruption " | 370 | printk(KERN_ERR "dell_rbu:%s: corruption " |
369 | "check failed\n", __FUNCTION__); | 371 | "check failed\n", __FUNCTION__); |
370 | return -EINVAL; | 372 | return -EINVAL; |
371 | } | 373 | } |
372 | /* | 374 | /* |
@@ -385,17 +387,16 @@ static int img_update_realloc(unsigned long size) | |||
385 | 387 | ||
386 | ordernum = get_order(size); | 388 | ordernum = get_order(size); |
387 | image_update_buffer = | 389 | image_update_buffer = |
388 | (unsigned char *)__get_free_pages(GFP_KERNEL, ordernum); | 390 | (unsigned char *) __get_free_pages(GFP_KERNEL, ordernum); |
389 | 391 | ||
390 | img_buf_phys_addr = | 392 | img_buf_phys_addr = |
391 | (unsigned long)virt_to_phys(image_update_buffer); | 393 | (unsigned long) virt_to_phys(image_update_buffer); |
392 | 394 | ||
393 | if (img_buf_phys_addr > BIOS_SCAN_LIMIT) { | 395 | if (img_buf_phys_addr > BIOS_SCAN_LIMIT) { |
394 | free_pages((unsigned long)image_update_buffer, ordernum); | 396 | free_pages((unsigned long) image_update_buffer, ordernum); |
395 | ordernum = -1; | 397 | ordernum = -1; |
396 | image_update_buffer = dma_alloc_coherent(NULL, size, | 398 | image_update_buffer = dma_alloc_coherent(NULL, size, |
397 | &dell_rbu_dmaaddr, | 399 | &dell_rbu_dmaaddr, GFP_KERNEL); |
398 | GFP_KERNEL); | ||
399 | dma_alloc = 1; | 400 | dma_alloc = 1; |
400 | } | 401 | } |
401 | 402 | ||
@@ -405,13 +406,13 @@ static int img_update_realloc(unsigned long size) | |||
405 | rbu_data.image_update_buffer = image_update_buffer; | 406 | rbu_data.image_update_buffer = image_update_buffer; |
406 | rbu_data.image_update_buffer_size = size; | 407 | rbu_data.image_update_buffer_size = size; |
407 | rbu_data.bios_image_size = | 408 | rbu_data.bios_image_size = |
408 | rbu_data.image_update_buffer_size; | 409 | rbu_data.image_update_buffer_size; |
409 | rbu_data.image_update_ordernum = ordernum; | 410 | rbu_data.image_update_ordernum = ordernum; |
410 | rbu_data.dma_alloc = dma_alloc; | 411 | rbu_data.dma_alloc = dma_alloc; |
411 | rc = 0; | 412 | rc = 0; |
412 | } else { | 413 | } else { |
413 | pr_debug("Not enough memory for image update:" | 414 | pr_debug("Not enough memory for image update:" |
414 | "size = %ld\n", size); | 415 | "size = %ld\n", size); |
415 | rc = -ENOMEM; | 416 | rc = -ENOMEM; |
416 | } | 417 | } |
417 | 418 | ||
@@ -438,7 +439,7 @@ static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count) | |||
438 | if (pos > imagesize) { | 439 | if (pos > imagesize) { |
439 | retval = 0; | 440 | retval = 0; |
440 | printk(KERN_WARNING "dell_rbu:read_packet_data: " | 441 | printk(KERN_WARNING "dell_rbu:read_packet_data: " |
441 | "data underrun\n"); | 442 | "data underrun\n"); |
442 | goto read_rbu_data_exit; | 443 | goto read_rbu_data_exit; |
443 | } | 444 | } |
444 | 445 | ||
@@ -468,11 +469,11 @@ static ssize_t read_rbu_mono_data(char *buffer, loff_t pos, size_t count) | |||
468 | 469 | ||
469 | /* check to see if we have something to return */ | 470 | /* check to see if we have something to return */ |
470 | if ((rbu_data.image_update_buffer == NULL) || | 471 | if ((rbu_data.image_update_buffer == NULL) || |
471 | (rbu_data.bios_image_size == 0)) { | 472 | (rbu_data.bios_image_size == 0)) { |
472 | pr_debug("read_rbu_data_mono: image_update_buffer %p ," | 473 | pr_debug("read_rbu_data_mono: image_update_buffer %p ," |
473 | "bios_image_size %lu\n", | 474 | "bios_image_size %lu\n", |
474 | rbu_data.image_update_buffer, | 475 | rbu_data.image_update_buffer, |
475 | rbu_data.bios_image_size); | 476 | rbu_data.bios_image_size); |
476 | ret_count = -ENOMEM; | 477 | ret_count = -ENOMEM; |
477 | goto read_rbu_data_exit; | 478 | goto read_rbu_data_exit; |
478 | } | 479 | } |
@@ -497,8 +498,8 @@ static ssize_t read_rbu_mono_data(char *buffer, loff_t pos, size_t count) | |||
497 | return ret_count; | 498 | return ret_count; |
498 | } | 499 | } |
499 | 500 | ||
500 | static ssize_t | 501 | static ssize_t read_rbu_data(struct kobject *kobj, char *buffer, |
501 | read_rbu_data(struct kobject *kobj, char *buffer, loff_t pos, size_t count) | 502 | loff_t pos, size_t count) |
502 | { | 503 | { |
503 | ssize_t ret_count = 0; | 504 | ssize_t ret_count = 0; |
504 | 505 | ||
@@ -515,62 +516,20 @@ read_rbu_data(struct kobject *kobj, char *buffer, loff_t pos, size_t count) | |||
515 | return ret_count; | 516 | return ret_count; |
516 | } | 517 | } |
517 | 518 | ||
518 | static ssize_t | ||
519 | read_rbu_image_type(struct kobject *kobj, char *buffer, loff_t pos, | ||
520 | size_t count) | ||
521 | { | ||
522 | int size = 0; | ||
523 | if (!pos) | ||
524 | size = sprintf(buffer, "%s\n", image_type); | ||
525 | return size; | ||
526 | } | ||
527 | |||
528 | static ssize_t | ||
529 | write_rbu_image_type(struct kobject *kobj, char *buffer, loff_t pos, | ||
530 | size_t count) | ||
531 | { | ||
532 | int rc = count; | ||
533 | spin_lock(&rbu_data.lock); | ||
534 | |||
535 | if (strlen(buffer) < MAX_IMAGE_LENGTH) | ||
536 | sscanf(buffer, "%s", image_type); | ||
537 | else | ||
538 | printk(KERN_WARNING "dell_rbu: image_type is invalid" | ||
539 | "max chars = %d, \n incoming str--%s-- \n", | ||
540 | MAX_IMAGE_LENGTH, buffer); | ||
541 | |||
542 | /* we must free all previous allocations */ | ||
543 | packet_empty_list(); | ||
544 | img_update_free(); | ||
545 | |||
546 | spin_unlock(&rbu_data.lock); | ||
547 | return rc; | ||
548 | |||
549 | } | ||
550 | |||
551 | static struct bin_attribute rbu_data_attr = { | ||
552 | .attr = {.name = "data",.owner = THIS_MODULE,.mode = 0444}, | ||
553 | .read = read_rbu_data, | ||
554 | }; | ||
555 | |||
556 | static struct bin_attribute rbu_image_type_attr = { | ||
557 | .attr = {.name = "image_type",.owner = THIS_MODULE,.mode = 0644}, | ||
558 | .read = read_rbu_image_type, | ||
559 | .write = write_rbu_image_type, | ||
560 | }; | ||
561 | |||
562 | static void callbackfn_rbu(const struct firmware *fw, void *context) | 519 | static void callbackfn_rbu(const struct firmware *fw, void *context) |
563 | { | 520 | { |
564 | int rc = 0; | 521 | int rc = 0; |
565 | 522 | ||
566 | if (!fw || !fw->size) | 523 | if (!fw || !fw->size) { |
524 | rbu_data.entry_created = 0; | ||
567 | return; | 525 | return; |
526 | } | ||
568 | 527 | ||
569 | spin_lock(&rbu_data.lock); | 528 | spin_lock(&rbu_data.lock); |
570 | if (!strcmp(image_type, "mono")) { | 529 | if (!strcmp(image_type, "mono")) { |
571 | if (!img_update_realloc(fw->size)) | 530 | if (!img_update_realloc(fw->size)) |
572 | memcpy(rbu_data.image_update_buffer, | 531 | memcpy(rbu_data.image_update_buffer, |
573 | fw->data, fw->size); | 532 | fw->data, fw->size); |
574 | } else if (!strcmp(image_type, "packet")) { | 533 | } else if (!strcmp(image_type, "packet")) { |
575 | if (!rbu_data.packetsize) | 534 | if (!rbu_data.packetsize) |
576 | rbu_data.packetsize = fw->size; | 535 | rbu_data.packetsize = fw->size; |
@@ -584,14 +543,103 @@ static void callbackfn_rbu(const struct firmware *fw, void *context) | |||
584 | spin_unlock(&rbu_data.lock); | 543 | spin_unlock(&rbu_data.lock); |
585 | 544 | ||
586 | rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, | 545 | rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, |
587 | "dell_rbu", &rbu_device->dev, | 546 | "dell_rbu", &rbu_device->dev, &context, callbackfn_rbu); |
588 | &context, callbackfn_rbu); | ||
589 | if (rc) | 547 | if (rc) |
590 | printk(KERN_ERR | 548 | printk(KERN_ERR |
591 | "dell_rbu:%s request_firmware_nowait failed" | 549 | "dell_rbu:%s request_firmware_nowait failed" |
592 | " %d\n", __FUNCTION__, rc); | 550 | " %d\n", __FUNCTION__, rc); |
551 | else | ||
552 | rbu_data.entry_created = 1; | ||
553 | } | ||
554 | |||
555 | static ssize_t read_rbu_image_type(struct kobject *kobj, char *buffer, | ||
556 | loff_t pos, size_t count) | ||
557 | { | ||
558 | int size = 0; | ||
559 | if (!pos) | ||
560 | size = sprintf(buffer, "%s\n", image_type); | ||
561 | return size; | ||
562 | } | ||
563 | |||
564 | static ssize_t write_rbu_image_type(struct kobject *kobj, char *buffer, | ||
565 | loff_t pos, size_t count) | ||
566 | { | ||
567 | int rc = count; | ||
568 | int req_firm_rc = 0; | ||
569 | int i; | ||
570 | spin_lock(&rbu_data.lock); | ||
571 | /* | ||
572 | * Find the first newline or space | ||
573 | */ | ||
574 | for (i = 0; i < count; ++i) | ||
575 | if (buffer[i] == '\n' || buffer[i] == ' ') { | ||
576 | buffer[i] = '\0'; | ||
577 | break; | ||
578 | } | ||
579 | if (i == count) | ||
580 | buffer[count] = '\0'; | ||
581 | |||
582 | if (strstr(buffer, "mono")) | ||
583 | strcpy(image_type, "mono"); | ||
584 | else if (strstr(buffer, "packet")) | ||
585 | strcpy(image_type, "packet"); | ||
586 | else if (strstr(buffer, "init")) { | ||
587 | /* | ||
588 | * If due to the user error the driver gets in a bad | ||
589 | * state where even though it is loaded , the | ||
590 | * /sys/class/firmware/dell_rbu entries are missing. | ||
591 | * to cover this situation the user can recreate entries | ||
592 | * by writing init to image_type. | ||
593 | */ | ||
594 | if (!rbu_data.entry_created) { | ||
595 | spin_unlock(&rbu_data.lock); | ||
596 | req_firm_rc = request_firmware_nowait(THIS_MODULE, | ||
597 | FW_ACTION_NOHOTPLUG, "dell_rbu", | ||
598 | &rbu_device->dev, &context, | ||
599 | callbackfn_rbu); | ||
600 | if (req_firm_rc) { | ||
601 | printk(KERN_ERR | ||
602 | "dell_rbu:%s request_firmware_nowait" | ||
603 | " failed %d\n", __FUNCTION__, rc); | ||
604 | rc = -EIO; | ||
605 | } else | ||
606 | rbu_data.entry_created = 1; | ||
607 | |||
608 | spin_lock(&rbu_data.lock); | ||
609 | } | ||
610 | } else { | ||
611 | printk(KERN_WARNING "dell_rbu: image_type is invalid\n"); | ||
612 | spin_unlock(&rbu_data.lock); | ||
613 | return -EINVAL; | ||
614 | } | ||
615 | |||
616 | /* we must free all previous allocations */ | ||
617 | packet_empty_list(); | ||
618 | img_update_free(); | ||
619 | spin_unlock(&rbu_data.lock); | ||
620 | |||
621 | return rc; | ||
593 | } | 622 | } |
594 | 623 | ||
624 | static struct bin_attribute rbu_data_attr = { | ||
625 | .attr = { | ||
626 | .name = "data", | ||
627 | .owner = THIS_MODULE, | ||
628 | .mode = 0444, | ||
629 | }, | ||
630 | .read = read_rbu_data, | ||
631 | }; | ||
632 | |||
633 | static struct bin_attribute rbu_image_type_attr = { | ||
634 | .attr = { | ||
635 | .name = "image_type", | ||
636 | .owner = THIS_MODULE, | ||
637 | .mode = 0644, | ||
638 | }, | ||
639 | .read = read_rbu_image_type, | ||
640 | .write = write_rbu_image_type, | ||
641 | }; | ||
642 | |||
595 | static int __init dcdrbu_init(void) | 643 | static int __init dcdrbu_init(void) |
596 | { | 644 | { |
597 | int rc = 0; | 645 | int rc = 0; |
@@ -599,11 +647,11 @@ static int __init dcdrbu_init(void) | |||
599 | 647 | ||
600 | init_packet_head(); | 648 | init_packet_head(); |
601 | rbu_device = | 649 | rbu_device = |
602 | platform_device_register_simple("dell_rbu", -1, NULL, 0); | 650 | platform_device_register_simple("dell_rbu", -1, NULL, 0); |
603 | if (!rbu_device) { | 651 | if (!rbu_device) { |
604 | printk(KERN_ERR | 652 | printk(KERN_ERR |
605 | "dell_rbu:%s:platform_device_register_simple " | 653 | "dell_rbu:%s:platform_device_register_simple " |
606 | "failed\n", __FUNCTION__); | 654 | "failed\n", __FUNCTION__); |
607 | return -EIO; | 655 | return -EIO; |
608 | } | 656 | } |
609 | 657 | ||
@@ -611,11 +659,12 @@ static int __init dcdrbu_init(void) | |||
611 | sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr); | 659 | sysfs_create_bin_file(&rbu_device->dev.kobj, &rbu_image_type_attr); |
612 | 660 | ||
613 | rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, | 661 | rc = request_firmware_nowait(THIS_MODULE, FW_ACTION_NOHOTPLUG, |
614 | "dell_rbu", &rbu_device->dev, | 662 | "dell_rbu", &rbu_device->dev, &context, callbackfn_rbu); |
615 | &context, callbackfn_rbu); | ||
616 | if (rc) | 663 | if (rc) |
617 | printk(KERN_ERR "dell_rbu:%s:request_firmware_nowait" | 664 | printk(KERN_ERR "dell_rbu:%s:request_firmware_nowait" |
618 | " failed %d\n", __FUNCTION__, rc); | 665 | " failed %d\n", __FUNCTION__, rc); |
666 | else | ||
667 | rbu_data.entry_created = 1; | ||
619 | 668 | ||
620 | return rc; | 669 | return rc; |
621 | 670 | ||
diff --git a/drivers/hwmon/hdaps.c b/drivers/hwmon/hdaps.c index eaebfc14c933..4c56411f3993 100644 --- a/drivers/hwmon/hdaps.c +++ b/drivers/hwmon/hdaps.c | |||
@@ -5,10 +5,10 @@ | |||
5 | * Copyright (C) 2005 Jesper Juhl <jesper.juhl@gmail.com> | 5 | * Copyright (C) 2005 Jesper Juhl <jesper.juhl@gmail.com> |
6 | * | 6 | * |
7 | * The HardDisk Active Protection System (hdaps) is present in the IBM ThinkPad | 7 | * The HardDisk Active Protection System (hdaps) is present in the IBM ThinkPad |
8 | * T41, T42, T43, R51, and X40, at least. It provides a basic two-axis | 8 | * T41, T42, T43, R50, R50p, R51, and X40, at least. It provides a basic |
9 | * accelerometer and other data, such as the device's temperature. | 9 | * two-axis accelerometer and other data, such as the device's temperature. |
10 | * | 10 | * |
11 | * Based on the document by Mark A. Smith available at | 11 | * This driver is based on the document by Mark A. Smith available at |
12 | * http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html and a lot of trial | 12 | * http://www.almaden.ibm.com/cs/people/marksmith/tpaps.html and a lot of trial |
13 | * and error. | 13 | * and error. |
14 | * | 14 | * |
@@ -36,12 +36,7 @@ | |||
36 | #include <asm/io.h> | 36 | #include <asm/io.h> |
37 | 37 | ||
38 | #define HDAPS_LOW_PORT 0x1600 /* first port used by hdaps */ | 38 | #define HDAPS_LOW_PORT 0x1600 /* first port used by hdaps */ |
39 | #define HDAPS_NR_PORTS 0x30 /* 0x1600 - 0x162f */ | 39 | #define HDAPS_NR_PORTS 0x30 /* number of ports: 0x1600 - 0x162f */ |
40 | |||
41 | #define STATE_FRESH 0x50 /* accelerometer data is fresh */ | ||
42 | |||
43 | #define REFRESH_ASYNC 0x00 /* do asynchronous refresh */ | ||
44 | #define REFRESH_SYNC 0x01 /* do synchronous refresh */ | ||
45 | 40 | ||
46 | #define HDAPS_PORT_STATE 0x1611 /* device state */ | 41 | #define HDAPS_PORT_STATE 0x1611 /* device state */ |
47 | #define HDAPS_PORT_YPOS 0x1612 /* y-axis position */ | 42 | #define HDAPS_PORT_YPOS 0x1612 /* y-axis position */ |
@@ -53,7 +48,7 @@ | |||
53 | #define HDAPS_PORT_UNKNOWN 0x161c /* what is this? */ | 48 | #define HDAPS_PORT_UNKNOWN 0x161c /* what is this? */ |
54 | #define HDAPS_PORT_KMACT 0x161d /* keyboard or mouse activity */ | 49 | #define HDAPS_PORT_KMACT 0x161d /* keyboard or mouse activity */ |
55 | 50 | ||
56 | #define HDAPS_READ_MASK 0xff /* some reads have the low 8 bits set */ | 51 | #define STATE_FRESH 0x50 /* accelerometer data is fresh */ |
57 | 52 | ||
58 | #define KEYBD_MASK 0x20 /* set if keyboard activity */ | 53 | #define KEYBD_MASK 0x20 /* set if keyboard activity */ |
59 | #define MOUSE_MASK 0x40 /* set if mouse activity */ | 54 | #define MOUSE_MASK 0x40 /* set if mouse activity */ |
@@ -63,12 +58,11 @@ | |||
63 | #define INIT_TIMEOUT_MSECS 4000 /* wait up to 4s for device init ... */ | 58 | #define INIT_TIMEOUT_MSECS 4000 /* wait up to 4s for device init ... */ |
64 | #define INIT_WAIT_MSECS 200 /* ... in 200ms increments */ | 59 | #define INIT_WAIT_MSECS 200 /* ... in 200ms increments */ |
65 | 60 | ||
66 | static struct platform_device *pdev; | 61 | #define HDAPS_POLL_PERIOD (HZ/20) /* poll for input every 1/20s */ |
67 | static struct input_dev hdaps_idev; | 62 | #define HDAPS_INPUT_FUZZ 4 /* input event threshold */ |
63 | |||
68 | static struct timer_list hdaps_timer; | 64 | static struct timer_list hdaps_timer; |
69 | static unsigned int hdaps_mousedev_threshold = 4; | 65 | static struct platform_device *pdev; |
70 | static unsigned long hdaps_poll_ms = 50; | ||
71 | static unsigned int hdaps_mousedev; | ||
72 | static unsigned int hdaps_invert; | 66 | static unsigned int hdaps_invert; |
73 | static u8 km_activity; | 67 | static u8 km_activity; |
74 | static int rest_x; | 68 | static int rest_x; |
@@ -81,14 +75,14 @@ static DECLARE_MUTEX(hdaps_sem); | |||
81 | */ | 75 | */ |
82 | static inline u8 __get_latch(u16 port) | 76 | static inline u8 __get_latch(u16 port) |
83 | { | 77 | { |
84 | return inb(port) & HDAPS_READ_MASK; | 78 | return inb(port) & 0xff; |
85 | } | 79 | } |
86 | 80 | ||
87 | /* | 81 | /* |
88 | * __check_latch - Check a port latch for a given value. Callers must hold | 82 | * __check_latch - Check a port latch for a given value. Returns zero if the |
89 | * hdaps_sem. Returns zero if the port contains the given value. | 83 | * port contains the given value. Callers must hold hdaps_sem. |
90 | */ | 84 | */ |
91 | static inline unsigned int __check_latch(u16 port, u8 val) | 85 | static inline int __check_latch(u16 port, u8 val) |
92 | { | 86 | { |
93 | if (__get_latch(port) == val) | 87 | if (__get_latch(port) == val) |
94 | return 0; | 88 | return 0; |
@@ -99,7 +93,7 @@ static inline unsigned int __check_latch(u16 port, u8 val) | |||
99 | * __wait_latch - Wait up to 100us for a port latch to get a certain value, | 93 | * __wait_latch - Wait up to 100us for a port latch to get a certain value, |
100 | * returning zero if the value is obtained. Callers must hold hdaps_sem. | 94 | * returning zero if the value is obtained. Callers must hold hdaps_sem. |
101 | */ | 95 | */ |
102 | static unsigned int __wait_latch(u16 port, u8 val) | 96 | static int __wait_latch(u16 port, u8 val) |
103 | { | 97 | { |
104 | unsigned int i; | 98 | unsigned int i; |
105 | 99 | ||
@@ -109,59 +103,42 @@ static unsigned int __wait_latch(u16 port, u8 val) | |||
109 | udelay(5); | 103 | udelay(5); |
110 | } | 104 | } |
111 | 105 | ||
112 | return -EINVAL; | 106 | return -EIO; |
113 | } | 107 | } |
114 | 108 | ||
115 | /* | 109 | /* |
116 | * __device_refresh - Request a refresh from the accelerometer. | 110 | * __device_refresh - request a refresh from the accelerometer. Does not wait |
117 | * | 111 | * for refresh to complete. Callers must hold hdaps_sem. |
118 | * If sync is REFRESH_SYNC, we perform a synchronous refresh and will wait. | ||
119 | * Returns zero if successful and nonzero on error. | ||
120 | * | ||
121 | * If sync is REFRESH_ASYNC, we merely kick off a new refresh if the device is | ||
122 | * not up-to-date. Always returns zero. | ||
123 | * | ||
124 | * Callers must hold hdaps_sem. | ||
125 | */ | 112 | */ |
126 | static int __device_refresh(unsigned int sync) | 113 | static void __device_refresh(void) |
127 | { | 114 | { |
128 | u8 state; | 115 | udelay(200); |
129 | 116 | if (inb(0x1604) != STATE_FRESH) { | |
130 | udelay(100); | 117 | outb(0x11, 0x1610); |
131 | 118 | outb(0x01, 0x161f); | |
132 | state = inb(0x1604); | 119 | } |
133 | if (state == STATE_FRESH) | 120 | } |
134 | return 0; | ||
135 | |||
136 | outb(0x11, 0x1610); | ||
137 | outb(0x01, 0x161f); | ||
138 | if (sync == REFRESH_ASYNC) | ||
139 | return 0; | ||
140 | 121 | ||
122 | /* | ||
123 | * __device_refresh_sync - request a synchronous refresh from the | ||
124 | * accelerometer. We wait for the refresh to complete. Returns zero if | ||
125 | * successful and nonzero on error. Callers must hold hdaps_sem. | ||
126 | */ | ||
127 | static int __device_refresh_sync(void) | ||
128 | { | ||
129 | __device_refresh(); | ||
141 | return __wait_latch(0x1604, STATE_FRESH); | 130 | return __wait_latch(0x1604, STATE_FRESH); |
142 | } | 131 | } |
143 | 132 | ||
144 | /* | 133 | /* |
145 | * __device_complete - Indicate to the accelerometer that we are done reading | 134 | * __device_complete - indicate to the accelerometer that we are done reading |
146 | * data, and then initiate an async refresh. Callers must hold hdaps_sem. | 135 | * data, and then initiate an async refresh. Callers must hold hdaps_sem. |
147 | */ | 136 | */ |
148 | static inline void __device_complete(void) | 137 | static inline void __device_complete(void) |
149 | { | 138 | { |
150 | inb(0x161f); | 139 | inb(0x161f); |
151 | inb(0x1604); | 140 | inb(0x1604); |
152 | __device_refresh(REFRESH_ASYNC); | 141 | __device_refresh(); |
153 | } | ||
154 | |||
155 | static int __hdaps_readb_one(unsigned int port, u8 *val) | ||
156 | { | ||
157 | /* do a sync refresh -- we need to be sure that we read fresh data */ | ||
158 | if (__device_refresh(REFRESH_SYNC)) | ||
159 | return -EIO; | ||
160 | |||
161 | *val = inb(port); | ||
162 | __device_complete(); | ||
163 | |||
164 | return 0; | ||
165 | } | 142 | } |
166 | 143 | ||
167 | /* | 144 | /* |
@@ -174,17 +151,26 @@ static int hdaps_readb_one(unsigned int port, u8 *val) | |||
174 | int ret; | 151 | int ret; |
175 | 152 | ||
176 | down(&hdaps_sem); | 153 | down(&hdaps_sem); |
177 | ret = __hdaps_readb_one(port, val); | ||
178 | up(&hdaps_sem); | ||
179 | 154 | ||
155 | /* do a sync refresh -- we need to be sure that we read fresh data */ | ||
156 | ret = __device_refresh_sync(); | ||
157 | if (ret) | ||
158 | goto out; | ||
159 | |||
160 | *val = inb(port); | ||
161 | __device_complete(); | ||
162 | |||
163 | out: | ||
164 | up(&hdaps_sem); | ||
180 | return ret; | 165 | return ret; |
181 | } | 166 | } |
182 | 167 | ||
168 | /* __hdaps_read_pair - internal lockless helper for hdaps_read_pair(). */ | ||
183 | static int __hdaps_read_pair(unsigned int port1, unsigned int port2, | 169 | static int __hdaps_read_pair(unsigned int port1, unsigned int port2, |
184 | int *x, int *y) | 170 | int *x, int *y) |
185 | { | 171 | { |
186 | /* do a sync refresh -- we need to be sure that we read fresh data */ | 172 | /* do a sync refresh -- we need to be sure that we read fresh data */ |
187 | if (__device_refresh(REFRESH_SYNC)) | 173 | if (__device_refresh_sync()) |
188 | return -EIO; | 174 | return -EIO; |
189 | 175 | ||
190 | *y = inw(port2); | 176 | *y = inw(port2); |
@@ -217,11 +203,13 @@ static int hdaps_read_pair(unsigned int port1, unsigned int port2, | |||
217 | return ret; | 203 | return ret; |
218 | } | 204 | } |
219 | 205 | ||
220 | /* initialize the accelerometer */ | 206 | /* |
207 | * hdaps_device_init - initialize the accelerometer. Returns zero on success | ||
208 | * and negative error code on failure. Can sleep. | ||
209 | */ | ||
221 | static int hdaps_device_init(void) | 210 | static int hdaps_device_init(void) |
222 | { | 211 | { |
223 | unsigned int total_msecs = INIT_TIMEOUT_MSECS; | 212 | int total, ret = -ENXIO; |
224 | int ret = -ENXIO; | ||
225 | 213 | ||
226 | down(&hdaps_sem); | 214 | down(&hdaps_sem); |
227 | 215 | ||
@@ -231,8 +219,10 @@ static int hdaps_device_init(void) | |||
231 | goto out; | 219 | goto out; |
232 | 220 | ||
233 | /* | 221 | /* |
234 | * The 0x03 value appears to only work on some thinkpads, such as the | 222 | * Most ThinkPads return 0x01. |
235 | * T42p. Others return 0x01. | 223 | * |
224 | * Others--namely the R50p, T41p, and T42p--return 0x03. These laptops | ||
225 | * have "inverted" axises. | ||
236 | * | 226 | * |
237 | * The 0x02 value occurs when the chip has been previously initialized. | 227 | * The 0x02 value occurs when the chip has been previously initialized. |
238 | */ | 228 | */ |
@@ -267,24 +257,23 @@ static int hdaps_device_init(void) | |||
267 | outb(0x01, 0x161f); | 257 | outb(0x01, 0x161f); |
268 | if (__wait_latch(0x161f, 0x00)) | 258 | if (__wait_latch(0x161f, 0x00)) |
269 | goto out; | 259 | goto out; |
270 | if (__device_refresh(REFRESH_SYNC)) | 260 | if (__device_refresh_sync()) |
271 | goto out; | 261 | goto out; |
272 | if (__wait_latch(0x1611, 0x00)) | 262 | if (__wait_latch(0x1611, 0x00)) |
273 | goto out; | 263 | goto out; |
274 | 264 | ||
275 | /* we have done our dance, now let's wait for the applause */ | 265 | /* we have done our dance, now let's wait for the applause */ |
276 | while (total_msecs > 0) { | 266 | for (total = INIT_TIMEOUT_MSECS; total > 0; total -= INIT_WAIT_MSECS) { |
277 | u8 ignored; | 267 | int x, y; |
278 | 268 | ||
279 | /* a read of the device helps push it into action */ | 269 | /* a read of the device helps push it into action */ |
280 | __hdaps_readb_one(HDAPS_PORT_UNKNOWN, &ignored); | 270 | __hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &x, &y); |
281 | if (!__wait_latch(0x1611, 0x02)) { | 271 | if (!__wait_latch(0x1611, 0x02)) { |
282 | ret = 0; | 272 | ret = 0; |
283 | break; | 273 | break; |
284 | } | 274 | } |
285 | 275 | ||
286 | msleep(INIT_WAIT_MSECS); | 276 | msleep(INIT_WAIT_MSECS); |
287 | total_msecs -= INIT_WAIT_MSECS; | ||
288 | } | 277 | } |
289 | 278 | ||
290 | out: | 279 | out: |
@@ -293,96 +282,6 @@ out: | |||
293 | } | 282 | } |
294 | 283 | ||
295 | 284 | ||
296 | /* Input class stuff */ | ||
297 | |||
298 | /* | ||
299 | * hdaps_calibrate - Zero out our "resting" values. Callers must hold hdaps_sem. | ||
300 | */ | ||
301 | static void hdaps_calibrate(void) | ||
302 | { | ||
303 | int x, y; | ||
304 | |||
305 | if (__hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &x, &y)) | ||
306 | return; | ||
307 | |||
308 | rest_x = x; | ||
309 | rest_y = y; | ||
310 | } | ||
311 | |||
312 | static void hdaps_mousedev_poll(unsigned long unused) | ||
313 | { | ||
314 | int x, y; | ||
315 | |||
316 | /* Cannot sleep. Try nonblockingly. If we fail, try again later. */ | ||
317 | if (down_trylock(&hdaps_sem)) { | ||
318 | mod_timer(&hdaps_timer,jiffies+msecs_to_jiffies(hdaps_poll_ms)); | ||
319 | return; | ||
320 | } | ||
321 | |||
322 | if (__hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &x, &y)) | ||
323 | goto out; | ||
324 | |||
325 | x -= rest_x; | ||
326 | y -= rest_y; | ||
327 | if (abs(x) > hdaps_mousedev_threshold) | ||
328 | input_report_rel(&hdaps_idev, REL_X, x); | ||
329 | if (abs(y) > hdaps_mousedev_threshold) | ||
330 | input_report_rel(&hdaps_idev, REL_Y, y); | ||
331 | input_sync(&hdaps_idev); | ||
332 | |||
333 | mod_timer(&hdaps_timer, jiffies + msecs_to_jiffies(hdaps_poll_ms)); | ||
334 | |||
335 | out: | ||
336 | up(&hdaps_sem); | ||
337 | } | ||
338 | |||
339 | /* | ||
340 | * hdaps_mousedev_enable - enable the input class device. Can sleep. | ||
341 | */ | ||
342 | static void hdaps_mousedev_enable(void) | ||
343 | { | ||
344 | down(&hdaps_sem); | ||
345 | |||
346 | /* calibrate the device before enabling */ | ||
347 | hdaps_calibrate(); | ||
348 | |||
349 | /* initialize the input class */ | ||
350 | init_input_dev(&hdaps_idev); | ||
351 | hdaps_idev.dev = &pdev->dev; | ||
352 | hdaps_idev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL); | ||
353 | hdaps_idev.relbit[0] = BIT(REL_X) | BIT(REL_Y); | ||
354 | hdaps_idev.keybit[LONG(BTN_LEFT)] = BIT(BTN_LEFT); | ||
355 | input_register_device(&hdaps_idev); | ||
356 | |||
357 | /* start up our timer */ | ||
358 | init_timer(&hdaps_timer); | ||
359 | hdaps_timer.function = hdaps_mousedev_poll; | ||
360 | hdaps_timer.expires = jiffies + msecs_to_jiffies(hdaps_poll_ms); | ||
361 | add_timer(&hdaps_timer); | ||
362 | |||
363 | hdaps_mousedev = 1; | ||
364 | |||
365 | up(&hdaps_sem); | ||
366 | |||
367 | printk(KERN_INFO "hdaps: input device enabled.\n"); | ||
368 | } | ||
369 | |||
370 | /* | ||
371 | * hdaps_mousedev_disable - disable the input class device. Caller must hold | ||
372 | * hdaps_sem. | ||
373 | */ | ||
374 | static void hdaps_mousedev_disable(void) | ||
375 | { | ||
376 | down(&hdaps_sem); | ||
377 | if (hdaps_mousedev) { | ||
378 | hdaps_mousedev = 0; | ||
379 | del_timer_sync(&hdaps_timer); | ||
380 | input_unregister_device(&hdaps_idev); | ||
381 | } | ||
382 | up(&hdaps_sem); | ||
383 | } | ||
384 | |||
385 | |||
386 | /* Device model stuff */ | 285 | /* Device model stuff */ |
387 | 286 | ||
388 | static int hdaps_probe(struct device *dev) | 287 | static int hdaps_probe(struct device *dev) |
@@ -412,6 +311,49 @@ static struct device_driver hdaps_driver = { | |||
412 | .resume = hdaps_resume | 311 | .resume = hdaps_resume |
413 | }; | 312 | }; |
414 | 313 | ||
314 | /* Input class stuff */ | ||
315 | |||
316 | static struct input_dev hdaps_idev = { | ||
317 | .name = "hdaps", | ||
318 | .evbit = { BIT(EV_ABS) }, | ||
319 | .absbit = { BIT(ABS_X) | BIT(ABS_Y) }, | ||
320 | .absmin = { [ABS_X] = -256, [ABS_Y] = -256 }, | ||
321 | .absmax = { [ABS_X] = 256, [ABS_Y] = 256 }, | ||
322 | .absfuzz = { [ABS_X] = HDAPS_INPUT_FUZZ, [ABS_Y] = HDAPS_INPUT_FUZZ }, | ||
323 | .absflat = { [ABS_X] = HDAPS_INPUT_FUZZ, [ABS_Y] = HDAPS_INPUT_FUZZ }, | ||
324 | }; | ||
325 | |||
326 | /* | ||
327 | * hdaps_calibrate - Set our "resting" values. Callers must hold hdaps_sem. | ||
328 | */ | ||
329 | static void hdaps_calibrate(void) | ||
330 | { | ||
331 | __hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &rest_x, &rest_y); | ||
332 | } | ||
333 | |||
334 | static void hdaps_mousedev_poll(unsigned long unused) | ||
335 | { | ||
336 | int x, y; | ||
337 | |||
338 | /* Cannot sleep. Try nonblockingly. If we fail, try again later. */ | ||
339 | if (down_trylock(&hdaps_sem)) { | ||
340 | mod_timer(&hdaps_timer,jiffies + HDAPS_POLL_PERIOD); | ||
341 | return; | ||
342 | } | ||
343 | |||
344 | if (__hdaps_read_pair(HDAPS_PORT_XPOS, HDAPS_PORT_YPOS, &x, &y)) | ||
345 | goto out; | ||
346 | |||
347 | input_report_abs(&hdaps_idev, ABS_X, x - rest_x); | ||
348 | input_report_abs(&hdaps_idev, ABS_Y, y - rest_y); | ||
349 | input_sync(&hdaps_idev); | ||
350 | |||
351 | mod_timer(&hdaps_timer, jiffies + HDAPS_POLL_PERIOD); | ||
352 | |||
353 | out: | ||
354 | up(&hdaps_sem); | ||
355 | } | ||
356 | |||
415 | 357 | ||
416 | /* Sysfs Files */ | 358 | /* Sysfs Files */ |
417 | 359 | ||
@@ -517,69 +459,6 @@ static ssize_t hdaps_invert_store(struct device *dev, | |||
517 | return count; | 459 | return count; |
518 | } | 460 | } |
519 | 461 | ||
520 | static ssize_t hdaps_mousedev_show(struct device *dev, | ||
521 | struct device_attribute *attr, char *buf) | ||
522 | { | ||
523 | return sprintf(buf, "%d\n", hdaps_mousedev); | ||
524 | } | ||
525 | |||
526 | static ssize_t hdaps_mousedev_store(struct device *dev, | ||
527 | struct device_attribute *attr, | ||
528 | const char *buf, size_t count) | ||
529 | { | ||
530 | int enable; | ||
531 | |||
532 | if (sscanf(buf, "%d", &enable) != 1) | ||
533 | return -EINVAL; | ||
534 | |||
535 | if (enable == 1) | ||
536 | hdaps_mousedev_enable(); | ||
537 | else if (enable == 0) | ||
538 | hdaps_mousedev_disable(); | ||
539 | else | ||
540 | return -EINVAL; | ||
541 | |||
542 | return count; | ||
543 | } | ||
544 | |||
545 | static ssize_t hdaps_poll_show(struct device *dev, | ||
546 | struct device_attribute *attr, char *buf) | ||
547 | { | ||
548 | return sprintf(buf, "%lu\n", hdaps_poll_ms); | ||
549 | } | ||
550 | |||
551 | static ssize_t hdaps_poll_store(struct device *dev, | ||
552 | struct device_attribute *attr, | ||
553 | const char *buf, size_t count) | ||
554 | { | ||
555 | unsigned int poll; | ||
556 | |||
557 | if (sscanf(buf, "%u", &poll) != 1 || poll == 0) | ||
558 | return -EINVAL; | ||
559 | hdaps_poll_ms = poll; | ||
560 | |||
561 | return count; | ||
562 | } | ||
563 | |||
564 | static ssize_t hdaps_threshold_show(struct device *dev, | ||
565 | struct device_attribute *attr, char *buf) | ||
566 | { | ||
567 | return sprintf(buf, "%u\n", hdaps_mousedev_threshold); | ||
568 | } | ||
569 | |||
570 | static ssize_t hdaps_threshold_store(struct device *dev, | ||
571 | struct device_attribute *attr, | ||
572 | const char *buf, size_t count) | ||
573 | { | ||
574 | unsigned int threshold; | ||
575 | |||
576 | if (sscanf(buf, "%u", &threshold) != 1 || threshold == 0) | ||
577 | return -EINVAL; | ||
578 | hdaps_mousedev_threshold = threshold; | ||
579 | |||
580 | return count; | ||
581 | } | ||
582 | |||
583 | static DEVICE_ATTR(position, 0444, hdaps_position_show, NULL); | 462 | static DEVICE_ATTR(position, 0444, hdaps_position_show, NULL); |
584 | static DEVICE_ATTR(variance, 0444, hdaps_variance_show, NULL); | 463 | static DEVICE_ATTR(variance, 0444, hdaps_variance_show, NULL); |
585 | static DEVICE_ATTR(temp1, 0444, hdaps_temp1_show, NULL); | 464 | static DEVICE_ATTR(temp1, 0444, hdaps_temp1_show, NULL); |
@@ -588,10 +467,6 @@ static DEVICE_ATTR(keyboard_activity, 0444, hdaps_keyboard_activity_show, NULL); | |||
588 | static DEVICE_ATTR(mouse_activity, 0444, hdaps_mouse_activity_show, NULL); | 467 | static DEVICE_ATTR(mouse_activity, 0444, hdaps_mouse_activity_show, NULL); |
589 | static DEVICE_ATTR(calibrate, 0644, hdaps_calibrate_show,hdaps_calibrate_store); | 468 | static DEVICE_ATTR(calibrate, 0644, hdaps_calibrate_show,hdaps_calibrate_store); |
590 | static DEVICE_ATTR(invert, 0644, hdaps_invert_show, hdaps_invert_store); | 469 | static DEVICE_ATTR(invert, 0644, hdaps_invert_show, hdaps_invert_store); |
591 | static DEVICE_ATTR(mousedev, 0644, hdaps_mousedev_show, hdaps_mousedev_store); | ||
592 | static DEVICE_ATTR(mousedev_poll_ms, 0644, hdaps_poll_show, hdaps_poll_store); | ||
593 | static DEVICE_ATTR(mousedev_threshold, 0644, hdaps_threshold_show, | ||
594 | hdaps_threshold_store); | ||
595 | 470 | ||
596 | static struct attribute *hdaps_attributes[] = { | 471 | static struct attribute *hdaps_attributes[] = { |
597 | &dev_attr_position.attr, | 472 | &dev_attr_position.attr, |
@@ -601,9 +476,6 @@ static struct attribute *hdaps_attributes[] = { | |||
601 | &dev_attr_keyboard_activity.attr, | 476 | &dev_attr_keyboard_activity.attr, |
602 | &dev_attr_mouse_activity.attr, | 477 | &dev_attr_mouse_activity.attr, |
603 | &dev_attr_calibrate.attr, | 478 | &dev_attr_calibrate.attr, |
604 | &dev_attr_mousedev.attr, | ||
605 | &dev_attr_mousedev_threshold.attr, | ||
606 | &dev_attr_mousedev_poll_ms.attr, | ||
607 | &dev_attr_invert.attr, | 479 | &dev_attr_invert.attr, |
608 | NULL, | 480 | NULL, |
609 | }; | 481 | }; |
@@ -619,7 +491,7 @@ static struct attribute_group hdaps_attribute_group = { | |||
619 | * XXX: We should be able to return nonzero and halt the detection process. | 491 | * XXX: We should be able to return nonzero and halt the detection process. |
620 | * But there is a bug in dmi_check_system() where a nonzero return from the | 492 | * But there is a bug in dmi_check_system() where a nonzero return from the |
621 | * first match will result in a return of failure from dmi_check_system(). | 493 | * first match will result in a return of failure from dmi_check_system(). |
622 | * I fixed this; the patch is in 2.6-mm. Once in Linus's tree we can make | 494 | * I fixed this; the patch is 2.6-git. Once in a released tree, we can make |
623 | * hdaps_dmi_match_invert() return hdaps_dmi_match(), which in turn returns 1. | 495 | * hdaps_dmi_match_invert() return hdaps_dmi_match(), which in turn returns 1. |
624 | */ | 496 | */ |
625 | static int hdaps_dmi_match(struct dmi_system_id *id) | 497 | static int hdaps_dmi_match(struct dmi_system_id *id) |
@@ -668,6 +540,7 @@ static int __init hdaps_init(void) | |||
668 | HDAPS_DMI_MATCH_NORMAL("ThinkPad T42"), | 540 | HDAPS_DMI_MATCH_NORMAL("ThinkPad T42"), |
669 | HDAPS_DMI_MATCH_NORMAL("ThinkPad T43"), | 541 | HDAPS_DMI_MATCH_NORMAL("ThinkPad T43"), |
670 | HDAPS_DMI_MATCH_NORMAL("ThinkPad X40"), | 542 | HDAPS_DMI_MATCH_NORMAL("ThinkPad X40"), |
543 | HDAPS_DMI_MATCH_NORMAL("ThinkPad X41 Tablet"), | ||
671 | { .ident = NULL } | 544 | { .ident = NULL } |
672 | }; | 545 | }; |
673 | 546 | ||
@@ -696,8 +569,18 @@ static int __init hdaps_init(void) | |||
696 | if (ret) | 569 | if (ret) |
697 | goto out_device; | 570 | goto out_device; |
698 | 571 | ||
699 | if (hdaps_mousedev) | 572 | /* initial calibrate for the input device */ |
700 | hdaps_mousedev_enable(); | 573 | hdaps_calibrate(); |
574 | |||
575 | /* initialize the input class */ | ||
576 | hdaps_idev.dev = &pdev->dev; | ||
577 | input_register_device(&hdaps_idev); | ||
578 | |||
579 | /* start up our timer for the input device */ | ||
580 | init_timer(&hdaps_timer); | ||
581 | hdaps_timer.function = hdaps_mousedev_poll; | ||
582 | hdaps_timer.expires = jiffies + HDAPS_POLL_PERIOD; | ||
583 | add_timer(&hdaps_timer); | ||
701 | 584 | ||
702 | printk(KERN_INFO "hdaps: driver successfully loaded.\n"); | 585 | printk(KERN_INFO "hdaps: driver successfully loaded.\n"); |
703 | return 0; | 586 | return 0; |
@@ -715,8 +598,8 @@ out: | |||
715 | 598 | ||
716 | static void __exit hdaps_exit(void) | 599 | static void __exit hdaps_exit(void) |
717 | { | 600 | { |
718 | hdaps_mousedev_disable(); | 601 | del_timer_sync(&hdaps_timer); |
719 | 602 | input_unregister_device(&hdaps_idev); | |
720 | sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group); | 603 | sysfs_remove_group(&pdev->dev.kobj, &hdaps_attribute_group); |
721 | platform_device_unregister(pdev); | 604 | platform_device_unregister(pdev); |
722 | driver_unregister(&hdaps_driver); | 605 | driver_unregister(&hdaps_driver); |
@@ -728,9 +611,6 @@ static void __exit hdaps_exit(void) | |||
728 | module_init(hdaps_init); | 611 | module_init(hdaps_init); |
729 | module_exit(hdaps_exit); | 612 | module_exit(hdaps_exit); |
730 | 613 | ||
731 | module_param_named(mousedev, hdaps_mousedev, bool, 0); | ||
732 | MODULE_PARM_DESC(mousedev, "enable the input class device"); | ||
733 | |||
734 | module_param_named(invert, hdaps_invert, bool, 0); | 614 | module_param_named(invert, hdaps_invert, bool, 0); |
735 | MODULE_PARM_DESC(invert, "invert data along each axis"); | 615 | MODULE_PARM_DESC(invert, "invert data along each axis"); |
736 | 616 | ||
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index d04f62ab5de1..ace8edad6e96 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -500,6 +500,7 @@ static int ide_diag_taskfile(ide_drive_t *drive, ide_task_t *args, unsigned long | |||
500 | } | 500 | } |
501 | 501 | ||
502 | rq.special = args; | 502 | rq.special = args; |
503 | args->rq = &rq; | ||
503 | return ide_do_drive_cmd(drive, &rq, ide_wait); | 504 | return ide_do_drive_cmd(drive, &rq, ide_wait); |
504 | } | 505 | } |
505 | 506 | ||
diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index 8337b0f26cc4..4866fc32d8d9 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c | |||
@@ -61,6 +61,7 @@ static const PCI_ENTRY id_list[] = | |||
61 | {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_E,"Digi International", "Digi DataFire Micro V (Europe)"}, | 61 | {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_E,"Digi International", "Digi DataFire Micro V (Europe)"}, |
62 | {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_A,"Digi International", "Digi DataFire Micro V IOM2 (North America)"}, | 62 | {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_A,"Digi International", "Digi DataFire Micro V IOM2 (North America)"}, |
63 | {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_A,"Digi International", "Digi DataFire Micro V (North America)"}, | 63 | {PCI_VENDOR_ID_DIGI, PCI_DEVICE_ID_DIGI_DF_M_A,"Digi International", "Digi DataFire Micro V (North America)"}, |
64 | {PCI_VENDOR_ID_SITECOM, PCI_DEVICE_ID_SITECOM_DC105V2, "Sitecom Europe", "DC-105 ISDN PCI"}, | ||
64 | {0, 0, NULL, NULL}, | 65 | {0, 0, NULL, NULL}, |
65 | }; | 66 | }; |
66 | 67 | ||
diff --git a/drivers/isdn/hisax/st5481.h b/drivers/isdn/hisax/st5481.h index 0fda5c89429b..9ffaae7c657a 100644 --- a/drivers/isdn/hisax/st5481.h +++ b/drivers/isdn/hisax/st5481.h | |||
@@ -466,10 +466,10 @@ void st5481_stop(struct st5481_adapter *adapter); | |||
466 | #define __debug_variable st5481_debug | 466 | #define __debug_variable st5481_debug |
467 | #include "hisax_debug.h" | 467 | #include "hisax_debug.h" |
468 | 468 | ||
469 | #ifdef CONFIG_HISAX_DEBUG | ||
470 | |||
471 | extern int st5481_debug; | 469 | extern int st5481_debug; |
472 | 470 | ||
471 | #ifdef CONFIG_HISAX_DEBUG | ||
472 | |||
473 | #define DBG_ISO_PACKET(level,urb) \ | 473 | #define DBG_ISO_PACKET(level,urb) \ |
474 | if (level & __debug_variable) dump_iso_packet(__FUNCTION__,urb) | 474 | if (level & __debug_variable) dump_iso_packet(__FUNCTION__,urb) |
475 | 475 | ||
diff --git a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c index 2fcd093921d8..0a2536d62402 100644 --- a/drivers/isdn/hisax/st5481_b.c +++ b/drivers/isdn/hisax/st5481_b.c | |||
@@ -172,14 +172,18 @@ static void usb_b_out_complete(struct urb *urb, struct pt_regs *regs) | |||
172 | test_and_clear_bit(buf_nr, &b_out->busy); | 172 | test_and_clear_bit(buf_nr, &b_out->busy); |
173 | 173 | ||
174 | if (unlikely(urb->status < 0)) { | 174 | if (unlikely(urb->status < 0)) { |
175 | if (urb->status != -ENOENT && urb->status != -ESHUTDOWN) { | 175 | switch (urb->status) { |
176 | WARN("urb status %d",urb->status); | 176 | case -ENOENT: |
177 | if (b_out->busy == 0) { | 177 | case -ESHUTDOWN: |
178 | st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2 | USB_DIR_OUT, NULL, NULL); | 178 | case -ECONNRESET: |
179 | } | 179 | DBG(4,"urb killed status %d", urb->status); |
180 | } else { | 180 | return; // Give up |
181 | DBG(1,"urb killed"); | 181 | default: |
182 | return; // Give up | 182 | WARN("urb status %d",urb->status); |
183 | if (b_out->busy == 0) { | ||
184 | st5481_usb_pipe_reset(adapter, (bcs->channel+1)*2 | USB_DIR_OUT, NULL, NULL); | ||
185 | } | ||
186 | break; | ||
183 | } | 187 | } |
184 | } | 188 | } |
185 | 189 | ||
@@ -205,7 +209,9 @@ static void st5481B_mode(struct st5481_bcs *bcs, int mode) | |||
205 | bcs->mode = mode; | 209 | bcs->mode = mode; |
206 | 210 | ||
207 | // Cancel all USB transfers on this B channel | 211 | // Cancel all USB transfers on this B channel |
212 | b_out->urb[0]->transfer_flags |= URB_ASYNC_UNLINK; | ||
208 | usb_unlink_urb(b_out->urb[0]); | 213 | usb_unlink_urb(b_out->urb[0]); |
214 | b_out->urb[1]->transfer_flags |= URB_ASYNC_UNLINK; | ||
209 | usb_unlink_urb(b_out->urb[1]); | 215 | usb_unlink_urb(b_out->urb[1]); |
210 | b_out->busy = 0; | 216 | b_out->busy = 0; |
211 | 217 | ||
diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c index 071b1d31999f..941f7022ada1 100644 --- a/drivers/isdn/hisax/st5481_d.c +++ b/drivers/isdn/hisax/st5481_d.c | |||
@@ -382,16 +382,20 @@ static void usb_d_out_complete(struct urb *urb, struct pt_regs *regs) | |||
382 | test_and_clear_bit(buf_nr, &d_out->busy); | 382 | test_and_clear_bit(buf_nr, &d_out->busy); |
383 | 383 | ||
384 | if (unlikely(urb->status < 0)) { | 384 | if (unlikely(urb->status < 0)) { |
385 | if (urb->status != -ENOENT && urb->status != -ESHUTDOWN) { | 385 | switch (urb->status) { |
386 | WARN("urb status %d",urb->status); | 386 | case -ENOENT: |
387 | if (d_out->busy == 0) { | 387 | case -ESHUTDOWN: |
388 | st5481_usb_pipe_reset(adapter, EP_D_OUT | USB_DIR_OUT, fifo_reseted, adapter); | 388 | case -ECONNRESET: |
389 | } | 389 | DBG(1,"urb killed status %d", urb->status); |
390 | return; | 390 | break; |
391 | } else { | 391 | default: |
392 | DBG(1,"urb killed"); | 392 | WARN("urb status %d",urb->status); |
393 | return; // Give up | 393 | if (d_out->busy == 0) { |
394 | st5481_usb_pipe_reset(adapter, EP_D_OUT | USB_DIR_OUT, fifo_reseted, adapter); | ||
395 | } | ||
396 | break; | ||
394 | } | 397 | } |
398 | return; // Give up | ||
395 | } | 399 | } |
396 | 400 | ||
397 | FsmEvent(&adapter->d_out.fsm, EV_DOUT_COMPLETE, (void *) buf_nr); | 401 | FsmEvent(&adapter->d_out.fsm, EV_DOUT_COMPLETE, (void *) buf_nr); |
@@ -709,14 +713,14 @@ int st5481_setup_d(struct st5481_adapter *adapter) | |||
709 | 713 | ||
710 | adapter->l1m.fsm = &l1fsm; | 714 | adapter->l1m.fsm = &l1fsm; |
711 | adapter->l1m.state = ST_L1_F3; | 715 | adapter->l1m.state = ST_L1_F3; |
712 | adapter->l1m.debug = 1; | 716 | adapter->l1m.debug = st5481_debug & 0x100; |
713 | adapter->l1m.userdata = adapter; | 717 | adapter->l1m.userdata = adapter; |
714 | adapter->l1m.printdebug = l1m_debug; | 718 | adapter->l1m.printdebug = l1m_debug; |
715 | FsmInitTimer(&adapter->l1m, &adapter->timer); | 719 | FsmInitTimer(&adapter->l1m, &adapter->timer); |
716 | 720 | ||
717 | adapter->d_out.fsm.fsm = &dout_fsm; | 721 | adapter->d_out.fsm.fsm = &dout_fsm; |
718 | adapter->d_out.fsm.state = ST_DOUT_NONE; | 722 | adapter->d_out.fsm.state = ST_DOUT_NONE; |
719 | adapter->d_out.fsm.debug = 1; | 723 | adapter->d_out.fsm.debug = st5481_debug & 0x100; |
720 | adapter->d_out.fsm.userdata = adapter; | 724 | adapter->d_out.fsm.userdata = adapter; |
721 | adapter->d_out.fsm.printdebug = dout_debug; | 725 | adapter->d_out.fsm.printdebug = dout_debug; |
722 | 726 | ||
diff --git a/drivers/isdn/hisax/st5481_init.c b/drivers/isdn/hisax/st5481_init.c index 7aa810d5d333..2cf5d1a6df6c 100644 --- a/drivers/isdn/hisax/st5481_init.c +++ b/drivers/isdn/hisax/st5481_init.c | |||
@@ -43,10 +43,10 @@ static int number_of_leds = 2; /* 2 LEDs on the adpater default */ | |||
43 | module_param(number_of_leds, int, 0); | 43 | module_param(number_of_leds, int, 0); |
44 | 44 | ||
45 | #ifdef CONFIG_HISAX_DEBUG | 45 | #ifdef CONFIG_HISAX_DEBUG |
46 | static int debug = 0x1; | 46 | static int debug = 0; |
47 | module_param(debug, int, 0); | 47 | module_param(debug, int, 0); |
48 | int st5481_debug; | ||
49 | #endif | 48 | #endif |
49 | int st5481_debug; | ||
50 | 50 | ||
51 | static LIST_HEAD(adapter_list); | 51 | static LIST_HEAD(adapter_list); |
52 | 52 | ||
diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c index ab62223297a5..ffd5b2d45552 100644 --- a/drivers/isdn/hisax/st5481_usb.c +++ b/drivers/isdn/hisax/st5481_usb.c | |||
@@ -132,11 +132,15 @@ static void usb_ctrl_complete(struct urb *urb, struct pt_regs *regs) | |||
132 | struct ctrl_msg *ctrl_msg; | 132 | struct ctrl_msg *ctrl_msg; |
133 | 133 | ||
134 | if (unlikely(urb->status < 0)) { | 134 | if (unlikely(urb->status < 0)) { |
135 | if (urb->status != -ENOENT && urb->status != -ESHUTDOWN) { | 135 | switch (urb->status) { |
136 | WARN("urb status %d",urb->status); | 136 | case -ENOENT: |
137 | } else { | 137 | case -ESHUTDOWN: |
138 | DBG(1,"urb killed"); | 138 | case -ECONNRESET: |
139 | return; // Give up | 139 | DBG(1,"urb killed status %d", urb->status); |
140 | return; // Give up | ||
141 | default: | ||
142 | WARN("urb status %d",urb->status); | ||
143 | break; | ||
140 | } | 144 | } |
141 | } | 145 | } |
142 | 146 | ||
@@ -184,22 +188,22 @@ static void usb_int_complete(struct urb *urb, struct pt_regs *regs) | |||
184 | int status; | 188 | int status; |
185 | 189 | ||
186 | switch (urb->status) { | 190 | switch (urb->status) { |
187 | case 0: | 191 | case 0: |
188 | /* success */ | 192 | /* success */ |
189 | break; | 193 | break; |
190 | case -ECONNRESET: | 194 | case -ECONNRESET: |
191 | case -ENOENT: | 195 | case -ENOENT: |
192 | case -ESHUTDOWN: | 196 | case -ESHUTDOWN: |
193 | /* this urb is terminated, clean up */ | 197 | /* this urb is terminated, clean up */ |
194 | DBG(1, "urb shutting down with status: %d", urb->status); | 198 | DBG(2, "urb shutting down with status: %d", urb->status); |
195 | return; | 199 | return; |
196 | default: | 200 | default: |
197 | WARN("nonzero urb status received: %d", urb->status); | 201 | WARN("nonzero urb status received: %d", urb->status); |
198 | goto exit; | 202 | goto exit; |
199 | } | 203 | } |
200 | 204 | ||
201 | 205 | ||
202 | DBG_PACKET(1, data, INT_PKT_SIZE); | 206 | DBG_PACKET(2, data, INT_PKT_SIZE); |
203 | 207 | ||
204 | if (urb->actual_length == 0) { | 208 | if (urb->actual_length == 0) { |
205 | goto exit; | 209 | goto exit; |
@@ -250,7 +254,7 @@ int st5481_setup_usb(struct st5481_adapter *adapter) | |||
250 | struct urb *urb; | 254 | struct urb *urb; |
251 | u8 *buf; | 255 | u8 *buf; |
252 | 256 | ||
253 | DBG(1,""); | 257 | DBG(2,""); |
254 | 258 | ||
255 | if ((status = usb_reset_configuration (dev)) < 0) { | 259 | if ((status = usb_reset_configuration (dev)) < 0) { |
256 | WARN("reset_configuration failed,status=%d",status); | 260 | WARN("reset_configuration failed,status=%d",status); |
@@ -330,15 +334,17 @@ void st5481_release_usb(struct st5481_adapter *adapter) | |||
330 | DBG(1,""); | 334 | DBG(1,""); |
331 | 335 | ||
332 | // Stop and free Control and Interrupt URBs | 336 | // Stop and free Control and Interrupt URBs |
333 | usb_unlink_urb(ctrl->urb); | 337 | usb_kill_urb(ctrl->urb); |
334 | if (ctrl->urb->transfer_buffer) | 338 | if (ctrl->urb->transfer_buffer) |
335 | kfree(ctrl->urb->transfer_buffer); | 339 | kfree(ctrl->urb->transfer_buffer); |
336 | usb_free_urb(ctrl->urb); | 340 | usb_free_urb(ctrl->urb); |
341 | ctrl->urb = NULL; | ||
337 | 342 | ||
338 | usb_unlink_urb(intr->urb); | 343 | usb_kill_urb(intr->urb); |
339 | if (intr->urb->transfer_buffer) | 344 | if (intr->urb->transfer_buffer) |
340 | kfree(intr->urb->transfer_buffer); | 345 | kfree(intr->urb->transfer_buffer); |
341 | usb_free_urb(intr->urb); | 346 | usb_free_urb(intr->urb); |
347 | ctrl->urb = NULL; | ||
342 | } | 348 | } |
343 | 349 | ||
344 | /* | 350 | /* |
@@ -406,6 +412,7 @@ fill_isoc_urb(struct urb *urb, struct usb_device *dev, | |||
406 | spin_lock_init(&urb->lock); | 412 | spin_lock_init(&urb->lock); |
407 | urb->dev=dev; | 413 | urb->dev=dev; |
408 | urb->pipe=pipe; | 414 | urb->pipe=pipe; |
415 | urb->interval = 1; | ||
409 | urb->transfer_buffer=buf; | 416 | urb->transfer_buffer=buf; |
410 | urb->number_of_packets = num_packets; | 417 | urb->number_of_packets = num_packets; |
411 | urb->transfer_buffer_length=num_packets*packet_size; | 418 | urb->transfer_buffer_length=num_packets*packet_size; |
@@ -452,7 +459,9 @@ st5481_setup_isocpipes(struct urb* urb[2], struct usb_device *dev, | |||
452 | if (urb[j]) { | 459 | if (urb[j]) { |
453 | if (urb[j]->transfer_buffer) | 460 | if (urb[j]->transfer_buffer) |
454 | kfree(urb[j]->transfer_buffer); | 461 | kfree(urb[j]->transfer_buffer); |
462 | urb[j]->transfer_buffer = NULL; | ||
455 | usb_free_urb(urb[j]); | 463 | usb_free_urb(urb[j]); |
464 | urb[j] = NULL; | ||
456 | } | 465 | } |
457 | } | 466 | } |
458 | return retval; | 467 | return retval; |
@@ -463,10 +472,11 @@ void st5481_release_isocpipes(struct urb* urb[2]) | |||
463 | int j; | 472 | int j; |
464 | 473 | ||
465 | for (j = 0; j < 2; j++) { | 474 | for (j = 0; j < 2; j++) { |
466 | usb_unlink_urb(urb[j]); | 475 | usb_kill_urb(urb[j]); |
467 | if (urb[j]->transfer_buffer) | 476 | if (urb[j]->transfer_buffer) |
468 | kfree(urb[j]->transfer_buffer); | 477 | kfree(urb[j]->transfer_buffer); |
469 | usb_free_urb(urb[j]); | 478 | usb_free_urb(urb[j]); |
479 | urb[j] = NULL; | ||
470 | } | 480 | } |
471 | } | 481 | } |
472 | 482 | ||
@@ -485,11 +495,15 @@ static void usb_in_complete(struct urb *urb, struct pt_regs *regs) | |||
485 | int len, count, status; | 495 | int len, count, status; |
486 | 496 | ||
487 | if (unlikely(urb->status < 0)) { | 497 | if (unlikely(urb->status < 0)) { |
488 | if (urb->status != -ENOENT && urb->status != -ESHUTDOWN) { | 498 | switch (urb->status) { |
489 | WARN("urb status %d",urb->status); | 499 | case -ENOENT: |
490 | } else { | 500 | case -ESHUTDOWN: |
491 | DBG(1,"urb killed"); | 501 | case -ECONNRESET: |
492 | return; // Give up | 502 | DBG(1,"urb killed status %d", urb->status); |
503 | return; // Give up | ||
504 | default: | ||
505 | WARN("urb status %d",urb->status); | ||
506 | break; | ||
493 | } | 507 | } |
494 | } | 508 | } |
495 | 509 | ||
@@ -631,7 +645,9 @@ void st5481_in_mode(struct st5481_in *in, int mode) | |||
631 | 645 | ||
632 | in->mode = mode; | 646 | in->mode = mode; |
633 | 647 | ||
648 | in->urb[0]->transfer_flags |= URB_ASYNC_UNLINK; | ||
634 | usb_unlink_urb(in->urb[0]); | 649 | usb_unlink_urb(in->urb[0]); |
650 | in->urb[1]->transfer_flags |= URB_ASYNC_UNLINK; | ||
635 | usb_unlink_urb(in->urb[1]); | 651 | usb_unlink_urb(in->urb[1]); |
636 | 652 | ||
637 | if (in->mode != L1_MODE_NULL) { | 653 | if (in->mode != L1_MODE_NULL) { |
diff --git a/drivers/md/raid6.h b/drivers/md/raid6.h index f80ee6350edf..31cbee71365f 100644 --- a/drivers/md/raid6.h +++ b/drivers/md/raid6.h | |||
@@ -69,9 +69,13 @@ extern const char raid6_empty_zero_page[PAGE_SIZE]; | |||
69 | #define __init | 69 | #define __init |
70 | #define __exit | 70 | #define __exit |
71 | #define __attribute_const__ __attribute__((const)) | 71 | #define __attribute_const__ __attribute__((const)) |
72 | #define noinline __attribute__((noinline)) | ||
72 | 73 | ||
73 | #define preempt_enable() | 74 | #define preempt_enable() |
74 | #define preempt_disable() | 75 | #define preempt_disable() |
76 | #define cpu_has_feature(x) 1 | ||
77 | #define enable_kernel_altivec() | ||
78 | #define disable_kernel_altivec() | ||
75 | 79 | ||
76 | #endif /* __KERNEL__ */ | 80 | #endif /* __KERNEL__ */ |
77 | 81 | ||
diff --git a/drivers/md/raid6algos.c b/drivers/md/raid6algos.c index acf386fc4b4f..51c63c0cf1c9 100644 --- a/drivers/md/raid6algos.c +++ b/drivers/md/raid6algos.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include "raid6.h" | 19 | #include "raid6.h" |
20 | #ifndef __KERNEL__ | 20 | #ifndef __KERNEL__ |
21 | #include <sys/mman.h> | 21 | #include <sys/mman.h> |
22 | #include <stdio.h> | ||
22 | #endif | 23 | #endif |
23 | 24 | ||
24 | struct raid6_calls raid6_call; | 25 | struct raid6_calls raid6_call; |
diff --git a/drivers/md/raid6altivec.uc b/drivers/md/raid6altivec.uc index 1de8f030eee0..b9afd35b8812 100644 --- a/drivers/md/raid6altivec.uc +++ b/drivers/md/raid6altivec.uc | |||
@@ -27,16 +27,20 @@ | |||
27 | #ifdef CONFIG_ALTIVEC | 27 | #ifdef CONFIG_ALTIVEC |
28 | 28 | ||
29 | #include <altivec.h> | 29 | #include <altivec.h> |
30 | #include <asm/system.h> | 30 | #ifdef __KERNEL__ |
31 | #include <asm/cputable.h> | 31 | # include <asm/system.h> |
32 | # include <asm/cputable.h> | ||
33 | #endif | ||
32 | 34 | ||
33 | /* | 35 | /* |
34 | * This is the C data type to use | 36 | * This is the C data type to use. We use a vector of |
37 | * signed char so vec_cmpgt() will generate the right | ||
38 | * instruction. | ||
35 | */ | 39 | */ |
36 | 40 | ||
37 | typedef vector unsigned char unative_t; | 41 | typedef vector signed char unative_t; |
38 | 42 | ||
39 | #define NBYTES(x) ((vector unsigned char) {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x}) | 43 | #define NBYTES(x) ((vector signed char) {x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x}) |
40 | #define NSIZE sizeof(unative_t) | 44 | #define NSIZE sizeof(unative_t) |
41 | 45 | ||
42 | /* | 46 | /* |
@@ -108,7 +112,11 @@ int raid6_have_altivec(void); | |||
108 | int raid6_have_altivec(void) | 112 | int raid6_have_altivec(void) |
109 | { | 113 | { |
110 | /* This assumes either all CPUs have Altivec or none does */ | 114 | /* This assumes either all CPUs have Altivec or none does */ |
115 | # ifdef __KERNEL__ | ||
111 | return cpu_has_feature(CPU_FTR_ALTIVEC); | 116 | return cpu_has_feature(CPU_FTR_ALTIVEC); |
117 | # else | ||
118 | return 1; | ||
119 | # endif | ||
112 | } | 120 | } |
113 | #endif | 121 | #endif |
114 | 122 | ||
diff --git a/drivers/md/raid6test/Makefile b/drivers/md/raid6test/Makefile index 557806728609..78e0396adf2a 100644 --- a/drivers/md/raid6test/Makefile +++ b/drivers/md/raid6test/Makefile | |||
@@ -8,6 +8,8 @@ OPTFLAGS = -O2 # Adjust as desired | |||
8 | CFLAGS = -I.. -g $(OPTFLAGS) | 8 | CFLAGS = -I.. -g $(OPTFLAGS) |
9 | LD = ld | 9 | LD = ld |
10 | PERL = perl | 10 | PERL = perl |
11 | AR = ar | ||
12 | RANLIB = ranlib | ||
11 | 13 | ||
12 | .c.o: | 14 | .c.o: |
13 | $(CC) $(CFLAGS) -c -o $@ $< | 15 | $(CC) $(CFLAGS) -c -o $@ $< |
@@ -18,18 +20,33 @@ PERL = perl | |||
18 | %.uc: ../%.uc | 20 | %.uc: ../%.uc |
19 | cp -f $< $@ | 21 | cp -f $< $@ |
20 | 22 | ||
21 | all: raid6.o raid6test | 23 | all: raid6.a raid6test |
22 | 24 | ||
23 | raid6.o: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \ | 25 | raid6.a: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \ |
24 | raid6int32.o \ | 26 | raid6int32.o \ |
25 | raid6mmx.o raid6sse1.o raid6sse2.o \ | 27 | raid6mmx.o raid6sse1.o raid6sse2.o \ |
28 | raid6altivec1.o raid6altivec2.o raid6altivec4.o raid6altivec8.o \ | ||
26 | raid6recov.o raid6algos.o \ | 29 | raid6recov.o raid6algos.o \ |
27 | raid6tables.o | 30 | raid6tables.o |
28 | $(LD) -r -o $@ $^ | 31 | rm -f $@ |
32 | $(AR) cq $@ $^ | ||
33 | $(RANLIB) $@ | ||
29 | 34 | ||
30 | raid6test: raid6.o test.c | 35 | raid6test: test.c raid6.a |
31 | $(CC) $(CFLAGS) -o raid6test $^ | 36 | $(CC) $(CFLAGS) -o raid6test $^ |
32 | 37 | ||
38 | raid6altivec1.c: raid6altivec.uc ../unroll.pl | ||
39 | $(PERL) ../unroll.pl 1 < raid6altivec.uc > $@ | ||
40 | |||
41 | raid6altivec2.c: raid6altivec.uc ../unroll.pl | ||
42 | $(PERL) ../unroll.pl 2 < raid6altivec.uc > $@ | ||
43 | |||
44 | raid6altivec4.c: raid6altivec.uc ../unroll.pl | ||
45 | $(PERL) ../unroll.pl 4 < raid6altivec.uc > $@ | ||
46 | |||
47 | raid6altivec8.c: raid6altivec.uc ../unroll.pl | ||
48 | $(PERL) ../unroll.pl 8 < raid6altivec.uc > $@ | ||
49 | |||
33 | raid6int1.c: raid6int.uc ../unroll.pl | 50 | raid6int1.c: raid6int.uc ../unroll.pl |
34 | $(PERL) ../unroll.pl 1 < raid6int.uc > $@ | 51 | $(PERL) ../unroll.pl 1 < raid6int.uc > $@ |
35 | 52 | ||
@@ -52,7 +69,7 @@ raid6tables.c: mktables | |||
52 | ./mktables > raid6tables.c | 69 | ./mktables > raid6tables.c |
53 | 70 | ||
54 | clean: | 71 | clean: |
55 | rm -f *.o mktables mktables.c raid6int.uc raid6*.c raid6test | 72 | rm -f *.o *.a mktables mktables.c raid6int.uc raid6*.c raid6test |
56 | 73 | ||
57 | spotless: clean | 74 | spotless: clean |
58 | rm -f *~ | 75 | rm -f *~ |
diff --git a/drivers/mtd/maps/sharpsl-flash.c b/drivers/mtd/maps/sharpsl-flash.c index d15da6fd84c1..b7f093fbf9b0 100644 --- a/drivers/mtd/maps/sharpsl-flash.c +++ b/drivers/mtd/maps/sharpsl-flash.c | |||
@@ -82,7 +82,7 @@ int __init init_sharpsl(void) | |||
82 | } else if (machine_is_tosa()) { | 82 | } else if (machine_is_tosa()) { |
83 | sharpsl_partitions[0].size=0x006a0000; | 83 | sharpsl_partitions[0].size=0x006a0000; |
84 | sharpsl_partitions[0].offset=0x00160000; | 84 | sharpsl_partitions[0].offset=0x00160000; |
85 | } else if (machine_is_spitz()) { | 85 | } else if (machine_is_spitz() || machine_is_akita() || machine_is_borzoi()) { |
86 | sharpsl_partitions[0].size=0x006b0000; | 86 | sharpsl_partitions[0].size=0x006b0000; |
87 | sharpsl_partitions[0].offset=0x00140000; | 87 | sharpsl_partitions[0].offset=0x00140000; |
88 | } else { | 88 | } else { |
diff --git a/drivers/mtd/nand/sharpsl.c b/drivers/mtd/nand/sharpsl.c index 9853b87bb756..88b5b5b40b43 100644 --- a/drivers/mtd/nand/sharpsl.c +++ b/drivers/mtd/nand/sharpsl.c | |||
@@ -221,10 +221,16 @@ sharpsl_nand_init(void) | |||
221 | sharpsl_partition_info[1].size=25 * 1024 * 1024; | 221 | sharpsl_partition_info[1].size=25 * 1024 * 1024; |
222 | } else if (machine_is_husky()) { | 222 | } else if (machine_is_husky()) { |
223 | sharpsl_partition_info[1].size=53 * 1024 * 1024; | 223 | sharpsl_partition_info[1].size=53 * 1024 * 1024; |
224 | } | 224 | } else if (machine_is_spitz()) { |
225 | sharpsl_partition_info[1].size=5 * 1024 * 1024; | ||
226 | } else if (machine_is_akita()) { | ||
227 | sharpsl_partition_info[1].size=58 * 1024 * 1024; | ||
228 | } else if (machine_is_borzoi()) { | ||
229 | sharpsl_partition_info[1].size=32 * 1024 * 1024; | ||
230 | } | ||
225 | } | 231 | } |
226 | 232 | ||
227 | if (machine_is_husky()) { | 233 | if (machine_is_husky() || machine_is_borzoi()) { |
228 | /* Need to use small eraseblock size for backward compatibility */ | 234 | /* Need to use small eraseblock size for backward compatibility */ |
229 | sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS; | 235 | sharpsl_mtd->flags |= MTD_NO_VIRTBLOCKS; |
230 | } | 236 | } |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 34b80de34fae..bc537440ca02 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -353,8 +353,6 @@ struct cp_private { | |||
353 | 353 | ||
354 | struct net_device_stats net_stats; | 354 | struct net_device_stats net_stats; |
355 | struct cp_extra_stats cp_stats; | 355 | struct cp_extra_stats cp_stats; |
356 | struct cp_dma_stats *nic_stats; | ||
357 | dma_addr_t nic_stats_dma; | ||
358 | 356 | ||
359 | unsigned rx_tail ____cacheline_aligned; | 357 | unsigned rx_tail ____cacheline_aligned; |
360 | struct cp_desc *rx_ring; | 358 | struct cp_desc *rx_ring; |
@@ -1143,10 +1141,6 @@ static int cp_alloc_rings (struct cp_private *cp) | |||
1143 | cp->rx_ring = mem; | 1141 | cp->rx_ring = mem; |
1144 | cp->tx_ring = &cp->rx_ring[CP_RX_RING_SIZE]; | 1142 | cp->tx_ring = &cp->rx_ring[CP_RX_RING_SIZE]; |
1145 | 1143 | ||
1146 | mem += (CP_RING_BYTES - CP_STATS_SIZE); | ||
1147 | cp->nic_stats = mem; | ||
1148 | cp->nic_stats_dma = cp->ring_dma + (CP_RING_BYTES - CP_STATS_SIZE); | ||
1149 | |||
1150 | return cp_init_rings(cp); | 1144 | return cp_init_rings(cp); |
1151 | } | 1145 | } |
1152 | 1146 | ||
@@ -1187,7 +1181,6 @@ static void cp_free_rings (struct cp_private *cp) | |||
1187 | pci_free_consistent(cp->pdev, CP_RING_BYTES, cp->rx_ring, cp->ring_dma); | 1181 | pci_free_consistent(cp->pdev, CP_RING_BYTES, cp->rx_ring, cp->ring_dma); |
1188 | cp->rx_ring = NULL; | 1182 | cp->rx_ring = NULL; |
1189 | cp->tx_ring = NULL; | 1183 | cp->tx_ring = NULL; |
1190 | cp->nic_stats = NULL; | ||
1191 | } | 1184 | } |
1192 | 1185 | ||
1193 | static int cp_open (struct net_device *dev) | 1186 | static int cp_open (struct net_device *dev) |
@@ -1516,13 +1509,17 @@ static void cp_get_ethtool_stats (struct net_device *dev, | |||
1516 | struct ethtool_stats *estats, u64 *tmp_stats) | 1509 | struct ethtool_stats *estats, u64 *tmp_stats) |
1517 | { | 1510 | { |
1518 | struct cp_private *cp = netdev_priv(dev); | 1511 | struct cp_private *cp = netdev_priv(dev); |
1512 | struct cp_dma_stats *nic_stats; | ||
1513 | dma_addr_t dma; | ||
1519 | int i; | 1514 | int i; |
1520 | 1515 | ||
1521 | memset(cp->nic_stats, 0, sizeof(struct cp_dma_stats)); | 1516 | nic_stats = pci_alloc_consistent(cp->pdev, sizeof(*nic_stats), &dma); |
1517 | if (!nic_stats) | ||
1518 | return; | ||
1522 | 1519 | ||
1523 | /* begin NIC statistics dump */ | 1520 | /* begin NIC statistics dump */ |
1524 | cpw32(StatsAddr + 4, (cp->nic_stats_dma >> 16) >> 16); | 1521 | cpw32(StatsAddr + 4, (u64)dma >> 32); |
1525 | cpw32(StatsAddr, (cp->nic_stats_dma & 0xffffffff) | DumpStats); | 1522 | cpw32(StatsAddr, ((u64)dma & DMA_32BIT_MASK) | DumpStats); |
1526 | cpr32(StatsAddr); | 1523 | cpr32(StatsAddr); |
1527 | 1524 | ||
1528 | for (i = 0; i < 1000; i++) { | 1525 | for (i = 0; i < 1000; i++) { |
@@ -1532,24 +1529,27 @@ static void cp_get_ethtool_stats (struct net_device *dev, | |||
1532 | } | 1529 | } |
1533 | cpw32(StatsAddr, 0); | 1530 | cpw32(StatsAddr, 0); |
1534 | cpw32(StatsAddr + 4, 0); | 1531 | cpw32(StatsAddr + 4, 0); |
1532 | cpr32(StatsAddr); | ||
1535 | 1533 | ||
1536 | i = 0; | 1534 | i = 0; |
1537 | tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_ok); | 1535 | tmp_stats[i++] = le64_to_cpu(nic_stats->tx_ok); |
1538 | tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok); | 1536 | tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok); |
1539 | tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_err); | 1537 | tmp_stats[i++] = le64_to_cpu(nic_stats->tx_err); |
1540 | tmp_stats[i++] = le32_to_cpu(cp->nic_stats->rx_err); | 1538 | tmp_stats[i++] = le32_to_cpu(nic_stats->rx_err); |
1541 | tmp_stats[i++] = le16_to_cpu(cp->nic_stats->rx_fifo); | 1539 | tmp_stats[i++] = le16_to_cpu(nic_stats->rx_fifo); |
1542 | tmp_stats[i++] = le16_to_cpu(cp->nic_stats->frame_align); | 1540 | tmp_stats[i++] = le16_to_cpu(nic_stats->frame_align); |
1543 | tmp_stats[i++] = le32_to_cpu(cp->nic_stats->tx_ok_1col); | 1541 | tmp_stats[i++] = le32_to_cpu(nic_stats->tx_ok_1col); |
1544 | tmp_stats[i++] = le32_to_cpu(cp->nic_stats->tx_ok_mcol); | 1542 | tmp_stats[i++] = le32_to_cpu(nic_stats->tx_ok_mcol); |
1545 | tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok_phys); | 1543 | tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok_phys); |
1546 | tmp_stats[i++] = le64_to_cpu(cp->nic_stats->rx_ok_bcast); | 1544 | tmp_stats[i++] = le64_to_cpu(nic_stats->rx_ok_bcast); |
1547 | tmp_stats[i++] = le32_to_cpu(cp->nic_stats->rx_ok_mcast); | 1545 | tmp_stats[i++] = le32_to_cpu(nic_stats->rx_ok_mcast); |
1548 | tmp_stats[i++] = le16_to_cpu(cp->nic_stats->tx_abort); | 1546 | tmp_stats[i++] = le16_to_cpu(nic_stats->tx_abort); |
1549 | tmp_stats[i++] = le16_to_cpu(cp->nic_stats->tx_underrun); | 1547 | tmp_stats[i++] = le16_to_cpu(nic_stats->tx_underrun); |
1550 | tmp_stats[i++] = cp->cp_stats.rx_frags; | 1548 | tmp_stats[i++] = cp->cp_stats.rx_frags; |
1551 | if (i != CP_NUM_STATS) | 1549 | if (i != CP_NUM_STATS) |
1552 | BUG(); | 1550 | BUG(); |
1551 | |||
1552 | pci_free_consistent(cp->pdev, sizeof(*nic_stats), nic_stats, dma); | ||
1553 | } | 1553 | } |
1554 | 1554 | ||
1555 | static struct ethtool_ops cp_ethtool_ops = { | 1555 | static struct ethtool_ops cp_ethtool_ops = { |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 94c9f68dd16b..90449a0f2a6c 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -2879,6 +2879,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2879 | * This target is not on a VLAN | 2879 | * This target is not on a VLAN |
2880 | */ | 2880 | */ |
2881 | if (rt->u.dst.dev == bond->dev) { | 2881 | if (rt->u.dst.dev == bond->dev) { |
2882 | ip_rt_put(rt); | ||
2882 | dprintk("basa: rtdev == bond->dev: arp_send\n"); | 2883 | dprintk("basa: rtdev == bond->dev: arp_send\n"); |
2883 | bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], | 2884 | bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], |
2884 | bond->master_ip, 0); | 2885 | bond->master_ip, 0); |
@@ -2898,6 +2899,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2898 | } | 2899 | } |
2899 | 2900 | ||
2900 | if (vlan_id) { | 2901 | if (vlan_id) { |
2902 | ip_rt_put(rt); | ||
2901 | bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], | 2903 | bond_arp_send(slave->dev, ARPOP_REQUEST, targets[i], |
2902 | vlan->vlan_ip, vlan_id); | 2904 | vlan->vlan_ip, vlan_id); |
2903 | continue; | 2905 | continue; |
@@ -2909,6 +2911,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2909 | bond->dev->name, NIPQUAD(fl.fl4_dst), | 2911 | bond->dev->name, NIPQUAD(fl.fl4_dst), |
2910 | rt->u.dst.dev ? rt->u.dst.dev->name : "NULL"); | 2912 | rt->u.dst.dev ? rt->u.dst.dev->name : "NULL"); |
2911 | } | 2913 | } |
2914 | ip_rt_put(rt); | ||
2912 | } | 2915 | } |
2913 | } | 2916 | } |
2914 | 2917 | ||
@@ -5036,6 +5039,14 @@ static int __init bonding_init(void) | |||
5036 | return 0; | 5039 | return 0; |
5037 | 5040 | ||
5038 | out_err: | 5041 | out_err: |
5042 | /* | ||
5043 | * rtnl_unlock() will run netdev_run_todo(), putting the | ||
5044 | * thus-far-registered bonding devices into a state which | ||
5045 | * unregigister_netdevice() will accept | ||
5046 | */ | ||
5047 | rtnl_unlock(); | ||
5048 | rtnl_lock(); | ||
5049 | |||
5039 | /* free and unregister all bonds that were successfully added */ | 5050 | /* free and unregister all bonds that were successfully added */ |
5040 | bond_free_all(); | 5051 | bond_free_all(); |
5041 | 5052 | ||
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 4e19220473d0..c796f41b4a52 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1817,6 +1817,10 @@ spider_net_setup_phy(struct spider_net_card *card) | |||
1817 | /* LEDs active in both modes, autosense prio = fiber */ | 1817 | /* LEDs active in both modes, autosense prio = fiber */ |
1818 | spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x945f); | 1818 | spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x945f); |
1819 | 1819 | ||
1820 | /* switch off fibre autoneg */ | ||
1821 | spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0xfc01); | ||
1822 | spider_net_write_phy(card->netdev, 1, 0x0b, 0x0004); | ||
1823 | |||
1820 | phy->def->ops->read_link(phy); | 1824 | phy->def->ops->read_link(phy); |
1821 | pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name, | 1825 | pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name, |
1822 | phy->speed, phy->duplex==1 ? "Full" : "Half"); | 1826 | phy->speed, phy->duplex==1 ? "Full" : "Half"); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 7599f52e15b3..81f4aedf534c 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -67,8 +67,8 @@ | |||
67 | 67 | ||
68 | #define DRV_MODULE_NAME "tg3" | 68 | #define DRV_MODULE_NAME "tg3" |
69 | #define PFX DRV_MODULE_NAME ": " | 69 | #define PFX DRV_MODULE_NAME ": " |
70 | #define DRV_MODULE_VERSION "3.39" | 70 | #define DRV_MODULE_VERSION "3.40" |
71 | #define DRV_MODULE_RELDATE "September 5, 2005" | 71 | #define DRV_MODULE_RELDATE "September 15, 2005" |
72 | 72 | ||
73 | #define TG3_DEF_MAC_MODE 0 | 73 | #define TG3_DEF_MAC_MODE 0 |
74 | #define TG3_DEF_RX_MODE 0 | 74 | #define TG3_DEF_RX_MODE 0 |
@@ -3442,31 +3442,47 @@ static void tg3_tx_timeout(struct net_device *dev) | |||
3442 | schedule_work(&tp->reset_task); | 3442 | schedule_work(&tp->reset_task); |
3443 | } | 3443 | } |
3444 | 3444 | ||
3445 | /* Test for DMA buffers crossing any 4GB boundaries: 4G, 8G, etc */ | ||
3446 | static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len) | ||
3447 | { | ||
3448 | u32 base = (u32) mapping & 0xffffffff; | ||
3449 | |||
3450 | return ((base > 0xffffdcc0) && | ||
3451 | (base + len + 8 < base)); | ||
3452 | } | ||
3453 | |||
3445 | static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, u32); | 3454 | static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, u32); |
3446 | 3455 | ||
3447 | static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, | 3456 | static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, |
3448 | u32 guilty_entry, int guilty_len, | 3457 | u32 last_plus_one, u32 *start, |
3449 | u32 last_plus_one, u32 *start, u32 mss) | 3458 | u32 base_flags, u32 mss) |
3450 | { | 3459 | { |
3451 | struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC); | 3460 | struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC); |
3452 | dma_addr_t new_addr; | 3461 | dma_addr_t new_addr = 0; |
3453 | u32 entry = *start; | 3462 | u32 entry = *start; |
3454 | int i; | 3463 | int i, ret = 0; |
3455 | 3464 | ||
3456 | if (!new_skb) { | 3465 | if (!new_skb) { |
3457 | dev_kfree_skb(skb); | 3466 | ret = -1; |
3458 | return -1; | 3467 | } else { |
3468 | /* New SKB is guaranteed to be linear. */ | ||
3469 | entry = *start; | ||
3470 | new_addr = pci_map_single(tp->pdev, new_skb->data, new_skb->len, | ||
3471 | PCI_DMA_TODEVICE); | ||
3472 | /* Make sure new skb does not cross any 4G boundaries. | ||
3473 | * Drop the packet if it does. | ||
3474 | */ | ||
3475 | if (tg3_4g_overflow_test(new_addr, new_skb->len)) { | ||
3476 | ret = -1; | ||
3477 | dev_kfree_skb(new_skb); | ||
3478 | new_skb = NULL; | ||
3479 | } else { | ||
3480 | tg3_set_txd(tp, entry, new_addr, new_skb->len, | ||
3481 | base_flags, 1 | (mss << 1)); | ||
3482 | *start = NEXT_TX(entry); | ||
3483 | } | ||
3459 | } | 3484 | } |
3460 | 3485 | ||
3461 | /* New SKB is guaranteed to be linear. */ | ||
3462 | entry = *start; | ||
3463 | new_addr = pci_map_single(tp->pdev, new_skb->data, new_skb->len, | ||
3464 | PCI_DMA_TODEVICE); | ||
3465 | tg3_set_txd(tp, entry, new_addr, new_skb->len, | ||
3466 | (skb->ip_summed == CHECKSUM_HW) ? | ||
3467 | TXD_FLAG_TCPUDP_CSUM : 0, 1 | (mss << 1)); | ||
3468 | *start = NEXT_TX(entry); | ||
3469 | |||
3470 | /* Now clean up the sw ring entries. */ | 3486 | /* Now clean up the sw ring entries. */ |
3471 | i = 0; | 3487 | i = 0; |
3472 | while (entry != last_plus_one) { | 3488 | while (entry != last_plus_one) { |
@@ -3491,7 +3507,7 @@ static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, | |||
3491 | 3507 | ||
3492 | dev_kfree_skb(skb); | 3508 | dev_kfree_skb(skb); |
3493 | 3509 | ||
3494 | return 0; | 3510 | return ret; |
3495 | } | 3511 | } |
3496 | 3512 | ||
3497 | static void tg3_set_txd(struct tg3 *tp, int entry, | 3513 | static void tg3_set_txd(struct tg3 *tp, int entry, |
@@ -3517,19 +3533,10 @@ static void tg3_set_txd(struct tg3 *tp, int entry, | |||
3517 | txd->vlan_tag = vlan_tag << TXD_VLAN_TAG_SHIFT; | 3533 | txd->vlan_tag = vlan_tag << TXD_VLAN_TAG_SHIFT; |
3518 | } | 3534 | } |
3519 | 3535 | ||
3520 | static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len) | ||
3521 | { | ||
3522 | u32 base = (u32) mapping & 0xffffffff; | ||
3523 | |||
3524 | return ((base > 0xffffdcc0) && | ||
3525 | (base + len + 8 < base)); | ||
3526 | } | ||
3527 | |||
3528 | static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | 3536 | static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) |
3529 | { | 3537 | { |
3530 | struct tg3 *tp = netdev_priv(dev); | 3538 | struct tg3 *tp = netdev_priv(dev); |
3531 | dma_addr_t mapping; | 3539 | dma_addr_t mapping; |
3532 | unsigned int i; | ||
3533 | u32 len, entry, base_flags, mss; | 3540 | u32 len, entry, base_flags, mss; |
3534 | int would_hit_hwbug; | 3541 | int would_hit_hwbug; |
3535 | 3542 | ||
@@ -3624,7 +3631,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3624 | would_hit_hwbug = 0; | 3631 | would_hit_hwbug = 0; |
3625 | 3632 | ||
3626 | if (tg3_4g_overflow_test(mapping, len)) | 3633 | if (tg3_4g_overflow_test(mapping, len)) |
3627 | would_hit_hwbug = entry + 1; | 3634 | would_hit_hwbug = 1; |
3628 | 3635 | ||
3629 | tg3_set_txd(tp, entry, mapping, len, base_flags, | 3636 | tg3_set_txd(tp, entry, mapping, len, base_flags, |
3630 | (skb_shinfo(skb)->nr_frags == 0) | (mss << 1)); | 3637 | (skb_shinfo(skb)->nr_frags == 0) | (mss << 1)); |
@@ -3648,12 +3655,8 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3648 | tp->tx_buffers[entry].skb = NULL; | 3655 | tp->tx_buffers[entry].skb = NULL; |
3649 | pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping); | 3656 | pci_unmap_addr_set(&tp->tx_buffers[entry], mapping, mapping); |
3650 | 3657 | ||
3651 | if (tg3_4g_overflow_test(mapping, len)) { | 3658 | if (tg3_4g_overflow_test(mapping, len)) |
3652 | /* Only one should match. */ | 3659 | would_hit_hwbug = 1; |
3653 | if (would_hit_hwbug) | ||
3654 | BUG(); | ||
3655 | would_hit_hwbug = entry + 1; | ||
3656 | } | ||
3657 | 3660 | ||
3658 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) | 3661 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) |
3659 | tg3_set_txd(tp, entry, mapping, len, | 3662 | tg3_set_txd(tp, entry, mapping, len, |
@@ -3669,34 +3672,15 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3669 | if (would_hit_hwbug) { | 3672 | if (would_hit_hwbug) { |
3670 | u32 last_plus_one = entry; | 3673 | u32 last_plus_one = entry; |
3671 | u32 start; | 3674 | u32 start; |
3672 | unsigned int len = 0; | ||
3673 | |||
3674 | would_hit_hwbug -= 1; | ||
3675 | entry = entry - 1 - skb_shinfo(skb)->nr_frags; | ||
3676 | entry &= (TG3_TX_RING_SIZE - 1); | ||
3677 | start = entry; | ||
3678 | i = 0; | ||
3679 | while (entry != last_plus_one) { | ||
3680 | if (i == 0) | ||
3681 | len = skb_headlen(skb); | ||
3682 | else | ||
3683 | len = skb_shinfo(skb)->frags[i-1].size; | ||
3684 | 3675 | ||
3685 | if (entry == would_hit_hwbug) | 3676 | start = entry - 1 - skb_shinfo(skb)->nr_frags; |
3686 | break; | 3677 | start &= (TG3_TX_RING_SIZE - 1); |
3687 | |||
3688 | i++; | ||
3689 | entry = NEXT_TX(entry); | ||
3690 | |||
3691 | } | ||
3692 | 3678 | ||
3693 | /* If the workaround fails due to memory/mapping | 3679 | /* If the workaround fails due to memory/mapping |
3694 | * failure, silently drop this packet. | 3680 | * failure, silently drop this packet. |
3695 | */ | 3681 | */ |
3696 | if (tigon3_4gb_hwbug_workaround(tp, skb, | 3682 | if (tigon3_4gb_hwbug_workaround(tp, skb, last_plus_one, |
3697 | entry, len, | 3683 | &start, base_flags, mss)) |
3698 | last_plus_one, | ||
3699 | &start, mss)) | ||
3700 | goto out_unlock; | 3684 | goto out_unlock; |
3701 | 3685 | ||
3702 | entry = start; | 3686 | entry = start; |
@@ -9271,6 +9255,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
9271 | static struct pci_device_id write_reorder_chipsets[] = { | 9255 | static struct pci_device_id write_reorder_chipsets[] = { |
9272 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, | 9256 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, |
9273 | PCI_DEVICE_ID_AMD_FE_GATE_700C) }, | 9257 | PCI_DEVICE_ID_AMD_FE_GATE_700C) }, |
9258 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, | ||
9259 | PCI_DEVICE_ID_AMD_K8_NB) }, | ||
9274 | { }, | 9260 | { }, |
9275 | }; | 9261 | }; |
9276 | u32 misc_ctrl_reg; | 9262 | u32 misc_ctrl_reg; |
@@ -9285,7 +9271,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
9285 | tp->tg3_flags2 |= TG3_FLG2_SUN_570X; | 9271 | tp->tg3_flags2 |= TG3_FLG2_SUN_570X; |
9286 | #endif | 9272 | #endif |
9287 | 9273 | ||
9288 | /* If we have an AMD 762 chipset, write | 9274 | /* If we have an AMD 762 or K8 chipset, write |
9289 | * reordering to the mailbox registers done by the host | 9275 | * reordering to the mailbox registers done by the host |
9290 | * controller can cause major troubles. We read back from | 9276 | * controller can cause major troubles. We read back from |
9291 | * every mailbox register write to force the writes to be | 9277 | * every mailbox register write to force the writes to be |
@@ -9532,7 +9518,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
9532 | tp->write32_rx_mbox = tg3_write_indirect_mbox; | 9518 | tp->write32_rx_mbox = tg3_write_indirect_mbox; |
9533 | 9519 | ||
9534 | iounmap(tp->regs); | 9520 | iounmap(tp->regs); |
9535 | tp->regs = 0; | 9521 | tp->regs = NULL; |
9536 | 9522 | ||
9537 | pci_read_config_word(tp->pdev, PCI_COMMAND, &pci_cmd); | 9523 | pci_read_config_word(tp->pdev, PCI_COMMAND, &pci_cmd); |
9538 | pci_cmd &= ~PCI_COMMAND_MEMORY; | 9524 | pci_cmd &= ~PCI_COMMAND_MEMORY; |
@@ -10680,7 +10666,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
10680 | err_out_iounmap: | 10666 | err_out_iounmap: |
10681 | if (tp->regs) { | 10667 | if (tp->regs) { |
10682 | iounmap(tp->regs); | 10668 | iounmap(tp->regs); |
10683 | tp->regs = 0; | 10669 | tp->regs = NULL; |
10684 | } | 10670 | } |
10685 | 10671 | ||
10686 | err_out_free_dev: | 10672 | err_out_free_dev: |
@@ -10705,7 +10691,7 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev) | |||
10705 | unregister_netdev(dev); | 10691 | unregister_netdev(dev); |
10706 | if (tp->regs) { | 10692 | if (tp->regs) { |
10707 | iounmap(tp->regs); | 10693 | iounmap(tp->regs); |
10708 | tp->regs = 0; | 10694 | tp->regs = NULL; |
10709 | } | 10695 | } |
10710 | free_netdev(dev); | 10696 | free_netdev(dev); |
10711 | pci_release_regions(pdev); | 10697 | pci_release_regions(pdev); |
diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c index 8122fe734aa7..b1ba429e0a2d 100644 --- a/drivers/pci/hotplug/ibmphp_pci.c +++ b/drivers/pci/hotplug/ibmphp_pci.c | |||
@@ -558,7 +558,7 @@ static int configure_device (struct pci_func *func) | |||
558 | pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_CACHE_LINE_SIZE, CACHE); | 558 | pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_CACHE_LINE_SIZE, CACHE); |
559 | pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_LATENCY_TIMER, LATENCY); | 559 | pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_LATENCY_TIMER, LATENCY); |
560 | 560 | ||
561 | pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_ROM_ADDRESS, 0x00L); | 561 | pci_bus_write_config_dword (ibmphp_pci_bus, devfn, PCI_ROM_ADDRESS, 0x00L); |
562 | pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_COMMAND, DEVICEENABLE); | 562 | pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_COMMAND, DEVICEENABLE); |
563 | 563 | ||
564 | return 0; | 564 | return 0; |
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index 0e0947601526..898f6da6f0de 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -2526,7 +2526,6 @@ configure_new_function(struct controller *ctrl, struct pci_func *func, | |||
2526 | int cloop; | 2526 | int cloop; |
2527 | u8 temp_byte; | 2527 | u8 temp_byte; |
2528 | u8 class_code; | 2528 | u8 class_code; |
2529 | u16 temp_word; | ||
2530 | u32 rc; | 2529 | u32 rc; |
2531 | u32 temp_register; | 2530 | u32 temp_register; |
2532 | u32 base; | 2531 | u32 base; |
@@ -2682,8 +2681,7 @@ configure_new_function(struct controller *ctrl, struct pci_func *func, | |||
2682 | } /* End of base register loop */ | 2681 | } /* End of base register loop */ |
2683 | 2682 | ||
2684 | /* disable ROM base Address */ | 2683 | /* disable ROM base Address */ |
2685 | temp_word = 0x00L; | 2684 | rc = pci_bus_write_config_dword (pci_bus, devfn, PCI_ROM_ADDRESS, 0x00); |
2686 | rc = pci_bus_write_config_word (pci_bus, devfn, PCI_ROM_ADDRESS, temp_word); | ||
2687 | 2685 | ||
2688 | /* Set HP parameters (Cache Line Size, Latency Timer) */ | 2686 | /* Set HP parameters (Cache Line Size, Latency Timer) */ |
2689 | rc = pciehprm_set_hpp(ctrl, func, PCI_HEADER_TYPE_NORMAL); | 2687 | rc = pciehprm_set_hpp(ctrl, func, PCI_HEADER_TYPE_NORMAL); |
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index 783b5abb0717..91c9903e621f 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -2824,8 +2824,7 @@ static int configure_new_function (struct controller * ctrl, struct pci_func * f | |||
2824 | } | 2824 | } |
2825 | #endif | 2825 | #endif |
2826 | /* Disable ROM base Address */ | 2826 | /* Disable ROM base Address */ |
2827 | temp_word = 0x00L; | 2827 | rc = pci_bus_write_config_dword (pci_bus, devfn, PCI_ROM_ADDRESS, 0x00); |
2828 | rc = pci_bus_write_config_word (pci_bus, devfn, PCI_ROM_ADDRESS, temp_word); | ||
2829 | 2828 | ||
2830 | /* Set HP parameters (Cache Line Size, Latency Timer) */ | 2829 | /* Set HP parameters (Cache Line Size, Latency Timer) */ |
2831 | rc = shpchprm_set_hpp(ctrl, func, PCI_HEADER_TYPE_NORMAL); | 2830 | rc = shpchprm_set_hpp(ctrl, func, PCI_HEADER_TYPE_NORMAL); |
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c index aac83ce6469c..a1c52a682191 100644 --- a/drivers/s390/cio/blacklist.c +++ b/drivers/s390/cio/blacklist.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/s390/cio/blacklist.c | 2 | * drivers/s390/cio/blacklist.c |
3 | * S/390 common I/O routines -- blacklisting of specific devices | 3 | * S/390 common I/O routines -- blacklisting of specific devices |
4 | * $Revision: 1.34 $ | 4 | * $Revision: 1.35 $ |
5 | * | 5 | * |
6 | * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, | 6 | * Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH, |
7 | * IBM Corporation | 7 | * IBM Corporation |
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | /* 65536 bits to indicate if a devno is blacklisted or not */ | 37 | /* 65536 bits to indicate if a devno is blacklisted or not */ |
38 | #define __BL_DEV_WORDS (__MAX_SUBCHANNELS + (8*sizeof(long) - 1) / \ | 38 | #define __BL_DEV_WORDS ((__MAX_SUBCHANNELS + (8*sizeof(long) - 1)) / \ |
39 | (8*sizeof(long))) | 39 | (8*sizeof(long))) |
40 | static unsigned long bl_dev[__BL_DEV_WORDS]; | 40 | static unsigned long bl_dev[__BL_DEV_WORDS]; |
41 | typedef enum {add, free} range_action; | 41 | typedef enum {add, free} range_action; |
diff --git a/drivers/s390/crypto/z90main.c b/drivers/s390/crypto/z90main.c index 6aeef3bacc33..0cb47eca91f3 100644 --- a/drivers/s390/crypto/z90main.c +++ b/drivers/s390/crypto/z90main.c | |||
@@ -682,9 +682,6 @@ z90crypt_cleanup_module(void) | |||
682 | del_timer(&config_timer); | 682 | del_timer(&config_timer); |
683 | del_timer(&cleanup_timer); | 683 | del_timer(&cleanup_timer); |
684 | 684 | ||
685 | if (z90_device_work) | ||
686 | destroy_workqueue(z90_device_work); | ||
687 | |||
688 | destroy_z90crypt(); | 685 | destroy_z90crypt(); |
689 | 686 | ||
690 | PRINTKN("Unloaded.\n"); | 687 | PRINTKN("Unloaded.\n"); |
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 3a0285669adf..2ad4797ce024 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include "qeth_mpc.h" | 25 | #include "qeth_mpc.h" |
26 | 26 | ||
27 | #define VERSION_QETH_H "$Revision: 1.139 $" | 27 | #define VERSION_QETH_H "$Revision: 1.142 $" |
28 | 28 | ||
29 | #ifdef CONFIG_QETH_IPV6 | 29 | #ifdef CONFIG_QETH_IPV6 |
30 | #define QETH_VERSION_IPV6 ":IPv6" | 30 | #define QETH_VERSION_IPV6 ":IPv6" |
@@ -1172,7 +1172,7 @@ extern int | |||
1172 | qeth_realloc_buffer_pool(struct qeth_card *, int); | 1172 | qeth_realloc_buffer_pool(struct qeth_card *, int); |
1173 | 1173 | ||
1174 | extern int | 1174 | extern int |
1175 | qeth_set_large_send(struct qeth_card *); | 1175 | qeth_set_large_send(struct qeth_card *, enum qeth_large_send_types); |
1176 | 1176 | ||
1177 | extern void | 1177 | extern void |
1178 | qeth_fill_header(struct qeth_card *, struct qeth_hdr *, | 1178 | qeth_fill_header(struct qeth_card *, struct qeth_hdr *, |
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 79c74f3a11f5..86582cf1e19e 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * linux/drivers/s390/net/qeth_main.c ($Revision: 1.214 $) | 3 | * linux/drivers/s390/net/qeth_main.c ($Revision: 1.224 $) |
4 | * | 4 | * |
5 | * Linux on zSeries OSA Express and HiperSockets support | 5 | * Linux on zSeries OSA Express and HiperSockets support |
6 | * | 6 | * |
@@ -12,7 +12,7 @@ | |||
12 | * Frank Pavlic (pavlic@de.ibm.com) and | 12 | * Frank Pavlic (pavlic@de.ibm.com) and |
13 | * Thomas Spatzier <tspat@de.ibm.com> | 13 | * Thomas Spatzier <tspat@de.ibm.com> |
14 | * | 14 | * |
15 | * $Revision: 1.214 $ $Date: 2005/05/04 20:19:18 $ | 15 | * $Revision: 1.224 $ $Date: 2005/05/04 20:19:18 $ |
16 | * | 16 | * |
17 | * This program is free software; you can redistribute it and/or modify | 17 | * This program is free software; you can redistribute it and/or modify |
18 | * it under the terms of the GNU General Public License as published by | 18 | * it under the terms of the GNU General Public License as published by |
@@ -29,14 +29,6 @@ | |||
29 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 29 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | /*** | ||
33 | * eye catcher; just for debugging purposes | ||
34 | */ | ||
35 | void volatile | ||
36 | qeth_eyecatcher(void) | ||
37 | { | ||
38 | return; | ||
39 | } | ||
40 | 32 | ||
41 | #include <linux/config.h> | 33 | #include <linux/config.h> |
42 | #include <linux/module.h> | 34 | #include <linux/module.h> |
@@ -80,7 +72,7 @@ qeth_eyecatcher(void) | |||
80 | #include "qeth_eddp.h" | 72 | #include "qeth_eddp.h" |
81 | #include "qeth_tso.h" | 73 | #include "qeth_tso.h" |
82 | 74 | ||
83 | #define VERSION_QETH_C "$Revision: 1.214 $" | 75 | #define VERSION_QETH_C "$Revision: 1.224 $" |
84 | static const char *version = "qeth S/390 OSA-Express driver"; | 76 | static const char *version = "qeth S/390 OSA-Express driver"; |
85 | 77 | ||
86 | /** | 78 | /** |
@@ -2759,11 +2751,9 @@ qeth_flush_buffers(struct qeth_qdio_out_q *queue, int under_int, | |||
2759 | queue->card->perf_stats.outbound_do_qdio_start_time; | 2751 | queue->card->perf_stats.outbound_do_qdio_start_time; |
2760 | #endif | 2752 | #endif |
2761 | if (rc){ | 2753 | if (rc){ |
2762 | QETH_DBF_SPRINTF(trace, 0, "qeth_flush_buffers: do_QDIO " | ||
2763 | "returned error (%i) on device %s.", | ||
2764 | rc, CARD_DDEV_ID(queue->card)); | ||
2765 | QETH_DBF_TEXT(trace, 2, "flushbuf"); | 2754 | QETH_DBF_TEXT(trace, 2, "flushbuf"); |
2766 | QETH_DBF_TEXT_(trace, 2, " err%d", rc); | 2755 | QETH_DBF_TEXT_(trace, 2, " err%d", rc); |
2756 | QETH_DBF_TEXT_(trace, 2, "%s", CARD_DDEV_ID(queue->card)); | ||
2767 | queue->card->stats.tx_errors += count; | 2757 | queue->card->stats.tx_errors += count; |
2768 | /* this must not happen under normal circumstances. if it | 2758 | /* this must not happen under normal circumstances. if it |
2769 | * happens something is really wrong -> recover */ | 2759 | * happens something is really wrong -> recover */ |
@@ -2909,11 +2899,8 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status, | |||
2909 | QETH_DBF_TEXT(trace, 6, "qdouhdl"); | 2899 | QETH_DBF_TEXT(trace, 6, "qdouhdl"); |
2910 | if (status & QDIO_STATUS_LOOK_FOR_ERROR) { | 2900 | if (status & QDIO_STATUS_LOOK_FOR_ERROR) { |
2911 | if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION){ | 2901 | if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION){ |
2912 | QETH_DBF_SPRINTF(trace, 2, "On device %s: " | 2902 | QETH_DBF_TEXT(trace, 2, "achkcond"); |
2913 | "received active check " | 2903 | QETH_DBF_TEXT_(trace, 2, "%s", CARD_BUS_ID(card)); |
2914 | "condition (0x%08x).", | ||
2915 | CARD_BUS_ID(card), status); | ||
2916 | QETH_DBF_TEXT(trace, 2, "chkcond"); | ||
2917 | QETH_DBF_TEXT_(trace, 2, "%08x", status); | 2904 | QETH_DBF_TEXT_(trace, 2, "%08x", status); |
2918 | netif_stop_queue(card->dev); | 2905 | netif_stop_queue(card->dev); |
2919 | qeth_schedule_recovery(card); | 2906 | qeth_schedule_recovery(card); |
@@ -3356,26 +3343,32 @@ qeth_halt_channel(struct qeth_channel *channel) | |||
3356 | static int | 3343 | static int |
3357 | qeth_halt_channels(struct qeth_card *card) | 3344 | qeth_halt_channels(struct qeth_card *card) |
3358 | { | 3345 | { |
3359 | int rc = 0; | 3346 | int rc1 = 0, rc2=0, rc3 = 0; |
3360 | 3347 | ||
3361 | QETH_DBF_TEXT(trace,3,"haltchs"); | 3348 | QETH_DBF_TEXT(trace,3,"haltchs"); |
3362 | if ((rc = qeth_halt_channel(&card->read))) | 3349 | rc1 = qeth_halt_channel(&card->read); |
3363 | return rc; | 3350 | rc2 = qeth_halt_channel(&card->write); |
3364 | if ((rc = qeth_halt_channel(&card->write))) | 3351 | rc3 = qeth_halt_channel(&card->data); |
3365 | return rc; | 3352 | if (rc1) |
3366 | return qeth_halt_channel(&card->data); | 3353 | return rc1; |
3354 | if (rc2) | ||
3355 | return rc2; | ||
3356 | return rc3; | ||
3367 | } | 3357 | } |
3368 | static int | 3358 | static int |
3369 | qeth_clear_channels(struct qeth_card *card) | 3359 | qeth_clear_channels(struct qeth_card *card) |
3370 | { | 3360 | { |
3371 | int rc = 0; | 3361 | int rc1 = 0, rc2=0, rc3 = 0; |
3372 | 3362 | ||
3373 | QETH_DBF_TEXT(trace,3,"clearchs"); | 3363 | QETH_DBF_TEXT(trace,3,"clearchs"); |
3374 | if ((rc = qeth_clear_channel(&card->read))) | 3364 | rc1 = qeth_clear_channel(&card->read); |
3375 | return rc; | 3365 | rc2 = qeth_clear_channel(&card->write); |
3376 | if ((rc = qeth_clear_channel(&card->write))) | 3366 | rc3 = qeth_clear_channel(&card->data); |
3377 | return rc; | 3367 | if (rc1) |
3378 | return qeth_clear_channel(&card->data); | 3368 | return rc1; |
3369 | if (rc2) | ||
3370 | return rc2; | ||
3371 | return rc3; | ||
3379 | } | 3372 | } |
3380 | 3373 | ||
3381 | static int | 3374 | static int |
@@ -3445,23 +3438,23 @@ qeth_mpc_initialize(struct qeth_card *card) | |||
3445 | } | 3438 | } |
3446 | if ((rc = qeth_cm_enable(card))){ | 3439 | if ((rc = qeth_cm_enable(card))){ |
3447 | QETH_DBF_TEXT_(setup, 2, "2err%d", rc); | 3440 | QETH_DBF_TEXT_(setup, 2, "2err%d", rc); |
3448 | return rc; | 3441 | goto out_qdio; |
3449 | } | 3442 | } |
3450 | if ((rc = qeth_cm_setup(card))){ | 3443 | if ((rc = qeth_cm_setup(card))){ |
3451 | QETH_DBF_TEXT_(setup, 2, "3err%d", rc); | 3444 | QETH_DBF_TEXT_(setup, 2, "3err%d", rc); |
3452 | return rc; | 3445 | goto out_qdio; |
3453 | } | 3446 | } |
3454 | if ((rc = qeth_ulp_enable(card))){ | 3447 | if ((rc = qeth_ulp_enable(card))){ |
3455 | QETH_DBF_TEXT_(setup, 2, "4err%d", rc); | 3448 | QETH_DBF_TEXT_(setup, 2, "4err%d", rc); |
3456 | return rc; | 3449 | goto out_qdio; |
3457 | } | 3450 | } |
3458 | if ((rc = qeth_ulp_setup(card))){ | 3451 | if ((rc = qeth_ulp_setup(card))){ |
3459 | QETH_DBF_TEXT_(setup, 2, "5err%d", rc); | 3452 | QETH_DBF_TEXT_(setup, 2, "5err%d", rc); |
3460 | return rc; | 3453 | goto out_qdio; |
3461 | } | 3454 | } |
3462 | if ((rc = qeth_alloc_qdio_buffers(card))){ | 3455 | if ((rc = qeth_alloc_qdio_buffers(card))){ |
3463 | QETH_DBF_TEXT_(setup, 2, "5err%d", rc); | 3456 | QETH_DBF_TEXT_(setup, 2, "5err%d", rc); |
3464 | return rc; | 3457 | goto out_qdio; |
3465 | } | 3458 | } |
3466 | if ((rc = qeth_qdio_establish(card))){ | 3459 | if ((rc = qeth_qdio_establish(card))){ |
3467 | QETH_DBF_TEXT_(setup, 2, "6err%d", rc); | 3460 | QETH_DBF_TEXT_(setup, 2, "6err%d", rc); |
@@ -3795,12 +3788,16 @@ static inline int | |||
3795 | qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb, | 3788 | qeth_prepare_skb(struct qeth_card *card, struct sk_buff **skb, |
3796 | struct qeth_hdr **hdr, int ipv) | 3789 | struct qeth_hdr **hdr, int ipv) |
3797 | { | 3790 | { |
3791 | int rc; | ||
3798 | #ifdef CONFIG_QETH_VLAN | 3792 | #ifdef CONFIG_QETH_VLAN |
3799 | u16 *tag; | 3793 | u16 *tag; |
3800 | #endif | 3794 | #endif |
3801 | 3795 | ||
3802 | QETH_DBF_TEXT(trace, 6, "prepskb"); | 3796 | QETH_DBF_TEXT(trace, 6, "prepskb"); |
3803 | 3797 | ||
3798 | rc = qeth_realloc_headroom(card, skb, sizeof(struct qeth_hdr)); | ||
3799 | if (rc) | ||
3800 | return rc; | ||
3804 | #ifdef CONFIG_QETH_VLAN | 3801 | #ifdef CONFIG_QETH_VLAN |
3805 | if (card->vlangrp && vlan_tx_tag_present(*skb) && | 3802 | if (card->vlangrp && vlan_tx_tag_present(*skb) && |
3806 | ((ipv == 6) || card->options.layer2) ) { | 3803 | ((ipv == 6) || card->options.layer2) ) { |
@@ -4251,7 +4248,8 @@ out: | |||
4251 | } | 4248 | } |
4252 | 4249 | ||
4253 | static inline int | 4250 | static inline int |
4254 | qeth_get_elements_no(struct qeth_card *card, void *hdr, struct sk_buff *skb) | 4251 | qeth_get_elements_no(struct qeth_card *card, void *hdr, |
4252 | struct sk_buff *skb, int elems) | ||
4255 | { | 4253 | { |
4256 | int elements_needed = 0; | 4254 | int elements_needed = 0; |
4257 | 4255 | ||
@@ -4261,9 +4259,10 @@ qeth_get_elements_no(struct qeth_card *card, void *hdr, struct sk_buff *skb) | |||
4261 | if (elements_needed == 0 ) | 4259 | if (elements_needed == 0 ) |
4262 | elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE) | 4260 | elements_needed = 1 + (((((unsigned long) hdr) % PAGE_SIZE) |
4263 | + skb->len) >> PAGE_SHIFT); | 4261 | + skb->len) >> PAGE_SHIFT); |
4264 | if (elements_needed > QETH_MAX_BUFFER_ELEMENTS(card)){ | 4262 | if ((elements_needed + elems) > QETH_MAX_BUFFER_ELEMENTS(card)){ |
4265 | PRINT_ERR("qeth_do_send_packet: invalid size of " | 4263 | PRINT_ERR("qeth_do_send_packet: invalid size of " |
4266 | "IP packet. Discarded."); | 4264 | "IP packet (Number=%d / Length=%d). Discarded.\n", |
4265 | (elements_needed+elems), skb->len); | ||
4267 | return 0; | 4266 | return 0; |
4268 | } | 4267 | } |
4269 | return elements_needed; | 4268 | return elements_needed; |
@@ -4275,7 +4274,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) | |||
4275 | int ipv = 0; | 4274 | int ipv = 0; |
4276 | int cast_type; | 4275 | int cast_type; |
4277 | struct qeth_qdio_out_q *queue; | 4276 | struct qeth_qdio_out_q *queue; |
4278 | struct qeth_hdr *hdr; | 4277 | struct qeth_hdr *hdr = NULL; |
4279 | int elements_needed = 0; | 4278 | int elements_needed = 0; |
4280 | enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; | 4279 | enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; |
4281 | struct qeth_eddp_context *ctx = NULL; | 4280 | struct qeth_eddp_context *ctx = NULL; |
@@ -4337,9 +4336,11 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb) | |||
4337 | return -EINVAL; | 4336 | return -EINVAL; |
4338 | } | 4337 | } |
4339 | } else { | 4338 | } else { |
4340 | elements_needed += qeth_get_elements_no(card,(void*) hdr, skb); | 4339 | int elems = qeth_get_elements_no(card,(void*) hdr, skb, |
4341 | if (!elements_needed) | 4340 | elements_needed); |
4341 | if (!elems) | ||
4342 | return -EINVAL; | 4342 | return -EINVAL; |
4343 | elements_needed += elems; | ||
4343 | } | 4344 | } |
4344 | 4345 | ||
4345 | if (card->info.type != QETH_CARD_TYPE_IQD) | 4346 | if (card->info.type != QETH_CARD_TYPE_IQD) |
@@ -4504,7 +4505,11 @@ qeth_arp_set_no_entries(struct qeth_card *card, int no_entries) | |||
4504 | 4505 | ||
4505 | QETH_DBF_TEXT(trace,3,"arpstnoe"); | 4506 | QETH_DBF_TEXT(trace,3,"arpstnoe"); |
4506 | 4507 | ||
4507 | /* TODO: really not supported by GuestLAN? */ | 4508 | /* |
4509 | * currently GuestLAN only supports the ARP assist function | ||
4510 | * IPA_CMD_ASS_ARP_QUERY_INFO, but not IPA_CMD_ASS_ARP_SET_NO_ENTRIES; | ||
4511 | * thus we say EOPNOTSUPP for this ARP function | ||
4512 | */ | ||
4508 | if (card->info.guestlan) | 4513 | if (card->info.guestlan) |
4509 | return -EOPNOTSUPP; | 4514 | return -EOPNOTSUPP; |
4510 | if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) { | 4515 | if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) { |
@@ -4681,14 +4686,6 @@ qeth_arp_query(struct qeth_card *card, char *udata) | |||
4681 | 4686 | ||
4682 | QETH_DBF_TEXT(trace,3,"arpquery"); | 4687 | QETH_DBF_TEXT(trace,3,"arpquery"); |
4683 | 4688 | ||
4684 | /* | ||
4685 | * currently GuestLAN does only deliver all zeros on query arp, | ||
4686 | * even though arp processing is supported (according to IPA supp. | ||
4687 | * funcs flags); since all zeros is no valueable information, | ||
4688 | * we say EOPNOTSUPP for all ARP functions | ||
4689 | */ | ||
4690 | /*if (card->info.guestlan) | ||
4691 | return -EOPNOTSUPP; */ | ||
4692 | if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/ | 4689 | if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/ |
4693 | IPA_ARP_PROCESSING)) { | 4690 | IPA_ARP_PROCESSING)) { |
4694 | PRINT_WARN("ARP processing not supported " | 4691 | PRINT_WARN("ARP processing not supported " |
@@ -4894,10 +4891,9 @@ qeth_arp_add_entry(struct qeth_card *card, struct qeth_arp_cache_entry *entry) | |||
4894 | QETH_DBF_TEXT(trace,3,"arpadent"); | 4891 | QETH_DBF_TEXT(trace,3,"arpadent"); |
4895 | 4892 | ||
4896 | /* | 4893 | /* |
4897 | * currently GuestLAN does only deliver all zeros on query arp, | 4894 | * currently GuestLAN only supports the ARP assist function |
4898 | * even though arp processing is supported (according to IPA supp. | 4895 | * IPA_CMD_ASS_ARP_QUERY_INFO, but not IPA_CMD_ASS_ARP_ADD_ENTRY; |
4899 | * funcs flags); since all zeros is no valueable information, | 4896 | * thus we say EOPNOTSUPP for this ARP function |
4900 | * we say EOPNOTSUPP for all ARP functions | ||
4901 | */ | 4897 | */ |
4902 | if (card->info.guestlan) | 4898 | if (card->info.guestlan) |
4903 | return -EOPNOTSUPP; | 4899 | return -EOPNOTSUPP; |
@@ -4937,10 +4933,9 @@ qeth_arp_remove_entry(struct qeth_card *card, struct qeth_arp_cache_entry *entry | |||
4937 | QETH_DBF_TEXT(trace,3,"arprment"); | 4933 | QETH_DBF_TEXT(trace,3,"arprment"); |
4938 | 4934 | ||
4939 | /* | 4935 | /* |
4940 | * currently GuestLAN does only deliver all zeros on query arp, | 4936 | * currently GuestLAN only supports the ARP assist function |
4941 | * even though arp processing is supported (according to IPA supp. | 4937 | * IPA_CMD_ASS_ARP_QUERY_INFO, but not IPA_CMD_ASS_ARP_REMOVE_ENTRY; |
4942 | * funcs flags); since all zeros is no valueable information, | 4938 | * thus we say EOPNOTSUPP for this ARP function |
4943 | * we say EOPNOTSUPP for all ARP functions | ||
4944 | */ | 4939 | */ |
4945 | if (card->info.guestlan) | 4940 | if (card->info.guestlan) |
4946 | return -EOPNOTSUPP; | 4941 | return -EOPNOTSUPP; |
@@ -4978,11 +4973,10 @@ qeth_arp_flush_cache(struct qeth_card *card) | |||
4978 | QETH_DBF_TEXT(trace,3,"arpflush"); | 4973 | QETH_DBF_TEXT(trace,3,"arpflush"); |
4979 | 4974 | ||
4980 | /* | 4975 | /* |
4981 | * currently GuestLAN does only deliver all zeros on query arp, | 4976 | * currently GuestLAN only supports the ARP assist function |
4982 | * even though arp processing is supported (according to IPA supp. | 4977 | * IPA_CMD_ASS_ARP_QUERY_INFO, but not IPA_CMD_ASS_ARP_FLUSH_CACHE; |
4983 | * funcs flags); since all zeros is no valueable information, | 4978 | * thus we say EOPNOTSUPP for this ARP function |
4984 | * we say EOPNOTSUPP for all ARP functions | 4979 | */ |
4985 | */ | ||
4986 | if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD)) | 4980 | if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD)) |
4987 | return -EOPNOTSUPP; | 4981 | return -EOPNOTSUPP; |
4988 | if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) { | 4982 | if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) { |
@@ -7038,14 +7032,16 @@ qeth_setrouting_v6(struct qeth_card *card) | |||
7038 | } | 7032 | } |
7039 | 7033 | ||
7040 | int | 7034 | int |
7041 | qeth_set_large_send(struct qeth_card *card) | 7035 | qeth_set_large_send(struct qeth_card *card, enum qeth_large_send_types type) |
7042 | { | 7036 | { |
7043 | int rc = 0; | 7037 | int rc = 0; |
7044 | 7038 | ||
7045 | if (card->dev == NULL) | 7039 | if (card->dev == NULL) { |
7040 | card->options.large_send = type; | ||
7046 | return 0; | 7041 | return 0; |
7047 | 7042 | } | |
7048 | netif_stop_queue(card->dev); | 7043 | netif_stop_queue(card->dev); |
7044 | card->options.large_send = type; | ||
7049 | switch (card->options.large_send) { | 7045 | switch (card->options.large_send) { |
7050 | case QETH_LARGE_SEND_EDDP: | 7046 | case QETH_LARGE_SEND_EDDP: |
7051 | card->dev->features |= NETIF_F_TSO | NETIF_F_SG; | 7047 | card->dev->features |= NETIF_F_TSO | NETIF_F_SG; |
@@ -7066,7 +7062,6 @@ qeth_set_large_send(struct qeth_card *card) | |||
7066 | card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); | 7062 | card->dev->features &= ~(NETIF_F_TSO | NETIF_F_SG); |
7067 | break; | 7063 | break; |
7068 | } | 7064 | } |
7069 | |||
7070 | netif_wake_queue(card->dev); | 7065 | netif_wake_queue(card->dev); |
7071 | return rc; | 7066 | return rc; |
7072 | } | 7067 | } |
@@ -8257,7 +8252,6 @@ qeth_init(void) | |||
8257 | { | 8252 | { |
8258 | int rc=0; | 8253 | int rc=0; |
8259 | 8254 | ||
8260 | qeth_eyecatcher(); | ||
8261 | PRINT_INFO("loading %s (%s/%s/%s/%s/%s/%s/%s %s %s)\n", | 8255 | PRINT_INFO("loading %s (%s/%s/%s/%s/%s/%s/%s %s %s)\n", |
8262 | version, VERSION_QETH_C, VERSION_QETH_H, | 8256 | version, VERSION_QETH_C, VERSION_QETH_H, |
8263 | VERSION_QETH_MPC_H, VERSION_QETH_MPC_C, | 8257 | VERSION_QETH_MPC_H, VERSION_QETH_MPC_C, |
@@ -8338,7 +8332,6 @@ again: | |||
8338 | printk("qeth: removed\n"); | 8332 | printk("qeth: removed\n"); |
8339 | } | 8333 | } |
8340 | 8334 | ||
8341 | EXPORT_SYMBOL(qeth_eyecatcher); | ||
8342 | module_init(qeth_init); | 8335 | module_init(qeth_init); |
8343 | module_exit(qeth_exit); | 8336 | module_exit(qeth_exit); |
8344 | MODULE_AUTHOR("Frank Pavlic <pavlic@de.ibm.com>"); | 8337 | MODULE_AUTHOR("Frank Pavlic <pavlic@de.ibm.com>"); |
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index 98bedb0cb387..dda105b73063 100644 --- a/drivers/s390/net/qeth_sys.c +++ b/drivers/s390/net/qeth_sys.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.51 $) | 3 | * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.54 $) |
4 | * | 4 | * |
5 | * Linux on zSeries OSA Express and HiperSockets support | 5 | * Linux on zSeries OSA Express and HiperSockets support |
6 | * This file contains code related to sysfs. | 6 | * This file contains code related to sysfs. |
@@ -20,7 +20,7 @@ | |||
20 | #include "qeth_mpc.h" | 20 | #include "qeth_mpc.h" |
21 | #include "qeth_fs.h" | 21 | #include "qeth_fs.h" |
22 | 22 | ||
23 | const char *VERSION_QETH_SYS_C = "$Revision: 1.51 $"; | 23 | const char *VERSION_QETH_SYS_C = "$Revision: 1.54 $"; |
24 | 24 | ||
25 | /*****************************************************************************/ | 25 | /*****************************************************************************/ |
26 | /* */ | 26 | /* */ |
@@ -722,10 +722,13 @@ qeth_dev_layer2_store(struct device *dev, struct device_attribute *attr, const c | |||
722 | 722 | ||
723 | if (!card) | 723 | if (!card) |
724 | return -EINVAL; | 724 | return -EINVAL; |
725 | if (card->info.type == QETH_CARD_TYPE_IQD) { | ||
726 | PRINT_WARN("Layer2 on Hipersockets is not supported! \n"); | ||
727 | return -EPERM; | ||
728 | } | ||
725 | 729 | ||
726 | if (((card->state != CARD_STATE_DOWN) && | 730 | if (((card->state != CARD_STATE_DOWN) && |
727 | (card->state != CARD_STATE_RECOVER)) || | 731 | (card->state != CARD_STATE_RECOVER))) |
728 | (card->info.type != QETH_CARD_TYPE_OSAE)) | ||
729 | return -EPERM; | 732 | return -EPERM; |
730 | 733 | ||
731 | i = simple_strtoul(buf, &tmp, 16); | 734 | i = simple_strtoul(buf, &tmp, 16); |
@@ -771,9 +774,7 @@ qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, con | |||
771 | 774 | ||
772 | if (!card) | 775 | if (!card) |
773 | return -EINVAL; | 776 | return -EINVAL; |
774 | |||
775 | tmp = strsep((char **) &buf, "\n"); | 777 | tmp = strsep((char **) &buf, "\n"); |
776 | |||
777 | if (!strcmp(tmp, "no")){ | 778 | if (!strcmp(tmp, "no")){ |
778 | type = QETH_LARGE_SEND_NO; | 779 | type = QETH_LARGE_SEND_NO; |
779 | } else if (!strcmp(tmp, "EDDP")) { | 780 | } else if (!strcmp(tmp, "EDDP")) { |
@@ -786,10 +787,8 @@ qeth_dev_large_send_store(struct device *dev, struct device_attribute *attr, con | |||
786 | } | 787 | } |
787 | if (card->options.large_send == type) | 788 | if (card->options.large_send == type) |
788 | return count; | 789 | return count; |
789 | card->options.large_send = type; | 790 | if ((rc = qeth_set_large_send(card, type))) |
790 | if ((rc = qeth_set_large_send(card))) | ||
791 | return rc; | 791 | return rc; |
792 | |||
793 | return count; | 792 | return count; |
794 | } | 793 | } |
795 | 794 | ||
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 5cc53cd9323e..d92273cbe0de 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -2465,9 +2465,12 @@ static unsigned long ata_pio_poll(struct ata_port *ap) | |||
2465 | * | 2465 | * |
2466 | * LOCKING: | 2466 | * LOCKING: |
2467 | * None. (executing in kernel thread context) | 2467 | * None. (executing in kernel thread context) |
2468 | * | ||
2469 | * RETURNS: | ||
2470 | * Non-zero if qc completed, zero otherwise. | ||
2468 | */ | 2471 | */ |
2469 | 2472 | ||
2470 | static void ata_pio_complete (struct ata_port *ap) | 2473 | static int ata_pio_complete (struct ata_port *ap) |
2471 | { | 2474 | { |
2472 | struct ata_queued_cmd *qc; | 2475 | struct ata_queued_cmd *qc; |
2473 | u8 drv_stat; | 2476 | u8 drv_stat; |
@@ -2486,14 +2489,14 @@ static void ata_pio_complete (struct ata_port *ap) | |||
2486 | if (drv_stat & (ATA_BUSY | ATA_DRQ)) { | 2489 | if (drv_stat & (ATA_BUSY | ATA_DRQ)) { |
2487 | ap->pio_task_state = PIO_ST_LAST_POLL; | 2490 | ap->pio_task_state = PIO_ST_LAST_POLL; |
2488 | ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO; | 2491 | ap->pio_task_timeout = jiffies + ATA_TMOUT_PIO; |
2489 | return; | 2492 | return 0; |
2490 | } | 2493 | } |
2491 | } | 2494 | } |
2492 | 2495 | ||
2493 | drv_stat = ata_wait_idle(ap); | 2496 | drv_stat = ata_wait_idle(ap); |
2494 | if (!ata_ok(drv_stat)) { | 2497 | if (!ata_ok(drv_stat)) { |
2495 | ap->pio_task_state = PIO_ST_ERR; | 2498 | ap->pio_task_state = PIO_ST_ERR; |
2496 | return; | 2499 | return 0; |
2497 | } | 2500 | } |
2498 | 2501 | ||
2499 | qc = ata_qc_from_tag(ap, ap->active_tag); | 2502 | qc = ata_qc_from_tag(ap, ap->active_tag); |
@@ -2502,6 +2505,10 @@ static void ata_pio_complete (struct ata_port *ap) | |||
2502 | ap->pio_task_state = PIO_ST_IDLE; | 2505 | ap->pio_task_state = PIO_ST_IDLE; |
2503 | 2506 | ||
2504 | ata_poll_qc_complete(qc, drv_stat); | 2507 | ata_poll_qc_complete(qc, drv_stat); |
2508 | |||
2509 | /* another command may start at this point */ | ||
2510 | |||
2511 | return 1; | ||
2505 | } | 2512 | } |
2506 | 2513 | ||
2507 | 2514 | ||
@@ -2709,7 +2716,7 @@ static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes) | |||
2709 | 2716 | ||
2710 | next_sg: | 2717 | next_sg: |
2711 | if (unlikely(qc->cursg >= qc->n_elem)) { | 2718 | if (unlikely(qc->cursg >= qc->n_elem)) { |
2712 | /* | 2719 | /* |
2713 | * The end of qc->sg is reached and the device expects | 2720 | * The end of qc->sg is reached and the device expects |
2714 | * more data to transfer. In order not to overrun qc->sg | 2721 | * more data to transfer. In order not to overrun qc->sg |
2715 | * and fulfill length specified in the byte count register, | 2722 | * and fulfill length specified in the byte count register, |
@@ -2721,7 +2728,7 @@ next_sg: | |||
2721 | unsigned int i; | 2728 | unsigned int i; |
2722 | 2729 | ||
2723 | if (words) /* warning if bytes > 1 */ | 2730 | if (words) /* warning if bytes > 1 */ |
2724 | printk(KERN_WARNING "ata%u: %u bytes trailing data\n", | 2731 | printk(KERN_WARNING "ata%u: %u bytes trailing data\n", |
2725 | ap->id, bytes); | 2732 | ap->id, bytes); |
2726 | 2733 | ||
2727 | for (i = 0; i < words; i++) | 2734 | for (i = 0; i < words; i++) |
@@ -2849,9 +2856,7 @@ static void ata_pio_block(struct ata_port *ap) | |||
2849 | if (is_atapi_taskfile(&qc->tf)) { | 2856 | if (is_atapi_taskfile(&qc->tf)) { |
2850 | /* no more data to transfer or unsupported ATAPI command */ | 2857 | /* no more data to transfer or unsupported ATAPI command */ |
2851 | if ((status & ATA_DRQ) == 0) { | 2858 | if ((status & ATA_DRQ) == 0) { |
2852 | ap->pio_task_state = PIO_ST_IDLE; | 2859 | ap->pio_task_state = PIO_ST_LAST; |
2853 | |||
2854 | ata_poll_qc_complete(qc, status); | ||
2855 | return; | 2860 | return; |
2856 | } | 2861 | } |
2857 | 2862 | ||
@@ -2887,7 +2892,12 @@ static void ata_pio_error(struct ata_port *ap) | |||
2887 | static void ata_pio_task(void *_data) | 2892 | static void ata_pio_task(void *_data) |
2888 | { | 2893 | { |
2889 | struct ata_port *ap = _data; | 2894 | struct ata_port *ap = _data; |
2890 | unsigned long timeout = 0; | 2895 | unsigned long timeout; |
2896 | int qc_completed; | ||
2897 | |||
2898 | fsm_start: | ||
2899 | timeout = 0; | ||
2900 | qc_completed = 0; | ||
2891 | 2901 | ||
2892 | switch (ap->pio_task_state) { | 2902 | switch (ap->pio_task_state) { |
2893 | case PIO_ST_IDLE: | 2903 | case PIO_ST_IDLE: |
@@ -2898,7 +2908,7 @@ static void ata_pio_task(void *_data) | |||
2898 | break; | 2908 | break; |
2899 | 2909 | ||
2900 | case PIO_ST_LAST: | 2910 | case PIO_ST_LAST: |
2901 | ata_pio_complete(ap); | 2911 | qc_completed = ata_pio_complete(ap); |
2902 | break; | 2912 | break; |
2903 | 2913 | ||
2904 | case PIO_ST_POLL: | 2914 | case PIO_ST_POLL: |
@@ -2913,10 +2923,9 @@ static void ata_pio_task(void *_data) | |||
2913 | } | 2923 | } |
2914 | 2924 | ||
2915 | if (timeout) | 2925 | if (timeout) |
2916 | queue_delayed_work(ata_wq, &ap->pio_task, | 2926 | queue_delayed_work(ata_wq, &ap->pio_task, timeout); |
2917 | timeout); | 2927 | else if (!qc_completed) |
2918 | else | 2928 | goto fsm_start; |
2919 | queue_work(ata_wq, &ap->pio_task); | ||
2920 | } | 2929 | } |
2921 | 2930 | ||
2922 | static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev, | 2931 | static void atapi_request_sense(struct ata_port *ap, struct ata_device *dev, |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 3e9b64137873..23d095d3817b 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -201,6 +201,7 @@ int | |||
201 | qla2100_pci_config(scsi_qla_host_t *ha) | 201 | qla2100_pci_config(scsi_qla_host_t *ha) |
202 | { | 202 | { |
203 | uint16_t w, mwi; | 203 | uint16_t w, mwi; |
204 | uint32_t d; | ||
204 | unsigned long flags; | 205 | unsigned long flags; |
205 | struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; | 206 | struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; |
206 | 207 | ||
@@ -215,9 +216,9 @@ qla2100_pci_config(scsi_qla_host_t *ha) | |||
215 | pci_write_config_word(ha->pdev, PCI_COMMAND, w); | 216 | pci_write_config_word(ha->pdev, PCI_COMMAND, w); |
216 | 217 | ||
217 | /* Reset expansion ROM address decode enable */ | 218 | /* Reset expansion ROM address decode enable */ |
218 | pci_read_config_word(ha->pdev, PCI_ROM_ADDRESS, &w); | 219 | pci_read_config_dword(ha->pdev, PCI_ROM_ADDRESS, &d); |
219 | w &= ~PCI_ROM_ADDRESS_ENABLE; | 220 | d &= ~PCI_ROM_ADDRESS_ENABLE; |
220 | pci_write_config_word(ha->pdev, PCI_ROM_ADDRESS, w); | 221 | pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d); |
221 | 222 | ||
222 | /* Get PCI bus information. */ | 223 | /* Get PCI bus information. */ |
223 | spin_lock_irqsave(&ha->hardware_lock, flags); | 224 | spin_lock_irqsave(&ha->hardware_lock, flags); |
@@ -237,6 +238,7 @@ int | |||
237 | qla2300_pci_config(scsi_qla_host_t *ha) | 238 | qla2300_pci_config(scsi_qla_host_t *ha) |
238 | { | 239 | { |
239 | uint16_t w, mwi; | 240 | uint16_t w, mwi; |
241 | uint32_t d; | ||
240 | unsigned long flags = 0; | 242 | unsigned long flags = 0; |
241 | uint32_t cnt; | 243 | uint32_t cnt; |
242 | struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; | 244 | struct device_reg_2xxx __iomem *reg = &ha->iobase->isp; |
@@ -302,9 +304,9 @@ qla2300_pci_config(scsi_qla_host_t *ha) | |||
302 | pci_write_config_byte(ha->pdev, PCI_LATENCY_TIMER, 0x80); | 304 | pci_write_config_byte(ha->pdev, PCI_LATENCY_TIMER, 0x80); |
303 | 305 | ||
304 | /* Reset expansion ROM address decode enable */ | 306 | /* Reset expansion ROM address decode enable */ |
305 | pci_read_config_word(ha->pdev, PCI_ROM_ADDRESS, &w); | 307 | pci_read_config_dword(ha->pdev, PCI_ROM_ADDRESS, &d); |
306 | w &= ~PCI_ROM_ADDRESS_ENABLE; | 308 | d &= ~PCI_ROM_ADDRESS_ENABLE; |
307 | pci_write_config_word(ha->pdev, PCI_ROM_ADDRESS, w); | 309 | pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d); |
308 | 310 | ||
309 | /* Get PCI bus information. */ | 311 | /* Get PCI bus information. */ |
310 | spin_lock_irqsave(&ha->hardware_lock, flags); | 312 | spin_lock_irqsave(&ha->hardware_lock, flags); |
@@ -324,6 +326,7 @@ int | |||
324 | qla24xx_pci_config(scsi_qla_host_t *ha) | 326 | qla24xx_pci_config(scsi_qla_host_t *ha) |
325 | { | 327 | { |
326 | uint16_t w, mwi; | 328 | uint16_t w, mwi; |
329 | uint32_t d; | ||
327 | unsigned long flags = 0; | 330 | unsigned long flags = 0; |
328 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; | 331 | struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; |
329 | int pcix_cmd_reg, pcie_dctl_reg; | 332 | int pcix_cmd_reg, pcie_dctl_reg; |
@@ -366,9 +369,9 @@ qla24xx_pci_config(scsi_qla_host_t *ha) | |||
366 | } | 369 | } |
367 | 370 | ||
368 | /* Reset expansion ROM address decode enable */ | 371 | /* Reset expansion ROM address decode enable */ |
369 | pci_read_config_word(ha->pdev, PCI_ROM_ADDRESS, &w); | 372 | pci_read_config_dword(ha->pdev, PCI_ROM_ADDRESS, &d); |
370 | w &= ~PCI_ROM_ADDRESS_ENABLE; | 373 | d &= ~PCI_ROM_ADDRESS_ENABLE; |
371 | pci_write_config_word(ha->pdev, PCI_ROM_ADDRESS, w); | 374 | pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d); |
372 | 375 | ||
373 | /* Get PCI bus information. */ | 376 | /* Get PCI bus information. */ |
374 | spin_lock_irqsave(&ha->hardware_lock, flags); | 377 | spin_lock_irqsave(&ha->hardware_lock, flags); |
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index a3cd0ee8486d..0585ab27ffde 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
@@ -781,7 +781,7 @@ mpc52xx_uart_remove(struct device *dev) | |||
781 | 781 | ||
782 | #ifdef CONFIG_PM | 782 | #ifdef CONFIG_PM |
783 | static int | 783 | static int |
784 | mpc52xx_uart_suspend(struct device *dev, u32 state, u32 level) | 784 | mpc52xx_uart_suspend(struct device *dev, pm_message_t state, u32 level) |
785 | { | 785 | { |
786 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); | 786 | struct uart_port *port = (struct uart_port *) dev_get_drvdata(dev); |
787 | 787 | ||
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c index a32817678552..630f2dfa9699 100644 --- a/drivers/video/backlight/corgi_bl.c +++ b/drivers/video/backlight/corgi_bl.c | |||
@@ -19,17 +19,18 @@ | |||
19 | #include <linux/fb.h> | 19 | #include <linux/fb.h> |
20 | #include <linux/backlight.h> | 20 | #include <linux/backlight.h> |
21 | 21 | ||
22 | #include <asm/arch-pxa/corgi.h> | 22 | #include <asm/mach-types.h> |
23 | #include <asm/hardware/scoop.h> | 23 | #include <asm/arch/sharpsl.h> |
24 | 24 | ||
25 | #define CORGI_MAX_INTENSITY 0x3e | ||
26 | #define CORGI_DEFAULT_INTENSITY 0x1f | 25 | #define CORGI_DEFAULT_INTENSITY 0x1f |
27 | #define CORGI_LIMIT_MASK 0x0b | 26 | #define CORGI_LIMIT_MASK 0x0b |
28 | 27 | ||
29 | static int corgibl_powermode = FB_BLANK_UNBLANK; | 28 | static int corgibl_powermode = FB_BLANK_UNBLANK; |
30 | static int current_intensity = 0; | 29 | static int current_intensity = 0; |
31 | static int corgibl_limit = 0; | 30 | static int corgibl_limit = 0; |
31 | static void (*corgibl_mach_set_intensity)(int intensity); | ||
32 | static spinlock_t bl_lock = SPIN_LOCK_UNLOCKED; | 32 | static spinlock_t bl_lock = SPIN_LOCK_UNLOCKED; |
33 | static struct backlight_properties corgibl_data; | ||
33 | 34 | ||
34 | static void corgibl_send_intensity(int intensity) | 35 | static void corgibl_send_intensity(int intensity) |
35 | { | 36 | { |
diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index cabd53cec991..6c2244cf0e74 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c | |||
@@ -425,7 +425,7 @@ static void imxfb_setup_gpio(struct imxfb_info *fbi) | |||
425 | * Power management hooks. Note that we won't be called from IRQ context, | 425 | * Power management hooks. Note that we won't be called from IRQ context, |
426 | * unlike the blank functions above, so we may sleep. | 426 | * unlike the blank functions above, so we may sleep. |
427 | */ | 427 | */ |
428 | static int imxfb_suspend(struct device *dev, u32 state, u32 level) | 428 | static int imxfb_suspend(struct device *dev, pm_message_t state, u32 level) |
429 | { | 429 | { |
430 | struct imxfb_info *fbi = dev_get_drvdata(dev); | 430 | struct imxfb_info *fbi = dev_get_drvdata(dev); |
431 | pr_debug("%s\n",__FUNCTION__); | 431 | pr_debug("%s\n",__FUNCTION__); |