~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/pci/pci.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
740
740
 
741
741
        if (!__pci_complete_power_transition(dev, state))
742
742
                error = 0;
 
743
        /*
 
744
         * When aspm_policy is "powersave" this call ensures
 
745
         * that ASPM is configured.
 
746
         */
 
747
        if (!error && dev->bus->self)
 
748
                pcie_aspm_powersave_config_link(dev->bus->self);
743
749
 
744
750
        return error;
745
751
}
824
830
                dev_err(&dev->dev, "buffer not found in %s\n", __func__);
825
831
                return -ENOMEM;
826
832
        }
827
 
        cap = (u16 *)&save_state->data[0];
 
833
        cap = (u16 *)&save_state->cap.data[0];
828
834
 
829
835
        pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &flags);
830
836
 
857
863
        pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
858
864
        if (!save_state || pos <= 0)
859
865
                return;
860
 
        cap = (u16 *)&save_state->data[0];
 
866
        cap = (u16 *)&save_state->cap.data[0];
861
867
 
862
868
        pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &flags);
863
869
 
893
899
                return -ENOMEM;
894
900
        }
895
901
 
896
 
        pci_read_config_word(dev, pos + PCI_X_CMD, (u16 *)save_state->data);
 
902
        pci_read_config_word(dev, pos + PCI_X_CMD,
 
903
                             (u16 *)save_state->cap.data);
897
904
 
898
905
        return 0;
899
906
}
908
915
        pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
909
916
        if (!save_state || pos <= 0)
910
917
                return;
911
 
        cap = (u16 *)&save_state->data[0];
 
918
        cap = (u16 *)&save_state->cap.data[0];
912
919
 
913
920
        pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]);
914
921
}
969
976
        dev->state_saved = false;
970
977
}
971
978
 
 
979
struct pci_saved_state {
 
980
        u32 config_space[16];
 
981
        struct pci_cap_saved_data cap[0];
 
982
};
 
983
 
 
984
/**
 
985
 * pci_store_saved_state - Allocate and return an opaque struct containing
 
986
 *                         the device saved state.
 
987
 * @dev: PCI device that we're dealing with
 
988
 *
 
989
 * Rerturn NULL if no state or error.
 
990
 */
 
991
struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev)
 
992
{
 
993
        struct pci_saved_state *state;
 
994
        struct pci_cap_saved_state *tmp;
 
995
        struct pci_cap_saved_data *cap;
 
996
        struct hlist_node *pos;
 
997
        size_t size;
 
998
 
 
999
        if (!dev->state_saved)
 
1000
                return NULL;
 
1001
 
 
1002
        size = sizeof(*state) + sizeof(struct pci_cap_saved_data);
 
1003
 
 
1004
        hlist_for_each_entry(tmp, pos, &dev->saved_cap_space, next)
 
1005
                size += sizeof(struct pci_cap_saved_data) + tmp->cap.size;
 
1006
 
 
1007
        state = kzalloc(size, GFP_KERNEL);
 
1008
        if (!state)
 
1009
                return NULL;
 
1010
 
 
1011
        memcpy(state->config_space, dev->saved_config_space,
 
1012
               sizeof(state->config_space));
 
1013
 
 
1014
        cap = state->cap;
 
1015
        hlist_for_each_entry(tmp, pos, &dev->saved_cap_space, next) {
 
1016
                size_t len = sizeof(struct pci_cap_saved_data) + tmp->cap.size;
 
1017
                memcpy(cap, &tmp->cap, len);
 
1018
                cap = (struct pci_cap_saved_data *)((u8 *)cap + len);
 
1019
        }
 
1020
        /* Empty cap_save terminates list */
 
1021
 
 
1022
        return state;
 
1023
}
 
1024
EXPORT_SYMBOL_GPL(pci_store_saved_state);
 
1025
 
 
1026
/**
 
1027
 * pci_load_saved_state - Reload the provided save state into struct pci_dev.
 
1028
 * @dev: PCI device that we're dealing with
 
1029
 * @state: Saved state returned from pci_store_saved_state()
 
1030
 */
 
