mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-24 03:37:16 +00:00
LinuxKPI: move pm_message_t from kernel.h to pm.h
Move pm_message_t from kernel.h to pm.h and remove a private define in usb.h as well as adjust the implementation in linux_usb.c. This cleans up what I believe to be a historic shortcut and is needed for future wireless driver updates. Leave a note in UPDATING that drm-kmod users need to update to the latest version before re-compiling a new kernel to avoid errors (see PR). Sponsored by: The FreeBSD Foundation MFC after: 3 days PR: 264449 (drm-kmod port update, thanks wulf) Obtained from: bz_git_iwlwifi (Dec 2020) (partly) Reviewed by: hselasky, imp Differential Revision: https://reviews.freebsd.org/D35276
This commit is contained in:
parent
60408c23c9
commit
0e981d79b1
4
UPDATING
4
UPDATING
|
@ -27,6 +27,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 14.x IS SLOW:
|
||||||
world, or to merely disable the most expensive debugging functionality
|
world, or to merely disable the most expensive debugging functionality
|
||||||
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||||
|
|
||||||
|
20220610:
|
||||||
|
LinuxKPI pm.h changes require an update to the latest drm-kmod version
|
||||||
|
before re-compiling to avoid errors.
|
||||||
|
|
||||||
20211230:
|
20211230:
|
||||||
The macros provided for the manipulation of CPU sets (e.g. CPU_AND)
|
The macros provided for the manipulation of CPU sets (e.g. CPU_AND)
|
||||||
have been modified to take 2 source arguments instead of only 1.
|
have been modified to take 2 source arguments instead of only 1.
|
||||||
|
|
|
@ -597,10 +597,6 @@ extern bool linux_cpu_has_clflush;
|
||||||
#define cpu_has_clflush linux_cpu_has_clflush
|
#define cpu_has_clflush linux_cpu_has_clflush
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct pm_message {
|
|
||||||
int event;
|
|
||||||
} pm_message_t;
|
|
||||||
|
|
||||||
/* Swap values of a and b */
|
/* Swap values of a and b */
|
||||||
#define swap(a, b) do { \
|
#define swap(a, b) do { \
|
||||||
typeof(a) _swap_tmp = a; \
|
typeof(a) _swap_tmp = a; \
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#include <asm/atomic.h>
|
#include <asm/atomic.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/pci_ids.h>
|
#include <linux/pci_ids.h>
|
||||||
|
#include <linux/pm.h>
|
||||||
|
|
||||||
struct pci_device_id {
|
struct pci_device_id {
|
||||||
uint32_t vendor;
|
uint32_t vendor;
|
||||||
|
|
|
@ -33,6 +33,10 @@
|
||||||
#ifndef _LINUXKPI_LINUX_PM_H
|
#ifndef _LINUXKPI_LINUX_PM_H
|
||||||
#define _LINUXKPI_LINUX_PM_H
|
#define _LINUXKPI_LINUX_PM_H
|
||||||
|
|
||||||
|
typedef struct pm_message {
|
||||||
|
int event;
|
||||||
|
} pm_message_t;
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
#define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \
|
#define SIMPLE_DEV_PM_OPS(_name, _suspendfunc, _resumefunc) \
|
||||||
const struct dev_pm_ops _name = { \
|
const struct dev_pm_ops _name = { \
|
||||||
|
|
|
@ -37,12 +37,13 @@
|
||||||
#include <dev/usb/usbdi.h>
|
#include <dev/usb/usbdi.h>
|
||||||
#include <dev/usb/usbdi_util.h>
|
#include <dev/usb/usbdi_util.h>
|
||||||
|
|
||||||
|
#include <linux/pm.h>
|
||||||
|
|
||||||
struct usb_device;
|
struct usb_device;
|
||||||
struct usb_interface;
|
struct usb_interface;
|
||||||
struct usb_driver;
|
struct usb_driver;
|
||||||
struct urb;
|
struct urb;
|
||||||
|
|
||||||
typedef void *pm_message_t;
|
|
||||||
typedef void (usb_complete_t)(struct urb *);
|
typedef void (usb_complete_t)(struct urb *);
|
||||||
|
|
||||||
#define USB_MAX_FULL_SPEED_ISOC_FRAMES (60 * 1)
|
#define USB_MAX_FULL_SPEED_ISOC_FRAMES (60 * 1)
|
||||||
|
|
|
@ -339,11 +339,14 @@ usb_linux_suspend(device_t dev)
|
||||||
{
|
{
|
||||||
struct usb_linux_softc *sc = device_get_softc(dev);
|
struct usb_linux_softc *sc = device_get_softc(dev);
|
||||||
struct usb_driver *udrv = usb_linux_get_usb_driver(sc);
|
struct usb_driver *udrv = usb_linux_get_usb_driver(sc);
|
||||||
|
pm_message_t pm_msg;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
if (udrv && udrv->suspend)
|
if (udrv && udrv->suspend) {
|
||||||
err = (udrv->suspend) (sc->sc_ui, 0);
|
pm_msg.event = 0; /* XXX */
|
||||||
|
err = (udrv->suspend) (sc->sc_ui, pm_msg);
|
||||||
|
}
|
||||||
return (-err);
|
return (-err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue