~ubuntu-branches/debian/experimental/devicekit-disks/experimental

« back to all changes in this revision

Viewing changes to src/devkit-disks-device-private.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-10-09 17:52:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091009175220-qflk71dp3tmcyer3
Tags: 007-2
* debian/rules: Enable quilt patch system. Add quilt build dependency.
* Add 01-mkfs-tempdir.patch: Daemon does not create /var/run/DeviceKit-disks/,
  so mkfs jobs fail. Just create the directory in /tmp, this is what /tmp is
  for, after all. (See https://bugs.freedesktop.org/show_bug.cgi?id=24265)
* Add 00git-fix-inhibit.patch: Actually make Inhibit() work again. Taken
  from upstream git head. (LP: #428133)
* Add 02-unlock-CD-trays-after-mounting.patch: Unlike in the hal world, we
  do not have a daemon polling CD drives for eject button presses. In order
  to make hardware tray eject buttons work, unlock the tray after
  mounting a CD. This is pretty much equivalent to yanking out USB sticks,
  which we already handle reasonably (detecting disappeared device,
  force-unmounting). (https://bugs.freedesktop.org/show_bug.cgi?id=24052,
  LP: #397734)
* Add 03-fix-subsystem-check-for-firewire.patch: Firewire subsystem is
  called "ieee1394" in current Linux. Now check for both "ieee1394" and
  "firewire". This fixes firewire drives to not be considered system
  internal any more. (https://bugs.freedesktop.org/show_bug.cgi?id=24351,
  LP: #442604)
* Add 04-mount-vfat-with-shortname-mixed-by-default.patch: The previous
  default, shortname=lower, breaks all-uppercase file names ("touch
  FOO" creates "foo"), thus breaks rsync, and Windows compatibility. The
  default was changed in the Linux kernel for 2.6.32 as well.
  (https://bugs.freedesktop.org/show_bug.cgi?id=24129, LP: #428174)
* Add 00git-crash-on-removing-NULL-value-from-hash.patch: Properly handle
  the situtation where we're processing a 'change' event but the 'remove'
  event has happened but is still queued up in our own process. Also handle
  device file renames and 'move' uevents.
  (http://bugs.freedesktop.org/show_bug.cgi?id=24264, LP: #414407)
* Add 06-show-MMC-MemStick-cards-by-default.patch: Show MMC/MemStick cards
  by default; the previous whitelist in the udev rules ignored them.
  (https://bugs.freedesktop.org/show_bug.cgi?id=24053, LP: #429752)
* Add 05-german-translations.patch: Add German translations.
  (https://bugs.freedesktop.org/show_bug.cgi?id=2024420)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef __DEVKIT_DISKS_DEVICE_PRIVATE_H__
22
22
#define __DEVKIT_DISKS_DEVICE_PRIVATE_H__
23
23
 
24
 
#include <polkit-dbus/polkit-dbus.h>
25
24
#include <dbus/dbus-glib.h>
26
 
#include <devkit-gobject/devkit-gobject.h>
 
25
#include <gudev/gudev.h>
 
26
#include <atasmart.h>
27
27
 
28
28
#include "devkit-disks-types.h"
29
29
 
32
32
struct Job;
33
33
typedef struct Job Job;
34
34
 
35
 
#define ATA_SMART_DATA_ATTRIBUTE_STRUCT_TYPE (dbus_g_type_get_struct ("GValueArray", \
36
 
                                                                      G_TYPE_UINT, \
37
 
                                                                      G_TYPE_STRING, \
38
 
                                                                      G_TYPE_UINT, \
39
 
                                                                      G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, \
40
 
                                                                      G_TYPE_UCHAR, G_TYPE_BOOLEAN, \
41
 
                                                                      G_TYPE_UCHAR, G_TYPE_BOOLEAN, \
42
 
                                                                      G_TYPE_UCHAR, G_TYPE_BOOLEAN, \
43
 
                                                                      G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, \
44
 
                                                                      G_TYPE_UINT, G_TYPE_UINT64, \
45
 
                                                                      dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR), \
46
 
                                                                      G_TYPE_INVALID))
47
 
 
48
 
#define ATA_SMART_HISTORICAL_SMART_DATA_STRUCT_TYPE (dbus_g_type_get_struct ("GValueArray",   \
49
 
                                                                             G_TYPE_UINT64, \
50
 
                                                                             G_TYPE_BOOLEAN, \
51
 
                                                                             G_TYPE_BOOLEAN, \
52
 
                                                                             G_TYPE_BOOLEAN, \
53
 
                                                                             G_TYPE_BOOLEAN, \
54
 
                                                                             G_TYPE_DOUBLE, \
55
 
                                                                             G_TYPE_UINT64, \
56
 
                                                                             dbus_g_type_get_collection ("GPtrArray", ATA_SMART_DATA_ATTRIBUTE_STRUCT_TYPE), \
57
 
                                                                             G_TYPE_INVALID))
58
 
 
59
35
#define LSOF_DATA_STRUCT_TYPE (dbus_g_type_get_struct ("GValueArray",   \
60
36
                                                       G_TYPE_UINT,     \
61
37
                                                       G_TYPE_UINT,     \
65
41
struct DevkitDisksDevicePrivate
66
42
{
67
43
        DBusGConnection *system_bus_connection;
68
 
        DBusGProxy      *system_bus_proxy;
69
44
        DevkitDisksDaemon *daemon;
70
 
        DevkitDevice *d;
 
45
        GUdevDevice *d;
71
46
 
72
47
        Job *job;
73
48
 
92
67
        /* if non-zero, the id of the idle for emitting a 'change' signal */
93
68
        guint emit_changed_idle_id;
94
69
 
95
 
        /**************/
96
 
        /* properties */
97
 
        /*************/
 
70
        /*****************/
 
71
        /* Disk spindown */
 
72
        /*****************/
 
73
 
 
74
        /* A list of current spindown configurators (DevkitDisksInhibitor objects)
 
75
         *
 
76
         * Each object will have a data element, @spindown-timeout-seconds, that is
 
77
         * the requested timeout for the inhibitor in question. It can be read via
 
78
         *
 
79
         *  GPOINTER_TO_INT (g_object_get_data (G_OBJECT (inhibitor), "spindown-timeout-seconds"));
 
80
         */
 
81
        GList *spindown_inhibitors;
 
82
 
 
83
        /* The timeout the disk is currently configured with, in seconds. This is 0 if spindown
 
84
         * is not enabled. Depending on the command-set used, a slightly different rounded value
 
85
         * may have been sent to the disk - for example, the ATA command-set has a rather peculiar
 
86
         * mapping, see the hdparm(1) man-page, option -S.
 
87
         *
 
88
         * This value is computed by considering all per-disk spindown inhibitors (set
 
89
         * via the DriveSetSpindownTimeout() method on the device) and all global spindown
 
90
         * inhibitors (set via the DriveSetAllSpindownTimeouts() method on the daemon).
 
91
         */
 
92
        gint spindown_timeout;
 
93
 
 
94
        /**************/
 
95
        /* Properties */
 
96
        /**************/
98
97
 
99
98
        char *device_file;
100
99
        dev_t dev;
122
121
        GPtrArray *device_mount_paths;
123
122
        uid_t device_mounted_by_uid;
124
123
        gboolean device_presentation_hide;
 
124
        gboolean device_presentation_nopolicy;
125
125
        char *device_presentation_name;
126
126
        char *device_presentation_icon_name;
127
127
 
153
153
        GPtrArray *drive_media_compatibility;
154
154
        char *drive_media;
155
155
        gboolean drive_is_media_ejectable;
156
 
        gboolean drive_requires_eject;
 
156
        gboolean drive_can_detach;
 
157
        gboolean drive_can_spindown;
 
158
        gboolean drive_is_rotational;
157
159
 
158
160
        gboolean optical_disc_is_blank;
159
161
        gboolean optical_disc_is_appendable;
191
193
        guint64 linux_md_sync_speed;
192
194
 
193
195
        gboolean drive_ata_smart_is_available;
194
 
        gboolean drive_ata_smart_is_failing;
195
 
        gboolean drive_ata_smart_is_failing_valid;
196
 
        gboolean drive_ata_smart_has_bad_sectors;
197
 
        gboolean drive_ata_smart_has_bad_attributes;
198
 
        gdouble drive_ata_smart_temperature_kelvin;
199
 
        guint64 drive_ata_smart_power_on_seconds;
200
196
        guint64 drive_ata_smart_time_collected;
201
 
        guint drive_ata_smart_offline_data_collection_status;
202
 
        guint drive_ata_smart_offline_data_collection_seconds;
203
 
        guint drive_ata_smart_self_test_execution_status;
204
 
        guint drive_ata_smart_self_test_execution_percent_remaining;
205
 
        gboolean drive_ata_smart_short_and_extended_self_test_available;
206
 
        gboolean drive_ata_smart_conveyance_self_test_available;
207
 
        gboolean drive_ata_smart_start_self_test_available;
208
 
        gboolean drive_ata_smart_abort_self_test_available;
209
 
        guint drive_ata_smart_short_self_test_polling_minutes;
210
 
        guint drive_ata_smart_extended_self_test_polling_minutes;
211
 
        guint drive_ata_smart_conveyance_self_test_polling_minutes;
212
 
        GPtrArray *drive_ata_smart_attributes;
 
197
        SkSmartOverall drive_ata_smart_status;
 
198
        void *drive_ata_smart_blob;
 
199
        gsize drive_ata_smart_blob_size;
213
200
 
214
201
        /* the following properties are not (yet) exported */
215
202
        char *dm_name;
252
239
void devkit_disks_device_set_device_mount_paths (DevkitDisksDevice *device, GStrv value);
253
240
void devkit_disks_device_set_device_mounted_by_uid (DevkitDisksDevice *device, guint value);
254
241
void devkit_disks_device_set_device_presentation_hide (DevkitDisksDevice *device, gboolean value);
 
242
void devkit_disks_device_set_device_presentation_nopolicy (DevkitDisksDevice *device, gboolean value);
255
243
void devkit_disks_device_set_device_presentation_name (DevkitDisksDevice *device, const gchar *value);
256
244
void devkit_disks_device_set_device_presentation_icon_name (DevkitDisksDevice *device, const gchar *value);
257
245
 
283
271
void devkit_disks_device_set_drive_media_compatibility (DevkitDisksDevice *device, GStrv value);
284
272
void devkit_disks_device_set_drive_media (DevkitDisksDevice *device, const gchar *value);
285
273
void devkit_disks_device_set_drive_is_media_ejectable (DevkitDisksDevice *device, gboolean value);
286
 
void devkit_disks_device_set_drive_requires_eject (DevkitDisksDevice *device, gboolean value);
 
274
void devkit_disks_device_set_drive_can_detach (DevkitDisksDevice *device, gboolean value);
 
275
void devkit_disks_device_set_drive_can_spindown (DevkitDisksDevice *device, gboolean value);
 
276
void devkit_disks_device_set_drive_is_rotational (DevkitDisksDevice *device, gboolean value);
287
277
 
288
278
void devkit_disks_device_set_optical_disc_is_blank (DevkitDisksDevice *device, gboolean value);
289
279
void devkit_disks_device_set_optical_disc_is_appendable (DevkitDisksDevice *device, gboolean value);
324
314
void devkit_disks_device_set_holders_objpath (DevkitDisksDevice *device, GStrv value);
325
315
 
326
316
void devkit_disks_device_set_drive_ata_smart_is_available (DevkitDisksDevice *device, gboolean value);
327
 
void devkit_disks_device_set_drive_ata_smart_is_failing (DevkitDisksDevice *device, gboolean value);
328
 
void devkit_disks_device_set_drive_ata_smart_is_failing_valid (DevkitDisksDevice *device, gboolean value);
329
 
void devkit_disks_device_set_drive_ata_smart_has_bad_sectors (DevkitDisksDevice *device, gboolean value);
330
 
void devkit_disks_device_set_drive_ata_smart_has_bad_attributes (DevkitDisksDevice *device, gboolean value);
331
 
void devkit_disks_device_set_drive_ata_smart_temperature_kelvin (DevkitDisksDevice *device, gdouble value);
332
 
void devkit_disks_device_set_drive_ata_smart_power_on_seconds (DevkitDisksDevice *device, guint64 value);
333
317
void devkit_disks_device_set_drive_ata_smart_time_collected (DevkitDisksDevice *device, guint64 value);
334
 
void devkit_disks_device_set_drive_ata_smart_offline_data_collection_status (DevkitDisksDevice *device, guint value);
335
 
void devkit_disks_device_set_drive_ata_smart_offline_data_collection_seconds (DevkitDisksDevice *device, guint value);
336
 
void devkit_disks_device_set_drive_ata_smart_self_test_execution_status (DevkitDisksDevice *device, guint value);
337
 
void devkit_disks_device_set_drive_ata_smart_self_test_execution_percent_remaining (DevkitDisksDevice *device, guint value);
338
 
void devkit_disks_device_set_drive_ata_smart_short_and_extended_self_test_available (DevkitDisksDevice *device, gboolean value);
339
 
void devkit_disks_device_set_drive_ata_smart_conveyance_self_test_available (DevkitDisksDevice *device, gboolean value);
340
 
void devkit_disks_device_set_drive_ata_smart_start_self_test_available (DevkitDisksDevice *device, gboolean value);
341
 
void devkit_disks_device_set_drive_ata_smart_abort_self_test_available (DevkitDisksDevice *device, gboolean value);
342
 
void devkit_disks_device_set_drive_ata_smart_short_self_test_polling_minutes (DevkitDisksDevice *device, guint value);
343
 
void devkit_disks_device_set_drive_ata_smart_extended_self_test_polling_minutes (DevkitDisksDevice *device, guint value);
344
 
void devkit_disks_device_set_drive_ata_smart_conveyance_self_test_polling_minutes (DevkitDisksDevice *device, guint value);
345
 
void devkit_disks_device_set_drive_ata_smart_attributes_steal (DevkitDisksDevice *device, GPtrArray *attributes);
 
318
void devkit_disks_device_set_drive_ata_smart_status (DevkitDisksDevice *device, SkSmartOverall value);
 
319
void devkit_disks_device_set_drive_ata_smart_blob_steal (DevkitDisksDevice *device, gchar *blob, gsize blob_size);
346
320
 
347
321
 
348
322
G_END_DECLS