1031
int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state)
 
1032
{
 
1033
        struct pci_cap_saved_data *cap;
 
1034
 
 
1035
        dev->state_saved = false;
 
1036
 
 
1037
        if (!state)
 
1038
                return 0;
 
1039
 
 
1040
        memcpy(dev->saved_config_space, state->config_space,
 
1041
               sizeof(state->config_space));
 
1042
 
 
1043
        cap = state->cap;
 
1044
        while (cap->size) {
 
1045
                struct pci_cap_saved_state *tmp;
 
1046
 
 
1047
                tmp = pci_find_saved_cap(dev, cap->cap_nr);
 
1048
                if (!tmp || tmp->cap.size != cap->size)
 
1049
                        return -EINVAL;
 
1050
 
 
1051
                memcpy(tmp->cap.data, cap->data, tmp->cap.size);
 
1052
                cap = (struct pci_cap_saved_data *)((u8 *)cap +
 
1053
                       sizeof(struct pci_cap_saved_data) + cap->size);
 
1054
        }
 
1055
 
 
1056
        dev->state_saved = true;
 
1057
        return 0;
 
1058
}
 
1059
EXPORT_SYMBOL_GPL(pci_load_saved_state);
 
1060
 
 
1061
/**
 
1062
 * pci_load_and_free_saved_state - Reload the save state pointed to by state,
 
1063
 *                                 and free the memory allocated for it.
 
1064
 * @dev: PCI device that we're dealing with
 
1065
 * @state: Pointer to saved state returned from pci_store_saved_state()
 
1066
 */
 
1067
int pci_load_and_free_saved_state(struct pci_dev *dev,
 
1068
                                  struct pci_saved_state **state)
 
1069
{
 
1070
        int ret = pci_load_saved_state(dev, *state);
 
1071
        kfree(*state);
 
1072
        *state = NULL;
 
1073
        return ret;
 
1074
}
 
1075
EXPORT_SYMBOL_GPL(pci_load_and_free_saved_state);
 
1076
 
972
1077
static int do_pci_enable_device(struct pci_dev *dev, int bars)
973
1078
{
974
1079
        int err;
1765
1870
        if (!save_state)
1766
1871
                return -ENOMEM;
1767
1872
 
1768
 
        save_state->cap_nr = cap;
 
1873
        save_state->cap.cap_nr = cap;
 
1874
        save_state->cap.size = size;
1769
1875
        pci_add_saved_cap(dev, save_state);
1770
1876
 
1771
1877
        return 0;
1828
1934
        bridge->ari_enabled = 1;
1829
1935
}
1830
1936
 
 
1937
/**
 
1938
 * pci_enable_ido - enable ID-based ordering on a device
 
1939
 * @dev: the PCI device
 
1940
 * @type: which types of IDO to enable
 
1941
 *
 
1942
 * Enable ID-based ordering on @dev.  @type can contain the bits
 
1943
 * %PCI_EXP_IDO_REQUEST and/or %PCI_EXP_IDO_COMPLETION to indicate
 
1944
 * which types of transactions are allowed to be re-ordered.
 
1945
 */
 
1946
void pci_enable_ido(struct pci_dev *dev, unsigned long type)
 
1947
{
 
1948
        int pos;
 
1949
        u16 ctrl;
 
1950
 
 
1951
        pos = pci_pcie_cap(dev);
 
1952
        if (!pos)
 
1953
                return;
 
1954
 
 
1955
        pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl);
 
1956
        if (type & PCI_EXP_IDO_REQUEST)
 
1957
                ctrl |= PCI_EXP_IDO_REQ_EN;
 
1958
        if (type & PCI_EXP_IDO_COMPLETION)
 
1959
                ctrl |= PCI_EXP_IDO_CMP_EN;
 
1960
        pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl);
 
1961
}
 
1962
EXPORT_SYMBOL(pci_enable_ido);
 
1963
 
 
1964
/**
 
1965
 * pci_disable_ido - disable ID-based ordering on a device
 
1966
 * @dev: the PCI device
 
1967
 * @type: which types of IDO to disable
 
1968
 */
 
