|
Lines 29-35
Link Here
|
| 29 |
|
29 |
|
| 30 |
static nv_linux_state_t nv_linux_devices[NV_MAX_DEVICES]; |
30 |
static nv_linux_state_t nv_linux_devices[NV_MAX_DEVICES]; |
| 31 |
|
31 |
|
| 32 |
#if defined(NV_PM_SUPPORT_APM) |
32 |
#if defined(NV_PM_SUPPORT_OLD_STYLE_APM) |
| 33 |
static struct pm_dev *apm_nv_dev[NV_MAX_DEVICES] = { 0 }; |
33 |
static struct pm_dev *apm_nv_dev[NV_MAX_DEVICES] = { 0 }; |
| 34 |
#endif |
34 |
#endif |
| 35 |
|
35 |
|
|
Lines 244-251
Link Here
|
| 244 |
void nv_kern_isr_bh(unsigned long); |
244 |
void nv_kern_isr_bh(unsigned long); |
| 245 |
irqreturn_t nv_kern_isr(int, void *, struct pt_regs *); |
245 |
irqreturn_t nv_kern_isr(int, void *, struct pt_regs *); |
| 246 |
void nv_kern_rc_timer(unsigned long); |
246 |
void nv_kern_rc_timer(unsigned long); |
| 247 |
#if defined(NV_PM_SUPPORT_APM) |
247 |
#if defined(NV_PM_SUPPORT_OLD_STYLE_APM) |
| 248 |
int nv_kern_apm_event(struct pm_dev *dev, pm_request_t rqst, void *data); |
248 |
static int nv_kern_apm_event(struct pm_dev *, pm_request_t, void *); |
| 249 |
#endif |
249 |
#endif |
| 250 |
|
250 |
|
| 251 |
static int nv_kern_read_cardinfo(char *, char **, off_t off, int, int *, void *); |
251 |
static int nv_kern_read_cardinfo(char *, char **, off_t off, int, int *, void *); |
|
Lines 265-273
Link Here
|
| 265 |
unsigned int nv_kern_ctl_poll(struct file *, poll_table *); |
265 |
unsigned int nv_kern_ctl_poll(struct file *, poll_table *); |
| 266 |
|
266 |
|
| 267 |
int nv_kern_probe(struct pci_dev *, const struct pci_device_id *); |
267 |
int nv_kern_probe(struct pci_dev *, const struct pci_device_id *); |
| 268 |
#if defined(NV_PM_SUPPORT_ACPI) |
268 |
|
| 269 |
int nv_kern_acpi_standby(struct pci_dev *, u32); |
269 |
#if defined(NV_PM_SUPPORT_DEVICE_DRIVER_MODEL) |
| 270 |
int nv_kern_acpi_resume(struct pci_dev *); |
270 |
static int nv_kern_suspend(struct pci_dev *, pm_message_t); |
|
|
271 |
static int nv_kern_resume(struct pci_dev *); |
| 271 |
#endif |
272 |
#endif |
| 272 |
|
273 |
|
| 273 |
/*** |
274 |
/*** |
|
Lines 292-300
Link Here
|
| 292 |
.name = "nvidia", |
293 |
.name = "nvidia", |
| 293 |
.id_table = nv_pci_table, |
294 |
.id_table = nv_pci_table, |
| 294 |
.probe = nv_kern_probe, |
295 |
.probe = nv_kern_probe, |
| 295 |
#if defined(NV_PM_SUPPORT_ACPI) |
296 |
#if defined(NV_PM_SUPPORT_DEVICE_DRIVER_MODEL) |
| 296 |
.suspend = nv_kern_acpi_standby, |
297 |
.suspend = nv_kern_suspend, |
| 297 |
.resume = nv_kern_acpi_resume, |
298 |
.resume = nv_kern_resume, |
| 298 |
#endif |
299 |
#endif |
| 299 |
}; |
300 |
}; |
| 300 |
|
301 |
|
|
Lines 852-858
Link Here
|
| 852 |
|
853 |
|
| 853 |
if (!test_bit(X86_FEATURE_PAT, (volatile unsigned long *)&boot_cpu_data.x86_capability)) |
854 |
if (!test_bit(X86_FEATURE_PAT, (volatile unsigned long *)&boot_cpu_data.x86_capability)) |
| 854 |
{ |
855 |
{ |
| 855 |
nv_printf(NV_DBG_ERRORS, "NVRM: cpu does not support PAT, aborting..\n"); |
856 |
nv_printf(NV_DBG_ERRORS, |
|
|
857 |
"NVRM: CPU does not support the PAT, falling back to MTRRs.\n"); |
| 856 |
return 0; |
858 |
return 0; |
| 857 |
} |
859 |
} |
| 858 |
|
860 |
|
|
Lines 1084-1092
Link Here
|
| 1084 |
|
1086 |
|
| 1085 |
// broken kernels may get confused after splitting the page and |
1087 |
// broken kernels may get confused after splitting the page and |
| 1086 |
// restore the page before returning to us. detect that case. |
1088 |
// restore the page before returning to us. detect that case. |
| 1087 |
if ( (pte_val(*kpte) == kpte_val) && |
1089 |
if (((pte_val(*kpte) & ~_PAGE_NX) == kpte_val) && |
| 1088 |
(pte_val(*kpte) & _PAGE_PSE)) |
1090 |
(pte_val(*kpte) & _PAGE_PSE)) |
| 1089 |
{ |
1091 |
{ |
|
|
1092 |
if ((pte_val(*kpte) & _PAGE_NX) && |
| 1093 |
(__nv_supported_pte_mask & _PAGE_NX) == 0) |
| 1094 |
clear_bit(_PAGE_BIT_NX, kpte); |
| 1090 |
spin_unlock(&init_mm.page_table_lock); |
1095 |
spin_unlock(&init_mm.page_table_lock); |
| 1091 |
// don't change the page back, as it's already been reverted |
1096 |
// don't change the page back, as it's already been reverted |
| 1092 |
put_page(kpte_page); |
1097 |
put_page(kpte_page); |
|
Lines 1299-1305
Link Here
|
| 1299 |
nv_lock_init_locks(nv_ctl); |
1304 |
nv_lock_init_locks(nv_ctl); |
| 1300 |
} |
1305 |
} |
| 1301 |
|
1306 |
|
| 1302 |
#if defined(NV_PM_SUPPORT_APM) |
1307 |
#if defined(NV_PM_SUPPORT_OLD_STYLE_APM) |
| 1303 |
for (i = 0; i < num_nv_devices; i++) |
1308 |
for (i = 0; i < num_nv_devices; i++) |
| 1304 |
{ |
1309 |
{ |
| 1305 |
apm_nv_dev[i] = pm_register(PM_PCI_DEV, PM_SYS_VGA, nv_kern_apm_event); |
1310 |
apm_nv_dev[i] = pm_register(PM_PCI_DEV, PM_SYS_VGA, nv_kern_apm_event); |
|
Lines 1407-1414
Link Here
|
| 1407 |
|
1412 |
|
| 1408 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) |
1413 |
#if defined(NV_BUILD_NV_PAT_SUPPORT) |
| 1409 |
if (!nv_disable_pat) |
1414 |
if (!nv_disable_pat) |
| 1410 |
{ |
|
|
| 1411 |
__nv_enable_pat_support(); |
1415 |
__nv_enable_pat_support(); |
|
|
1416 |
else |
| 1417 |
{ |
| 1418 |
nv_printf(NV_DBG_ERRORS, |
| 1419 |
"NVRM: builtin PAT support disabled, falling back to MTRRs.\n"); |
| 1412 |
} |
1420 |
} |
| 1413 |
#endif |
1421 |
#endif |
| 1414 |
|
1422 |
|
|
Lines 1418-1424
Link Here
|
| 1418 |
if (nv_pte_t_cache != NULL) |
1426 |
if (nv_pte_t_cache != NULL) |
| 1419 |
NV_KMEM_CACHE_DESTROY(nv_pte_t_cache); |
1427 |
NV_KMEM_CACHE_DESTROY(nv_pte_t_cache); |
| 1420 |
|
1428 |
|
| 1421 |
#if defined(NV_PM_SUPPORT_APM) |
1429 |
#if defined(NV_PM_SUPPORT_OLD_STYLE_APM) |
| 1422 |
for (i = 0; i < num_nv_devices; i++) |
1430 |
for (i = 0; i < num_nv_devices; i++) |
| 1423 |
if (apm_nv_dev[i] != NULL) pm_unregister(apm_nv_dev[i]); |
1431 |
if (apm_nv_dev[i] != NULL) pm_unregister(apm_nv_dev[i]); |
| 1424 |
#endif |
1432 |
#endif |
|
Lines 1473-1482
Link Here
|
| 1473 |
inter_module_unregister("nv_linux_devices"); |
1481 |
inter_module_unregister("nv_linux_devices"); |
| 1474 |
#endif |
1482 |
#endif |
| 1475 |
|
1483 |
|
| 1476 |
#if defined(NV_PM_SUPPORT_APM) |
1484 |
#if defined(NV_PM_SUPPORT_OLD_STYLE_APM) |
| 1477 |
for (i = 0; i < num_nv_devices; i++) |
1485 |
for (i = 0; i < num_nv_devices; i++) |
| 1478 |
{ |
1486 |
{ |
| 1479 |
pm_unregister(apm_nv_dev[i]); |
1487 |
if (apm_nv_dev[i] != NULL) pm_unregister(apm_nv_dev[i]); |
| 1480 |
} |
1488 |
} |
| 1481 |
#endif |
1489 |
#endif |
| 1482 |
|
1490 |
|
|
Lines 1889-1897
Link Here
|
| 1889 |
// allow setting or refusal of specific caching types |
1897 |
// allow setting or refusal of specific caching types |
| 1890 |
switch (cache_type) |
1898 |
switch (cache_type) |
| 1891 |
{ |
1899 |
{ |
| 1892 |
case NV_MEMORY_CACHED: |
|
|
| 1893 |
//case NV_MEMORY_WRITEBACK: |
| 1894 |
break; |
| 1895 |
case NV_MEMORY_UNCACHED_WEAK: |
1900 |
case NV_MEMORY_UNCACHED_WEAK: |
| 1896 |
*prot = pgprot_noncached_weak(*prot); |
1901 |
*prot = pgprot_noncached_weak(*prot); |
| 1897 |
break; |
1902 |
break; |
|
Lines 1899-1917
Link Here
|
| 1899 |
*prot = pgprot_noncached(*prot); |
1904 |
*prot = pgprot_noncached(*prot); |
| 1900 |
break; |
1905 |
break; |
| 1901 |
case NV_MEMORY_WRITECOMBINED: |
1906 |
case NV_MEMORY_WRITECOMBINED: |
| 1902 |
if (nv_pat_enabled) |
1907 |
if (nv_pat_enabled && |
|
|
1908 |
(memory_type != NV_MEMORY_TYPE_REGISTERS)) |
| 1903 |
{ |
1909 |
{ |
| 1904 |
*prot = pgprot_writecombined(*prot); |
1910 |
*prot = pgprot_writecombined(*prot); |
| 1905 |
break; |
1911 |
break; |
| 1906 |
} |
1912 |
} |
| 1907 |
/* agp allocations should be covered by an mtrr if pat isn't enabled */ |
1913 |
/* |
|
|
1914 |
* If PAT support is unavailable and the memory space isn't |
| 1915 |
* NV_MEMORY_TYPE_AGP, we need to return an error code to |
| 1916 |
* the caller, but do not print a warning message. |
| 1917 |
* |
| 1918 |
* In the case of AGP memory, we will have attempted to add |
| 1919 |
* a WC MTRR for the AGP aperture and aborted the AGP |
| 1920 |
* initialization if this failed, so we can safely return |
| 1921 |
* success here. |
| 1922 |
* |
| 1923 |
* For frame buffer memory, callers are expected to use the |
| 1924 |
* UC- memory type if we report WC as unsupported, which |
| 1925 |
* translates to the effective memory type WC if a WC MTRR |
| 1926 |
* exists or else UC. |
| 1927 |
*/ |
| 1908 |
if (memory_type == NV_MEMORY_TYPE_AGP) |
1928 |
if (memory_type == NV_MEMORY_TYPE_AGP) |
| 1909 |
break; |
1929 |
break; |
|
|
1930 |
return 1; |
| 1931 |
case NV_MEMORY_CACHED: |
| 1932 |
//case NV_MEMORY_WRITEBACK: |
| 1933 |
/* |
| 1934 |
* RAM is cached on Linux by default, we can assume there's |
| 1935 |
* nothing to be done here. This is not the case for the |
| 1936 |
* other memory spaces: as commented on above, we will have |
| 1937 |
* added a WC MTRR for the AGP aperture (or else aborted |
| 1938 |
* AGP initialization), and we will have made an attempt to |
| 1939 |
* add a WC MTRR for the frame buffer. |
| 1940 |
* |
| 1941 |
* If a WC MTRR is present, we can't satisfy the WB mapping |
| 1942 |
* attempt here, since the achievable effective memory |
| 1943 |
* types in that case are WC and UC, if not it's typically |
| 1944 |
* UC (MTRRdefType is UC); we could only satisfy WB mapping |
| 1945 |
* requests with a WB MTRR. |
| 1946 |
*/ |
| 1947 |
if (memory_type == NV_MEMORY_TYPE_SYSTEM) |
| 1948 |
break; |
| 1910 |
//case NV_MEMORY_WRITETHRU: |
1949 |
//case NV_MEMORY_WRITETHRU: |
| 1911 |
//case NV_MEMORY_WRITEPROTECT: |
1950 |
//case NV_MEMORY_WRITEPROTECT: |
| 1912 |
default: |
1951 |
default: |
| 1913 |
nv_printf(NV_DBG_ERRORS, |
1952 |
nv_printf(NV_DBG_ERRORS, |
| 1914 |
"NVRM: memory caching type 0x%x not supported for memory space %d!\n", |
1953 |
"NVRM: VM: memory type %d not supported for memory space %d!\n", |
| 1915 |
cache_type, memory_type); |
1954 |
cache_type, memory_type); |
| 1916 |
return 1; |
1955 |
return 1; |
| 1917 |
} |
1956 |
} |
|
Lines 2118-2125
Link Here
|
| 2118 |
for (j = i; j < (i + pages); j++) |
2157 |
for (j = i; j < (i + pages); j++) |
| 2119 |
{ |
2158 |
{ |
| 2120 |
nv_verify_page_mappings(at->page_table[j], NV_ALLOC_MAPPING(at->flags)); |
2159 |
nv_verify_page_mappings(at->page_table[j], NV_ALLOC_MAPPING(at->flags)); |
|
|
2160 |
#if defined(NV_VM_INSERT_PAGE_PRESENT) |
| 2161 |
if (NV_VM_INSERT_PAGE(vma, start, |
| 2162 |
NV_GET_PAGE_STRUCT(at->page_table[j]->phys_addr))) |
| 2163 |
#else |
| 2121 |
if (NV_REMAP_PAGE_RANGE(start, at->page_table[j]->phys_addr, |
2164 |
if (NV_REMAP_PAGE_RANGE(start, at->page_table[j]->phys_addr, |
| 2122 |
PAGE_SIZE, vma->vm_page_prot)) |
2165 |
PAGE_SIZE, vma->vm_page_prot)) |
|
|
2166 |
#endif |
| 2123 |
{ |
2167 |
{ |
| 2124 |
NV_ATOMIC_DEC(at->usage_count); |
2168 |
NV_ATOMIC_DEC(at->usage_count); |
| 2125 |
return -EAGAIN; |
2169 |
return -EAGAIN; |
|
Lines 2429-2437
Link Here
|
| 2429 |
mod_timer(&nvl->rc_timer, jiffies + HZ); /* set another timeout in 1 second */ |
2473 |
mod_timer(&nvl->rc_timer, jiffies + HZ); /* set another timeout in 1 second */ |
| 2430 |
} |
2474 |
} |
| 2431 |
|
2475 |
|
| 2432 |
#if defined(NV_PM_SUPPORT_APM) |
2476 |
#if defined(NV_PM_SUPPORT_OLD_STYLE_APM) |
| 2433 |
/* kernel calls us with a power management event */ |
2477 |
/* kernel calls us with a power management event */ |
| 2434 |
int |
2478 |
static int |
| 2435 |
nv_kern_apm_event( |
2479 |
nv_kern_apm_event( |
| 2436 |
struct pm_dev *dev, |
2480 |
struct pm_dev *dev, |
| 2437 |
pm_request_t rqst, |
2481 |
pm_request_t rqst, |
|
Lines 2466-2472
Link Here
|
| 2466 |
|
2510 |
|
| 2467 |
switch (rqst) |
2511 |
switch (rqst) |
| 2468 |
{ |
2512 |
{ |
| 2469 |
#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE) |
|
|
| 2470 |
case PM_RESUME: |
2513 |
case PM_RESUME: |
| 2471 |
nv_printf(NV_DBG_INFO, "NVRM: APM: received resume event\n"); |
2514 |
nv_printf(NV_DBG_INFO, "NVRM: APM: received resume event\n"); |
| 2472 |
status = rm_power_management(nv, 0, NV_PM_APM_RESUME); |
2515 |
status = rm_power_management(nv, 0, NV_PM_APM_RESUME); |
|
Lines 2476-2490
Link Here
|
| 2476 |
nv_printf(NV_DBG_INFO, "NVRM: APM: received suspend event\n"); |
2519 |
nv_printf(NV_DBG_INFO, "NVRM: APM: received suspend event\n"); |
| 2477 |
status = rm_power_management(nv, 0, NV_PM_APM_SUSPEND); |
2520 |
status = rm_power_management(nv, 0, NV_PM_APM_SUSPEND); |
| 2478 |
break; |
2521 |
break; |
| 2479 |
#endif |
|
|
| 2480 |
|
2522 |
|
| 2481 |
#if defined(KERNEL_2_4) |
|
|
| 2482 |
// 2.4 kernels sent a PM_SAVE_STATE request when powering down via |
2523 |
// 2.4 kernels sent a PM_SAVE_STATE request when powering down via |
| 2483 |
// ACPI. just ignore it and return success so the power down works |
2524 |
// ACPI. just ignore it and return success so the power down works |
| 2484 |
case PM_SAVE_STATE: |
2525 |
case PM_SAVE_STATE: |
| 2485 |
status = RM_OK; |
2526 |
status = RM_OK; |
| 2486 |
break; |
2527 |
break; |
| 2487 |
#endif |
|
|
| 2488 |
|
2528 |
|
| 2489 |
default: |
2529 |
default: |
| 2490 |
nv_printf(NV_DBG_WARNINGS, "NVRM: APM: unsupported event: %d\n", rqst); |
2530 |
nv_printf(NV_DBG_WARNINGS, "NVRM: APM: unsupported event: %d\n", rqst); |
|
Lines 2496-2502
Link Here
|
| 2496 |
|
2536 |
|
| 2497 |
return status; |
2537 |
return status; |
| 2498 |
} |
2538 |
} |
| 2499 |
#endif |
2539 |
#endif /* defined(NV_PM_SUPPORT_OLD_STYLE_APM) */ |
| 2500 |
|
2540 |
|
| 2501 |
/* |
2541 |
/* |
| 2502 |
** nv_kern_ctl_open |
2542 |
** nv_kern_ctl_open |
|
Lines 3739-3744
Link Here
|
| 3739 |
nvl = &nv_linux_devices[num_nv_devices]; |
3779 |
nvl = &nv_linux_devices[num_nv_devices]; |
| 3740 |
nv = NV_STATE_PTR(nvl); |
3780 |
nv = NV_STATE_PTR(nvl); |
| 3741 |
|
3781 |
|
|
|
3782 |
pci_set_drvdata(dev, (void *)nvl); |
| 3742 |
nvl->dev = dev; |
3783 |
nvl->dev = dev; |
| 3743 |
nv->vendor_id = dev->vendor; |
3784 |
nv->vendor_id = dev->vendor; |
| 3744 |
nv->device_id = dev->device; |
3785 |
nv->device_id = dev->device; |
|
Lines 3816-3826
Link Here
|
| 3816 |
#endif |
3857 |
#endif |
| 3817 |
} |
3858 |
} |
| 3818 |
|
3859 |
|
| 3819 |
#if defined(NV_PM_SUPPORT_ACPI) |
3860 |
#if defined(NV_PM_SUPPORT_DEVICE_DRIVER_MODEL) |
| 3820 |
|
3861 |
|
| 3821 |
int |
3862 |
static int |
| 3822 |
nv_acpi_event |
3863 |
nv_power_management( |
| 3823 |
( |
|
|
| 3824 |
struct pci_dev *dev, |
3864 |
struct pci_dev *dev, |
| 3825 |
u32 state |
3865 |
u32 state |
| 3826 |
) |
3866 |
) |
|
Lines 3828-3897
Link Here
|
| 3828 |
nv_state_t *nv; |
3868 |
nv_state_t *nv; |
| 3829 |
nv_linux_state_t *lnv = NULL; |
3869 |
nv_linux_state_t *lnv = NULL; |
| 3830 |
int status = RM_OK; |
3870 |
int status = RM_OK; |
| 3831 |
U032 i; |
|
|
| 3832 |
|
3871 |
|
| 3833 |
nv_printf(NV_DBG_INFO, "NVRM: nv_acpi_event: %d\n", state); |
3872 |
nv_printf(NV_DBG_INFO, "NVRM: nv_power_management: %d\n", state); |
| 3834 |
|
3873 |
lnv = pci_get_drvdata(dev); |
| 3835 |
for (i = 0; i < num_nv_devices; i++) |
|
|
| 3836 |
{ |
| 3837 |
if (nv_linux_devices[i].dev == dev) |
| 3838 |
{ |
| 3839 |
lnv = &nv_linux_devices[i]; |
| 3840 |
break; |
| 3841 |
} |
| 3842 |
} |
| 3843 |
|
3874 |
|
| 3844 |
if ((!lnv) || (lnv->dev != dev)) |
3875 |
if ((!lnv) || (lnv->dev != dev)) |
| 3845 |
{ |
3876 |
{ |
| 3846 |
nv_printf(NV_DBG_WARNINGS, "NVRM: ACPI: invalid device!\n"); |
3877 |
nv_printf(NV_DBG_WARNINGS, "NVRM: PM: invalid device!\n"); |
| 3847 |
return -1; |
3878 |
return -1; |
| 3848 |
} |
3879 |
} |
| 3849 |
|
3880 |
|
| 3850 |
nv = NV_STATE_PTR(lnv); |
3881 |
nv = NV_STATE_PTR(lnv); |
|
|
3882 |
nv_verify_pci_config(NV_STATE_PTR(lnv), TRUE); |
| 3851 |
|
3883 |
|
| 3852 |
switch (state) |
3884 |
switch (state) |
| 3853 |
{ |
3885 |
{ |
| 3854 |
case PM_SUSPEND_MEM: |
3886 |
#if defined(NV_PM_SUPPORT_NEW_STYLE_APM) |
|
|
3887 |
case PCI_D3hot: |
| 3888 |
nv_printf(NV_DBG_INFO, "NVRM: APM: received suspend event\n"); |
| 3889 |
status = rm_power_management(nv, 0, NV_PM_APM_SUSPEND); |
| 3890 |
break; |
| 3891 |
|
| 3892 |
case PCI_D0: |
| 3893 |
nv_printf(NV_DBG_INFO, "NVRM: APM: received resume event\n"); |
| 3894 |
status = rm_power_management(nv, 0, NV_PM_APM_RESUME); |
| 3895 |
break; |
| 3896 |
#else |
| 3897 |
case PCI_D3hot: |
| 3855 |
nv_printf(NV_DBG_INFO, "NVRM: ACPI: received suspend event\n"); |
3898 |
nv_printf(NV_DBG_INFO, "NVRM: ACPI: received suspend event\n"); |
| 3856 |
status = rm_power_management(nv, 0, NV_PM_ACPI_STANDBY); |
3899 |
status = rm_power_management(nv, 0, NV_PM_ACPI_STANDBY); |
| 3857 |
break; |
3900 |
break; |
| 3858 |
|
3901 |
|
| 3859 |
case PM_SUSPEND_ON: |
3902 |
case PCI_D0: |
| 3860 |
nv_printf(NV_DBG_INFO, "NVRM: ACPI: received resume event\n"); |
3903 |
nv_printf(NV_DBG_INFO, "NVRM: ACPI: received resume event\n"); |
| 3861 |
status = rm_power_management(nv, 0, NV_PM_ACPI_RESUME); |
3904 |
status = rm_power_management(nv, 0, NV_PM_ACPI_RESUME); |
| 3862 |
break; |
3905 |
break; |
| 3863 |
|
3906 |
#endif |
| 3864 |
default: |
3907 |
default: |
| 3865 |
nv_printf(NV_DBG_WARNINGS, "NVRM: ACPI: unsupported event: %d\n", state); |
3908 |
nv_printf(NV_DBG_WARNINGS, "NVRM: PM: unsupported event: %d\n", state); |
| 3866 |
return -1; |
3909 |
return -1; |
| 3867 |
} |
3910 |
} |
| 3868 |
|
3911 |
|
| 3869 |
if (status != RM_OK) |
3912 |
if (status != RM_OK) |
| 3870 |
nv_printf(NV_DBG_ERRORS, "NVRM: ACPI: failed event: %d\n", state); |
3913 |
nv_printf(NV_DBG_ERRORS, "NVRM: PM: failed event: %d\n", state); |
| 3871 |
|
3914 |
|
| 3872 |
return status; |
3915 |
return status; |
| 3873 |
} |
3916 |
} |
| 3874 |
|
3917 |
|
| 3875 |
int |
3918 |
static int nv_kern_suspend( |
| 3876 |
nv_kern_acpi_standby |
3919 |
struct pci_dev *dev, |
| 3877 |
( |
3920 |
pm_message_t state |
| 3878 |
struct pci_dev *dev, |
|
|
| 3879 |
u32 state |
| 3880 |
) |
3921 |
) |
| 3881 |
{ |
3922 |
{ |
| 3882 |
return nv_acpi_event(dev, state); |
3923 |
int power_state = -1; |
|
|
3924 |
|
| 3925 |
#if !defined(NV_PM_MESSAGE_T_PRESENT) |
| 3926 |
power_state = state; |
| 3927 |
#elif defined(NV_PCI_CHOOSE_STATE_PRESENT) |
| 3928 |
power_state = pci_choose_state(dev, state); |
| 3929 |
#endif |
| 3930 |
|
| 3931 |
return nv_power_management(dev, power_state); |
| 3883 |
} |
3932 |
} |
| 3884 |
|
3933 |
|
| 3885 |
int |
3934 |
static int nv_kern_resume( |
| 3886 |
nv_kern_acpi_resume |
|
|
| 3887 |
( |
| 3888 |
struct pci_dev *dev |
3935 |
struct pci_dev *dev |
| 3889 |
) |
3936 |
) |
| 3890 |
{ |
3937 |
{ |
| 3891 |
return nv_acpi_event(dev, PM_SUSPEND_ON); |
3938 |
return nv_power_management(dev, PCI_D0); |
| 3892 |
} |
3939 |
} |
| 3893 |
|
3940 |
|
| 3894 |
#endif |
3941 |
#endif /* defined(NV_PM_SUPPORT_DEVICE_DRIVER_MODEL) */ |
| 3895 |
|
3942 |
|
| 3896 |
void* NV_API_CALL nv_get_adapter_state( |
3943 |
void* NV_API_CALL nv_get_adapter_state( |
| 3897 |
U016 bus, |
3944 |
U016 bus, |