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

orinoco: provide generic commit function

This allows changes to be commited from cfg80211 functions.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

David Kilroy and committed by
John W. Linville
721aa2f7 6415f7df

+294 -269
+227
drivers/net/wireless/orinoco/hw.c
··· 406 406 *automatic = bitrate_table[ratemode].automatic; 407 407 } 408 408 409 + int orinoco_hw_program_rids(struct orinoco_private *priv) 410 + { 411 + struct net_device *dev = priv->ndev; 412 + hermes_t *hw = &priv->hw; 413 + int err; 414 + struct hermes_idstring idbuf; 415 + 416 + /* Set the MAC address */ 417 + err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR, 418 + HERMES_BYTES_TO_RECLEN(ETH_ALEN), dev->dev_addr); 419 + if (err) { 420 + printk(KERN_ERR "%s: Error %d setting MAC address\n", 421 + dev->name, err); 422 + return err; 423 + } 424 + 425 + /* Set up the link mode */ 426 + err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPORTTYPE, 427 + priv->port_type); 428 + if (err) { 429 + printk(KERN_ERR "%s: Error %d setting port type\n", 430 + dev->name, err); 431 + return err; 432 + } 433 + /* Set the channel/frequency */ 434 + if (priv->channel != 0 && priv->iw_mode != IW_MODE_INFRA) { 435 + err = hermes_write_wordrec(hw, USER_BAP, 436 + HERMES_RID_CNFOWNCHANNEL, 437 + priv->channel); 438 + if (err) { 439 + printk(KERN_ERR "%s: Error %d setting channel %d\n", 440 + dev->name, err, priv->channel); 441 + return err; 442 + } 443 + } 444 + 445 + if (priv->has_ibss) { 446 + u16 createibss; 447 + 448 + if ((strlen(priv->desired_essid) == 0) && (priv->createibss)) { 449 + printk(KERN_WARNING "%s: This firmware requires an " 450 + "ESSID in IBSS-Ad-Hoc mode.\n", dev->name); 451 + /* With wvlan_cs, in this case, we would crash. 452 + * hopefully, this driver will behave better... 453 + * Jean II */ 454 + createibss = 0; 455 + } else { 456 + createibss = priv->createibss; 457 + } 458 + 459 + err = hermes_write_wordrec(hw, USER_BAP, 460 + HERMES_RID_CNFCREATEIBSS, 461 + createibss); 462 + if (err) { 463 + printk(KERN_ERR "%s: Error %d setting CREATEIBSS\n", 464 + dev->name, err); 465 + return err; 466 + } 467 + } 468 + 469 + /* Set the desired BSSID */ 470 + err = __orinoco_hw_set_wap(priv); 471 + if (err) { 472 + printk(KERN_ERR "%s: Error %d setting AP address\n", 473 + dev->name, err); 474 + return err; 475 + } 476 + 477 + /* Set the desired ESSID */ 478 + idbuf.len = cpu_to_le16(strlen(priv->desired_essid)); 479 + memcpy(&idbuf.val, priv->desired_essid, sizeof(idbuf.val)); 480 + /* WinXP wants partner to configure OWNSSID even in IBSS mode. (jimc) */ 481 + err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNSSID, 482 + HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2), 483 + &idbuf); 484 + if (err) { 485 + printk(KERN_ERR "%s: Error %d setting OWNSSID\n", 486 + dev->name, err); 487 + return err; 488 + } 489 + err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID, 490 + HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2), 491 + &idbuf); 492 + if (err) { 493 + printk(KERN_ERR "%s: Error %d setting DESIREDSSID\n", 494 + dev->name, err); 495 + return err; 496 + } 497 + 498 + /* Set the station name */ 499 + idbuf.len = cpu_to_le16(strlen(priv->nick)); 500 + memcpy(&idbuf.val, priv->nick, sizeof(idbuf.val)); 501 + err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, 502 + HERMES_BYTES_TO_RECLEN(strlen(priv->nick)+2), 503 + &idbuf); 504 + if (err) { 505 + printk(KERN_ERR "%s: Error %d setting nickname\n", 506 + dev->name, err); 507 + return err; 508 + } 509 + 510 + /* Set AP density */ 511 + if (priv->has_sensitivity) { 512 + err = hermes_write_wordrec(hw, USER_BAP, 513 + HERMES_RID_CNFSYSTEMSCALE, 514 + priv->ap_density); 515 + if (err) { 516 + printk(KERN_WARNING "%s: Error %d setting SYSTEMSCALE. " 517 + "Disabling sensitivity control\n", 518 + dev->name, err); 519 + 520 + priv->has_sensitivity = 0; 521 + } 522 + } 523 + 524 + /* Set RTS threshold */ 525 + err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD, 526 + priv->rts_thresh); 527 + if (err) { 528 + printk(KERN_ERR "%s: Error %d setting RTS threshold\n", 529 + dev->name, err); 530 + return err; 531 + } 532 + 533 + /* Set fragmentation threshold or MWO robustness */ 534 + if (priv->has_mwo) 535 + err = hermes_write_wordrec(hw, USER_BAP, 536 + HERMES_RID_CNFMWOROBUST_AGERE, 537 + priv->mwo_robust); 538 + else 539 + err = hermes_write_wordrec(hw, USER_BAP, 540 + HERMES_RID_CNFFRAGMENTATIONTHRESHOLD, 541 + priv->frag_thresh); 542 + if (err) { 543 + printk(KERN_ERR "%s: Error %d setting fragmentation\n", 544 + dev->name, err); 545 + return err; 546 + } 547 + 548 + /* Set bitrate */ 549 + err = __orinoco_hw_set_bitrate(priv); 550 + if (err) { 551 + printk(KERN_ERR "%s: Error %d setting bitrate\n", 552 + dev->name, err); 553 + return err; 554 + } 555 + 556 + /* Set power management */ 557 + if (priv->has_pm) { 558 + err = hermes_write_wordrec(hw, USER_BAP, 559 + HERMES_RID_CNFPMENABLED, 560 + priv->pm_on); 561 + if (err) { 562 + printk(KERN_ERR "%s: Error %d setting up PM\n", 563 + dev->name, err); 564 + return err; 565 + } 566 + 567 + err = hermes_write_wordrec(hw, USER_BAP, 568 + HERMES_RID_CNFMULTICASTRECEIVE, 569 + priv->pm_mcast); 570 + if (err) { 571 + printk(KERN_ERR "%s: Error %d setting up PM\n", 572 + dev->name, err); 573 + return err; 574 + } 575 + err = hermes_write_wordrec(hw, USER_BAP, 576 + HERMES_RID_CNFMAXSLEEPDURATION, 577 + priv->pm_period); 578 + if (err) { 579 + printk(KERN_ERR "%s: Error %d setting up PM\n", 580 + dev->name, err); 581 + return err; 582 + } 583 + err = hermes_write_wordrec(hw, USER_BAP, 584 + HERMES_RID_CNFPMHOLDOVERDURATION, 585 + priv->pm_timeout); 586 + if (err) { 587 + printk(KERN_ERR "%s: Error %d setting up PM\n", 588 + dev->name, err); 589 + return err; 590 + } 591 + } 592 + 593 + /* Set preamble - only for Symbol so far... */ 594 + if (priv->has_preamble) { 595 + err = hermes_write_wordrec(hw, USER_BAP, 596 + HERMES_RID_CNFPREAMBLE_SYMBOL, 597 + priv->preamble); 598 + if (err) { 599 + printk(KERN_ERR "%s: Error %d setting preamble\n", 600 + dev->name, err); 601 + return err; 602 + } 603 + } 604 + 605 + /* Set up encryption */ 606 + if (priv->has_wep || priv->has_wpa) { 607 + err = __orinoco_hw_setup_enc(priv); 608 + if (err) { 609 + printk(KERN_ERR "%s: Error %d activating encryption\n", 610 + dev->name, err); 611 + return err; 612 + } 613 + } 614 + 615 + if (priv->iw_mode == IW_MODE_MONITOR) { 616 + /* Enable monitor mode */ 617 + dev->type = ARPHRD_IEEE80211; 618 + err = hermes_docmd_wait(hw, HERMES_CMD_TEST | 619 + HERMES_TEST_MONITOR, 0, NULL); 620 + } else { 621 + /* Disable monitor mode */ 622 + dev->type = ARPHRD_ETHER; 623 + err = hermes_docmd_wait(hw, HERMES_CMD_TEST | 624 + HERMES_TEST_STOP, 0, NULL); 625 + } 626 + if (err) 627 + return err; 628 + 629 + /* Reset promiscuity / multicast*/ 630 + priv->promiscuous = 0; 631 + priv->mc_count = 0; 632 + 633 + return 0; 634 + } 635 + 409 636 /* Get tsc from the firmware */ 410 637 int orinoco_hw_get_tkip_iv(struct orinoco_private *priv, int key, u8 *tsc) 411 638 {
+1
drivers/net/wireless/orinoco/hw.h
··· 29 29 int orinoco_get_bitratemode(int bitrate, int automatic); 30 30 void orinoco_get_ratemode_cfg(int ratemode, int *bitrate, int *automatic); 31 31 32 + int orinoco_hw_program_rids(struct orinoco_private *priv); 32 33 int orinoco_hw_get_tkip_iv(struct orinoco_private *priv, int key, u8 *tsc); 33 34 int __orinoco_hw_set_bitrate(struct orinoco_private *priv); 34 35 int orinoco_hw_get_act_bitrate(struct orinoco_private *priv, int *bitrate);
+64 -233
drivers/net/wireless/orinoco/main.c
··· 210 210 /* Function prototypes */ 211 211 /********************************************************************/ 212 212 213 - static void __orinoco_set_multicast_list(struct net_device *dev); 213 + static int __orinoco_set_multicast_list(struct net_device *dev); 214 214 static int __orinoco_up(struct orinoco_private *priv); 215 215 static int __orinoco_down(struct orinoco_private *priv); 216 + static int __orinoco_commit(struct orinoco_private *priv); 216 217 217 218 /********************************************************************/ 218 219 /* Internal helper functions */ ··· 1525 1524 1526 1525 netif_carrier_off(dev); /* just to make sure */ 1527 1526 1528 - err = __orinoco_program_rids(dev); 1527 + err = __orinoco_commit(priv); 1529 1528 if (err) { 1530 1529 printk(KERN_ERR "%s: Error %d configuring card\n", 1531 1530 dev->name, err); ··· 1594 1593 return err; 1595 1594 } 1596 1595 1597 - int __orinoco_program_rids(struct net_device *dev) 1598 - { 1599 - struct orinoco_private *priv = ndev_priv(dev); 1600 - hermes_t *hw = &priv->hw; 1601 - int err; 1602 - struct hermes_idstring idbuf; 1603 - 1604 - /* Set the MAC address */ 1605 - err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR, 1606 - HERMES_BYTES_TO_RECLEN(ETH_ALEN), dev->dev_addr); 1607 - if (err) { 1608 - printk(KERN_ERR "%s: Error %d setting MAC address\n", 1609 - dev->name, err); 1610 - return err; 1611 - } 1612 - 1613 - /* Set up the link mode */ 1614 - err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPORTTYPE, 1615 - priv->port_type); 1616 - if (err) { 1617 - printk(KERN_ERR "%s: Error %d setting port type\n", 1618 - dev->name, err); 1619 - return err; 1620 - } 1621 - /* Set the channel/frequency */ 1622 - if (priv->channel != 0 && priv->iw_mode != IW_MODE_INFRA) { 1623 - err = hermes_write_wordrec(hw, USER_BAP, 1624 - HERMES_RID_CNFOWNCHANNEL, 1625 - priv->channel); 1626 - if (err) { 1627 - printk(KERN_ERR "%s: Error %d setting channel %d\n", 1628 - dev->name, err, priv->channel); 1629 - return err; 1630 - } 1631 - } 1632 - 1633 - if (priv->has_ibss) { 1634 - u16 createibss; 1635 - 1636 - if ((strlen(priv->desired_essid) == 0) && (priv->createibss)) { 1637 - printk(KERN_WARNING "%s: This firmware requires an " 1638 - "ESSID in IBSS-Ad-Hoc mode.\n", dev->name); 1639 - /* With wvlan_cs, in this case, we would crash. 1640 - * hopefully, this driver will behave better... 1641 - * Jean II */ 1642 - createibss = 0; 1643 - } else { 1644 - createibss = priv->createibss; 1645 - } 1646 - 1647 - err = hermes_write_wordrec(hw, USER_BAP, 1648 - HERMES_RID_CNFCREATEIBSS, 1649 - createibss); 1650 - if (err) { 1651 - printk(KERN_ERR "%s: Error %d setting CREATEIBSS\n", 1652 - dev->name, err); 1653 - return err; 1654 - } 1655 - } 1656 - 1657 - /* Set the desired BSSID */ 1658 - err = __orinoco_hw_set_wap(priv); 1659 - if (err) { 1660 - printk(KERN_ERR "%s: Error %d setting AP address\n", 1661 - dev->name, err); 1662 - return err; 1663 - } 1664 - /* Set the desired ESSID */ 1665 - idbuf.len = cpu_to_le16(strlen(priv->desired_essid)); 1666 - memcpy(&idbuf.val, priv->desired_essid, sizeof(idbuf.val)); 1667 - /* WinXP wants partner to configure OWNSSID even in IBSS mode. (jimc) */ 1668 - err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNSSID, 1669 - HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2), 1670 - &idbuf); 1671 - if (err) { 1672 - printk(KERN_ERR "%s: Error %d setting OWNSSID\n", 1673 - dev->name, err); 1674 - return err; 1675 - } 1676 - err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID, 1677 - HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2), 1678 - &idbuf); 1679 - if (err) { 1680 - printk(KERN_ERR "%s: Error %d setting DESIREDSSID\n", 1681 - dev->name, err); 1682 - return err; 1683 - } 1684 - 1685 - /* Set the station name */ 1686 - idbuf.len = cpu_to_le16(strlen(priv->nick)); 1687 - memcpy(&idbuf.val, priv->nick, sizeof(idbuf.val)); 1688 - err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, 1689 - HERMES_BYTES_TO_RECLEN(strlen(priv->nick)+2), 1690 - &idbuf); 1691 - if (err) { 1692 - printk(KERN_ERR "%s: Error %d setting nickname\n", 1693 - dev->name, err); 1694 - return err; 1695 - } 1696 - 1697 - /* Set AP density */ 1698 - if (priv->has_sensitivity) { 1699 - err = hermes_write_wordrec(hw, USER_BAP, 1700 - HERMES_RID_CNFSYSTEMSCALE, 1701 - priv->ap_density); 1702 - if (err) { 1703 - printk(KERN_WARNING "%s: Error %d setting SYSTEMSCALE. " 1704 - "Disabling sensitivity control\n", 1705 - dev->name, err); 1706 - 1707 - priv->has_sensitivity = 0; 1708 - } 1709 - } 1710 - 1711 - /* Set RTS threshold */ 1712 - err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD, 1713 - priv->rts_thresh); 1714 - if (err) { 1715 - printk(KERN_ERR "%s: Error %d setting RTS threshold\n", 1716 - dev->name, err); 1717 - return err; 1718 - } 1719 - 1720 - /* Set fragmentation threshold or MWO robustness */ 1721 - if (priv->has_mwo) 1722 - err = hermes_write_wordrec(hw, USER_BAP, 1723 - HERMES_RID_CNFMWOROBUST_AGERE, 1724 - priv->mwo_robust); 1725 - else 1726 - err = hermes_write_wordrec(hw, USER_BAP, 1727 - HERMES_RID_CNFFRAGMENTATIONTHRESHOLD, 1728 - priv->frag_thresh); 1729 - if (err) { 1730 - printk(KERN_ERR "%s: Error %d setting fragmentation\n", 1731 - dev->name, err); 1732 - return err; 1733 - } 1734 - 1735 - /* Set bitrate */ 1736 - err = __orinoco_hw_set_bitrate(priv); 1737 - if (err) { 1738 - printk(KERN_ERR "%s: Error %d setting bitrate\n", 1739 - dev->name, err); 1740 - return err; 1741 - } 1742 - 1743 - /* Set power management */ 1744 - if (priv->has_pm) { 1745 - err = hermes_write_wordrec(hw, USER_BAP, 1746 - HERMES_RID_CNFPMENABLED, 1747 - priv->pm_on); 1748 - if (err) { 1749 - printk(KERN_ERR "%s: Error %d setting up PM\n", 1750 - dev->name, err); 1751 - return err; 1752 - } 1753 - 1754 - err = hermes_write_wordrec(hw, USER_BAP, 1755 - HERMES_RID_CNFMULTICASTRECEIVE, 1756 - priv->pm_mcast); 1757 - if (err) { 1758 - printk(KERN_ERR "%s: Error %d setting up PM\n", 1759 - dev->name, err); 1760 - return err; 1761 - } 1762 - err = hermes_write_wordrec(hw, USER_BAP, 1763 - HERMES_RID_CNFMAXSLEEPDURATION, 1764 - priv->pm_period); 1765 - if (err) { 1766 - printk(KERN_ERR "%s: Error %d setting up PM\n", 1767 - dev->name, err); 1768 - return err; 1769 - } 1770 - err = hermes_write_wordrec(hw, USER_BAP, 1771 - HERMES_RID_CNFPMHOLDOVERDURATION, 1772 - priv->pm_timeout); 1773 - if (err) { 1774 - printk(KERN_ERR "%s: Error %d setting up PM\n", 1775 - dev->name, err); 1776 - return err; 1777 - } 1778 - } 1779 - 1780 - /* Set preamble - only for Symbol so far... */ 1781 - if (priv->has_preamble) { 1782 - err = hermes_write_wordrec(hw, USER_BAP, 1783 - HERMES_RID_CNFPREAMBLE_SYMBOL, 1784 - priv->preamble); 1785 - if (err) { 1786 - printk(KERN_ERR "%s: Error %d setting preamble\n", 1787 - dev->name, err); 1788 - return err; 1789 - } 1790 - } 1791 - 1792 - /* Set up encryption */ 1793 - if (priv->has_wep || priv->has_wpa) { 1794 - err = __orinoco_hw_setup_enc(priv); 1795 - if (err) { 1796 - printk(KERN_ERR "%s: Error %d activating encryption\n", 1797 - dev->name, err); 1798 - return err; 1799 - } 1800 - } 1801 - 1802 - if (priv->iw_mode == IW_MODE_MONITOR) { 1803 - /* Enable monitor mode */ 1804 - dev->type = ARPHRD_IEEE80211; 1805 - err = hermes_docmd_wait(hw, HERMES_CMD_TEST | 1806 - HERMES_TEST_MONITOR, 0, NULL); 1807 - } else { 1808 - /* Disable monitor mode */ 1809 - dev->type = ARPHRD_ETHER; 1810 - err = hermes_docmd_wait(hw, HERMES_CMD_TEST | 1811 - HERMES_TEST_STOP, 0, NULL); 1812 - } 1813 - if (err) 1814 - return err; 1815 - 1816 - /* Set promiscuity / multicast*/ 1817 - priv->promiscuous = 0; 1818 - priv->mc_count = 0; 1819 - 1820 - /* FIXME: what about netif_tx_lock */ 1821 - __orinoco_set_multicast_list(dev); 1822 - 1823 - return 0; 1824 - } 1825 - 1826 - /* FIXME: return int? */ 1827 - static void 1596 + static int 1828 1597 __orinoco_set_multicast_list(struct net_device *dev) 1829 1598 { 1830 1599 struct orinoco_private *priv = ndev_priv(dev); ··· 1614 1843 1615 1844 err = __orinoco_hw_set_multicast_list(priv, dev->mc_list, mc_count, 1616 1845 promisc); 1846 + 1847 + return err; 1617 1848 } 1618 1849 1619 1850 /* This must be called from user context, without locks held - use ··· 1691 1918 hermes_set_irqmask(hw, 0); 1692 1919 netif_device_detach(dev); 1693 1920 printk(KERN_ERR "%s: Device has been disabled!\n", dev->name); 1921 + } 1922 + 1923 + static int __orinoco_commit(struct orinoco_private *priv) 1924 + { 1925 + struct net_device *dev = priv->ndev; 1926 + int err = 0; 1927 + 1928 + err = orinoco_hw_program_rids(priv); 1929 + 1930 + /* FIXME: what about netif_tx_lock */ 1931 + (void) __orinoco_set_multicast_list(dev); 1932 + 1933 + return err; 1934 + } 1935 + 1936 + /* Ensures configuration changes are applied. May result in a reset. 1937 + * The caller should hold priv->lock 1938 + */ 1939 + int orinoco_commit(struct orinoco_private *priv) 1940 + { 1941 + struct net_device *dev = priv->ndev; 1942 + hermes_t *hw = &priv->hw; 1943 + int err; 1944 + 1945 + if (priv->broken_disableport) { 1946 + schedule_work(&priv->reset_work); 1947 + return 0; 1948 + } 1949 + 1950 + err = hermes_disable_port(hw, 0); 1951 + if (err) { 1952 + printk(KERN_WARNING "%s: Unable to disable port " 1953 + "while reconfiguring card\n", dev->name); 1954 + priv->broken_disableport = 1; 1955 + goto out; 1956 + } 1957 + 1958 + err = __orinoco_commit(priv); 1959 + if (err) { 1960 + printk(KERN_WARNING "%s: Unable to reconfigure card\n", 1961 + dev->name); 1962 + goto out; 1963 + } 1964 + 1965 + err = hermes_enable_port(hw, 0); 1966 + if (err) { 1967 + printk(KERN_WARNING "%s: Unable to enable port while reconfiguring card\n", 1968 + dev->name); 1969 + goto out; 1970 + } 1971 + 1972 + out: 1973 + if (err) { 1974 + printk(KERN_WARNING "%s: Resetting instead...\n", dev->name); 1975 + schedule_work(&priv->reset_work); 1976 + err = 0; 1977 + } 1978 + return err; 1694 1979 } 1695 1980 1696 1981 /********************************************************************/
+1 -2
drivers/net/wireless/orinoco/main.h
··· 29 29 struct work_struct; 30 30 31 31 void set_port_type(struct orinoco_private *priv); 32 - int __orinoco_program_rids(struct net_device *dev); 32 + int orinoco_commit(struct orinoco_private *priv); 33 33 void orinoco_reset(struct work_struct *work); 34 - 35 34 36 35 /* Information element helpers - find a home for these... */ 37 36 static inline u8 *orinoco_get_ie(u8 *data, size_t len,
+1 -34
drivers/net/wireless/orinoco/wext.c
··· 2163 2163 char *extra) 2164 2164 { 2165 2165 struct orinoco_private *priv = ndev_priv(dev); 2166 - struct hermes *hw = &priv->hw; 2167 2166 unsigned long flags; 2168 2167 int err = 0; 2169 2168 2170 2169 if (!priv->open) 2171 2170 return 0; 2172 2171 2173 - if (priv->broken_disableport) { 2174 - orinoco_reset(&priv->reset_work); 2175 - return 0; 2176 - } 2177 - 2178 2172 if (orinoco_lock(priv, &flags) != 0) 2179 2173 return err; 2180 2174 2181 - err = hermes_disable_port(hw, 0); 2182 - if (err) { 2183 - printk(KERN_WARNING "%s: Unable to disable port " 2184 - "while reconfiguring card\n", dev->name); 2185 - priv->broken_disableport = 1; 2186 - goto out; 2187 - } 2188 - 2189 - err = __orinoco_program_rids(dev); 2190 - if (err) { 2191 - printk(KERN_WARNING "%s: Unable to reconfigure card\n", 2192 - dev->name); 2193 - goto out; 2194 - } 2195 - 2196 - err = hermes_enable_port(hw, 0); 2197 - if (err) { 2198 - printk(KERN_WARNING "%s: Unable to enable port while reconfiguring card\n", 2199 - dev->name); 2200 - goto out; 2201 - } 2202 - 2203 - out: 2204 - if (err) { 2205 - printk(KERN_WARNING "%s: Resetting instead...\n", dev->name); 2206 - schedule_work(&priv->reset_work); 2207 - err = 0; 2208 - } 2175 + err = orinoco_commit(priv); 2209 2176 2210 2177 orinoco_unlock(priv, &flags); 2211 2178 return err;