1969
void pci_disable_ido(struct pci_dev *dev, unsigned long type)
 
1970
{
 
1971
        int pos;
 
1972
        u16 ctrl;
 
1973
 
 
1974
        if (!pci_is_pcie(dev))
 
1975
                return;
 
1976
 
 
1977
        pos = pci_pcie_cap(dev);
 
1978
        if (!pos)
 
1979
                return;
 
1980
 
 
1981
        pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl);
 
1982
        if (type & PCI_EXP_IDO_REQUEST)
 
1983
                ctrl &= ~PCI_EXP_IDO_REQ_EN;
 
1984
        if (type & PCI_EXP_IDO_COMPLETION)
 
1985
                ctrl &= ~PCI_EXP_IDO_CMP_EN;
 
1986
        pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl);
 
1987
}
 
1988
EXPORT_SYMBOL(pci_disable_ido);
 
1989
 
 
1990
/**
 
1991
 * pci_enable_obff - enable optimized buffer flush/fill
 
1992
 * @dev: PCI device
 
1993
 * @type: type of signaling to use
 
1994
 *
 
1995
 * Try to enable @type OBFF signaling on @dev.  It will try using WAKE#
 
1996
 * signaling if possible, falling back to message signaling only if
 
1997
 * WAKE# isn't supported.  @type should indicate whether the PCIe link
 
1998
 * be brought out of L0s or L1 to send the message.  It should be either
 
1999
 * %PCI_EXP_OBFF_SIGNAL_ALWAYS or %PCI_OBFF_SIGNAL_L0.
 
2000
 *
 
2001
 * If your device can benefit from receiving all messages, even at the
 
2002
 * power cost of bringing the link back up from a low power state, use
 
2003
 * %PCI_EXP_OBFF_SIGNAL_ALWAYS.  Otherwise, use %PCI_OBFF_SIGNAL_L0 (the
 
2004
 * preferred type).
 
2005
 *
 
2006
 * RETURNS:
 
2007
 * Zero on success, appropriate error number on failure.
 
2008
 */
 
2009
int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type type)
 
2010
{
 
2011
        int pos;
 
2012
        u32 cap;
 
2013
        u16 ctrl;
 
2014
        int ret;
 
2015
 
 
2016
        if (!pci_is_pcie(dev))
 
2017
                return -ENOTSUPP;
 
2018
 
 
2019
        pos = pci_pcie_cap(dev);
 
2020
        if (!pos)
 
2021
                return -ENOTSUPP;
 
2022
 
 
2023
        pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP2, &cap);
 
2024
        if (!(cap & PCI_EXP_OBFF_MASK))
 
2025
                return -ENOTSUPP; /* no OBFF support at all */
 
2026
 
 
2027
        /* Make sure the topology supports OBFF as well */
 
2028
        if (dev->bus) {
 
2029
                ret = pci_enable_obff(dev->bus->self, type);
 
2030
                if (ret)
 
2031
                        return ret;
 
2032
        }
 
2033
 
 
2034
        pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl);
 
2035
        if (cap & PCI_EXP_OBFF_WAKE)
 
2036
                ctrl |= PCI_EXP_OBFF_WAKE_EN;
 
2037
        else {
 
2038
                switch (type) {
 
2039
                case PCI_EXP_OBFF_SIGNAL_L0:
 
2040
                        if (!(ctrl & PCI_EXP_OBFF_WAKE_EN))
 
2041
                                ctrl |= PCI_EXP_OBFF_MSGA_EN;
 
2042
                        break;
 
2043
                case PCI_EXP_OBFF_SIGNAL_ALWAYS:
 
2044
                        ctrl &= ~PCI_EXP_OBFF_WAKE_EN;
 
2045
                        ctrl |= PCI_EXP_OBFF_MSGB_EN;
 
2046
                        break;
 
2047
                default:
 
2048
                        WARN(1, "bad OBFF signal type\n");
 
2049
                        return -ENOTSUPP;
 
2050
                }
 
2051
        }
 
2052
        pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl);
 
2053
 
 
2054
        return 0;
 
2055
}
 
