Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
drm_auth.c File Reference
#include <drm/drmP.h>

Go to the source code of this file.

Functions

int drm_remove_magic (struct drm_master *master, drm_magic_t magic)
 
int drm_getmagic (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int drm_authmagic (struct drm_device *dev, void *data, struct drm_file *file_priv)
 

Detailed Description

IOCTLs for authentication

Author
Rickard E. (Rik) Faith faith.nosp@m.@val.nosp@m.inux..nosp@m.com
Gareth Hughes garet.nosp@m.h@va.nosp@m.linux.nosp@m..com

Definition in file drm_auth.c.

Function Documentation

int drm_authmagic ( struct drm_device dev,
void data,
struct drm_file *  file_priv 
)

Authenticate with a magic.

Parameters
inodedevice inode.
file_privDRM file private.
cmdcommand.
argpointer to a drm_auth structure.
Returns
zero if authentication successed, or a negative number otherwise.

Checks if file_priv is associated with the magic number passed in

  • . This ioctl needs protection by the drm_global_mutex, which protects struct drm_file::magic and struct drm_magic_entry::priv.

Definition at line 181 of file drm_auth.c.

int drm_getmagic ( struct drm_device dev,
void data,
struct drm_file *  file_priv 
)

Get a unique magic number (ioctl).

Parameters
inodedevice inode.
file_privDRM file private.
cmdcommand.
argpointer to a resulting drm_auth structure.
Returns
zero on success, or a negative number on failure.

If there is a magic number in drm_file::magic then use it, otherwise searches an unique non-zero magic number and add it associating it with file_priv. This ioctl needs protection by the drm_global_mutex, which protects struct drm_file::magic and struct drm_magic_entry::priv.

Definition at line 142 of file drm_auth.c.

int drm_remove_magic ( struct drm_master *  master,
drm_magic_t  magic 
)

Remove a magic number.

Parameters
devDRM device.
magicmagic number.

Searches and unlinks the entry in drm_device::magiclist with the magic number hash key, while holding the drm_device::struct_mutex lock.

Definition at line 104 of file drm_auth.c.