diff options
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r-- | include/linux/libata.h | 68 |
1 files changed, 54 insertions, 14 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 5a9926b34072..efd6f9800762 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -74,6 +74,16 @@ | |||
74 | 74 | ||
75 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) | 75 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) |
76 | 76 | ||
77 | #define ata_print_version_once(dev, version) \ | ||
78 | ({ \ | ||
79 | static bool __print_once; \ | ||
80 | \ | ||
81 | if (!__print_once) { \ | ||
82 | __print_once = true; \ | ||
83 | ata_print_version(dev, version); \ | ||
84 | } \ | ||
85 | }) | ||
86 | |||
77 | /* NEW: debug levels */ | 87 | /* NEW: debug levels */ |
78 | #define HAVE_LIBATA_MSG 1 | 88 | #define HAVE_LIBATA_MSG 1 |
79 | 89 | ||
@@ -1244,20 +1254,50 @@ static inline int sata_srst_pmp(struct ata_link *link) | |||
1244 | /* | 1254 | /* |
1245 | * printk helpers | 1255 | * printk helpers |
1246 | */ | 1256 | */ |
1247 | #define ata_port_printk(ap, lv, fmt, args...) \ | 1257 | __attribute__((format (printf, 3, 4))) |
1248 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) | 1258 | int ata_port_printk(const struct ata_port *ap, const char *level, |
1249 | 1259 | const char *fmt, ...); | |
1250 | #define ata_link_printk(link, lv, fmt, args...) do { \ | 1260 | __attribute__((format (printf, 3, 4))) |
1251 | if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ | 1261 | int ata_link_printk(const struct ata_link *link, const char *level, |
1252 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ | 1262 | const char *fmt, ...); |
1253 | (link)->pmp , ##args); \ | 1263 | __attribute__((format (printf, 3, 4))) |
1254 | else \ | 1264 | int ata_dev_printk(const struct ata_device *dev, const char *level, |
1255 | printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \ | 1265 | const char *fmt, ...); |
1256 | } while(0) | 1266 | |
1257 | 1267 | #define ata_port_err(ap, fmt, ...) \ | |
1258 | #define ata_dev_printk(dev, lv, fmt, args...) \ | 1268 | ata_port_printk(ap, KERN_ERR, fmt, ##__VA_ARGS__) |
1259 | printk("%sata%u.%02u: "fmt, lv, (dev)->link->ap->print_id, \ | 1269 | #define ata_port_warn(ap, fmt, ...) \ |
1260 | (dev)->link->pmp + (dev)->devno , ##args) | 1270 | ata_port_printk(ap, KERN_WARNING, fmt, ##__VA_ARGS__) |
1271 | #define ata_port_notice(ap, fmt, ...) \ | ||
1272 | ata_port_printk(ap, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1273 | #define ata_port_info(ap, fmt, ...) \ | ||
1274 | ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1275 | #define ata_port_dbg(ap, fmt, ...) \ | ||
1276 | ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1277 | |||
1278 | #define ata_link_err(link, fmt, ...) \ | ||
1279 | ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__) | ||
1280 | #define ata_link_warn(link, fmt, ...) \ | ||
1281 | ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__) | ||
1282 | #define ata_link_notice(link, fmt, ...) \ | ||
1283 | ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1284 | #define ata_link_info(link, fmt, ...) \ | ||
1285 | ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1286 | #define ata_link_dbg(link, fmt, ...) \ | ||
1287 | ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1288 | |||
1289 | #define ata_dev_err(dev, fmt, ...) \ | ||
1290 | ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__) | ||
1291 | #define ata_dev_warn(dev, fmt, ...) \ | ||
1292 | ata_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__) | ||
1293 | #define ata_dev_notice(dev, fmt, ...) \ | ||
1294 | ata_dev_printk(dev, KERN_NOTICE, fmt, ##__VA_ARGS__) | ||
1295 | #define ata_dev_info(dev, fmt, ...) \ | ||
1296 | ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__) | ||
1297 | #define ata_dev_dbg(dev, fmt, ...) \ | ||
1298 | ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__) | ||
1299 | |||
1300 | void ata_print_version(const struct device *dev, const char *version); | ||
1261 | 1301 | ||
1262 | /* | 1302 | /* |
1263 | * ata_eh_info helpers | 1303 | * ata_eh_info helpers |