2056
EXPORT_SYMBOL(pci_enable_obff);
 
2057
 
 
2058
/**
 
2059
 * pci_disable_obff - disable optimized buffer flush/fill
 
2060
 * @dev: PCI device
 
2061
 *
 
2062
 * Disable OBFF on @dev.
 
2063
 */
 
2064
void pci_disable_obff(struct pci_dev *dev)
 
2065
{
 
2066
        int pos;
 
2067
        u16 ctrl;
 
2068
 
 
2069
        if (!pci_is_pcie(dev))
 
2070
                return;
 
2071
 
 
2072
        pos = pci_pcie_cap(dev);
 
2073
        if (!pos)
 
2074
                return;
 
2075
 
 
2076
        pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl);
 
2077
        ctrl &= ~PCI_EXP_OBFF_WAKE_EN;
 
2078
        pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl);
 
2079
}
 
2080
EXPORT_SYMBOL(pci_disable_obff);
 
2081
 
 
2082
/**
 
2083
 * pci_ltr_supported - check whether a device supports LTR
 
2084
 * @dev: PCI device
 
2085
 *
 
2086
 * RETURNS:
 
2087
 * True if @dev supports latency tolerance reporting, false otherwise.
 
2088
 */
 
2089
bool pci_ltr_supported(struct pci_dev *dev)
 
2090
{
 
2091
        int pos;
 
2092
        u32 cap;
 
2093
 
 
2094
        if (!pci_is_pcie(dev))
 
2095
                return false;
 
2096
 
 
2097
        pos = pci_pcie_cap(dev);
 
2098
        if (!pos)
 
2099
                return false;
 
2100
 
 
2101
        pci_read_config_dword(dev, pos + PCI_EXP_DEVCAP2, &cap);
 
2102
 
 
2103
        return cap & PCI_EXP_DEVCAP2_LTR;
 
2104
}
 
2105
EXPORT_SYMBOL(pci_ltr_supported);
 
2106
 
 
2107
/**
 
2108
 * pci_enable_ltr - enable latency tolerance reporting
 
2109
 * @dev: PCI device
 
2110
 *
 
2111
 * Enable LTR on @dev if possible, which means enabling it first on
 
2112
 * upstream ports.
 
2113
 *
 
2114
 * RETURNS:
 
2115
 * Zero on success, errno on failure.
 
2116
 */
 
2117
int pci_enable_ltr(struct pci_dev *dev)
 
2118
{
 
2119
        int pos;
 
2120
        u16 ctrl;
 
2121
        int ret;
 
2122
 
 
2123
        if (!pci_ltr_supported(dev))
 
2124
                return -ENOTSUPP;
 
2125
 
 
2126
        pos = pci_pcie_cap(dev);
 
2127
        if (!pos)
 
2128
                return -ENOTSUPP;
 
2129
 
 
2130
        /* Only primary function can enable/disable LTR */
 
2131
        if (PCI_FUNC(dev->devfn) != 0)
 
2132
                return -EINVAL;
 
2133
 
 
2134
        /* Enable upstream ports first */
 
2135
        if (dev->bus) {
 
2136
                ret = pci_enable_ltr(dev->bus->self);
 
2137
                if (ret)
 
2138
                        return ret;
 
2139
        }
 
2140
 
 
2141
        pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl);
 
2142
        ctrl |= PCI_EXP_LTR_EN;
 
2143
        pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl);
 
2144
 
 
2145
        return 0;
 
2146
}
 
2147
EXPORT_SYMBOL(pci_enable_ltr);
 
2148
 
 
2149
/**
 
2150
 * pci_disable_ltr - disable latency tolerance reporting
 
2151
 * @dev: PCI device
 
2152
 */
 
2153
void pci_disable_ltr(struct pci_dev *dev)
 
2154
{
 
2155
        int pos;
 
2156
        u16 ctrl;
 
2157
 
 
2158
        if (!pci_ltr_supported(dev))
 
2159
                return;
 
2160
 
 
2161
        pos = pci_pcie_cap(dev);
 
2162
        if (!pos)
 
2163
                return;
 
2164
 
 
2165
        /* Only primary function can enable/disable LTR */
 
2166
        if (PCI_FUNC(dev->devfn) != 0)
 
2167
                return;
 
2168
 
 
2169
        pci_read_config_word(dev, pos + PCI_EXP_DEVCTL2, &ctrl);
 
2170
        ctrl &= ~PCI_EXP_LTR_EN;
 
2171
        pci_write_config_word(dev, pos + PCI_EXP_DEVCTL2, ctrl);
 
2172
}
 
2173
EXPORT_SYMBOL(pci_disable_ltr);
 
2174
 
 
2175
static int __pci_ltr_scale(int *val)
 
2176
{
 
2177
        int scale = 0;
 
2178
 
 
2179
        while (*val > 1023) {
 
2180
                *val = (*val + 31) / 32;
 
2181
                scale++;
 
2182
        }
 
2183
        return scale;
 
2184
}
 
2185
 
 
2186
/**
 
2187
 * pci_set_ltr - set LTR latency values
 
2188
 * @dev: PCI device
 
2189
 * @snoop_lat_ns: snoop latency in nanoseconds
 
2190
 * @nosnoop_lat_ns: nosnoop latency in nanoseconds
 
2191
 *
 
2192
 * Figure out the scale and set the LTR values accordingly.
 
2193
 */
 
2194
int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns)
 
2195
{
 
2196
        int pos, ret, snoop_scale, nosnoop_scale;
 
2197
        u16 val;
 
2198
 
 
2199
        if (!pci_ltr_supported(dev))
 
2200
                return -ENOTSUPP;
 
2201
 
 
2202
        snoop_scale = __pci_ltr_scale(&snoop_lat_ns);
 
2203
        nosnoop_scale = __pci_ltr_scale(&nosnoop_lat_ns);
 
2204
 
 
2205
        if (snoop_lat_ns > PCI_LTR_VALUE_MASK ||
 
2206
            nosnoop_lat_ns > PCI_LTR_VALUE_MASK)
 
2207
                return -EINVAL;
 
2208
 
 
2209
        if ((snoop_scale > (PCI_LTR_SCALE_MASK >> PCI_LTR_SCALE_SHIFT)) ||
 
2210
            (nosnoop_scale > (PCI_LTR_SCALE_MASK >> PCI_LTR_SCALE_SHIFT)))
 
2211
                return -EINVAL;
 
2212
 
 
2213
        pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_LTR);
 
2214
        if (!pos)
 
2215
                return -ENOTSUPP;
 
2216
 
 
2217
        val = (snoop_scale << PCI_LTR_SCALE_SHIFT) | snoop_lat_ns;
 
2218
        ret = pci_write_config_word(dev, pos + PCI_LTR_MAX_SNOOP_LAT, val);
 
2219
        if (ret != 4)
 
2220
                return -EIO;
 
2221
 
 
2222
        val = (nosnoop_scale << PCI_LTR_SCALE_SHIFT) | nosnoop_lat_ns;
 
2223
        ret = pci_write_config_word(dev, pos + PCI_LTR_MAX_NOSNOOP_LAT, val);
 
2224
        if (ret != 4)
 
2225
                return -EIO;
 
2226
 
 
2227
        return 0;
 
2228
}
 
2229
EXPORT_SYMBOL(pci_set_ltr);
 
2230
 
1831
2231
static int pci_acs_enable;
1832
2232
 
1833
2233
/**
2473
2873
        return 0;
2474
2874
}
2475
2875
 
 
2876
/**
 
2877
 * pci_pm_reset - Put device into PCI_D3 and back into PCI_D0.
 
2878
 * @dev: Device to reset.
 
2879
 * @probe: If set, only check if the device can be reset this way.
 
2880
 *
 
2881
 * If @dev supports native PCI PM and its PCI_PM_CTRL_NO_SOFT_RESET flag is
 
2882
 * unset, it will be reinitialized internally when going from PCI_D3hot to
 
2883
 * PCI_D0.  If that's the case and the device is not in a low-power state
 
2884
 * already, force it into PCI_D3hot and back to PCI_D0, causing it to be reset.
 
2885
 *
 
2886
 * NOTE: This causes the caller to sleep for twice the device power transition
 
2887
 * cooldown period, which for the D0->D3hot and D3hot->D0 transitions is 10 ms
 
2888
 * by devault (i.e. unless the @dev's d3_delay field has a different value).
 
2889
 * Moreover, only devices in D0 can be reset by this function.
 
2890
 */
2476
2891
static int pci_pm_reset(struct pci_dev *dev, int probe)
2477
2892
{
2478
2893
        u16 csr;
2856
3271
}
2857
3272
 
2858
3273
static int pci_set_vga_state_arch(struct pci_dev *dev, bool decode,
2859
 
                      unsigned int command_bits, bool change_bridge)
 
3274
                      unsigned int command_bits, u32 flags)
2860
3275
{
2861
3276
        if (arch_set_vga_state)
2862
3277
                return arch_set_vga_state(dev, decode, command_bits,
2863
 
                                                change_bridge);
 
3278
                                                flags);
2864
3279
        return 0;
2865
3280
}
2866
3281
 
2869
3284
 * @dev: the PCI device
2870
3285
 * @decode: true = enable decoding, false = disable decoding
2871
3286
 * @command_bits: PCI_COMMAND_IO and/or PCI_COMMAND_MEMORY
2872
 
 * @change_bridge: traverse ancestors and change bridges
 
3287
 * @flags: traverse ancestors and change bridges
 
3288
 * CHANGE_BRIDGE_ONLY / CHANGE_BRIDGE
2873
3289
 */
2874
3290
int pci_set_vga_state(struct pci_dev *dev, bool decode,
2875
 
                      unsigned int command_bits, bool change_bridge)
 
3291
                      unsigned int command_bits, u32 flags)
2876
3292
{
2877
3293
        struct pci_bus *bus;
2878
3294
        struct pci_dev *bridge;
2879
3295
        u16 cmd;
2880
3296
        int rc;
2881
3297
 
2882
 
        WARN_ON(command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY));
 
3298
        WARN_ON((flags & PCI_VGA_STATE_CHANGE_DECODES) & (command_bits & ~(PCI_COMMAND_IO|PCI_COMMAND_MEMORY)));
2883
3299
 
2884
3300
        /* ARCH specific VGA enables */
2885
 
        rc = pci_set_vga_state_arch(dev, decode, command_bits, change_bridge);
 
3301
        rc = pci_set_vga_state_arch(dev, decode, command_bits, flags);
2886
3302
        if (rc)
2887
3303
                return rc;
2888
3304
 
2889
 
        pci_read_config_word(dev, PCI_COMMAND, &cmd);
2890
 
        if (decode == true)
2891
 
                cmd |= command_bits;
2892
 
        else
2893
 
                cmd &= ~command_bits;
2894
 
        pci_write_config_word(dev, PCI_COMMAND, cmd);
 
3305
        if (flags & PCI_VGA_STATE_CHANGE_DECODES) {
 
3306
                pci_read_config_word(dev, PCI_COMMAND, &cmd);
 
3307
                if (decode == true)
 
3308
                        cmd |= command_bits;
 
3309
                else
 
3310
                        cmd &= ~command_bits;
 
3311
                pci_write_config_word(dev, PCI_COMMAND, cmd);
 
3312
        }
2895
3313
 
2896
 
        if (change_bridge == false)
 
3314
        if (!(flags & PCI_VGA_STATE_CHANGE_BRIDGE))
2897
3315
                return 0;
2898
3316
 
2899
3317
        bus = dev->bus;
3065
3483
                                pci_no_msi();
3066
3484
                        } else if (!strcmp(str, "noaer")) {
3067
3485
                                pci_no_aer();
 
3486
                        } else if (!strncmp(str, "realloc", 7)) {
 
3487
                                pci_realloc();
3068
3488
                        } else if (!strcmp(str, "nodomains")) {
3069
3489
                                pci_no_domains();
3070
3490
                        } else if (!strncmp(str, "cbiosize=", 9)) {